link2epub 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +13 -0
- data/lib/link2epub.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b750a9c75c75125fb8a6658fdcb531130e00a0b6
|
4
|
+
data.tar.gz: b6d9ec1a73cfb41bffa3cf7e53adba5009793921
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4246942f04f12aba9b71a9ec0ceb6dda385fbf167ee1674ce44f29e391186bc8e3ad5541bdcc703e4692fb6514e5072ca7d041a87b253e25e824f90b40a4f7d
|
7
|
+
data.tar.gz: 9bffefda1986845dc2ffe98acc48fcc6a6959c5347d3504bc0296972e8abea9df7039969ea599dd103a8d7456b0af5f85b95368a91a8d7faef2bbd6036ea0820
|
data/Rakefile
CHANGED
@@ -3,9 +3,22 @@ task :help do
|
|
3
3
|
puts "commands:"
|
4
4
|
puts "rake help"
|
5
5
|
puts "rake build"
|
6
|
+
puts "rake push"
|
6
7
|
end
|
7
8
|
|
9
|
+
task :default => :help
|
10
|
+
|
8
11
|
desc "build"
|
9
12
|
task :build do
|
10
13
|
sh 'gem build link2epub.gemspec'
|
11
14
|
end
|
15
|
+
|
16
|
+
desc "push gem to http://rubygems.org"
|
17
|
+
task :push do
|
18
|
+
sh 'gem push *.gem'
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "examples"
|
22
|
+
task :example do
|
23
|
+
sh 'cd examples; link2epub conf.yaml'
|
24
|
+
end
|
data/lib/link2epub.rb
CHANGED
@@ -55,7 +55,7 @@ class Epub
|
|
55
55
|
def getArticles
|
56
56
|
@links.each_with_index do |l, i|
|
57
57
|
art = Article.new(l)
|
58
|
-
art.tpl = "
|
58
|
+
art.tpl = "../tpl/article.tpl"
|
59
59
|
art.file = "./file#{i+1}.html"
|
60
60
|
art.content = Nokogiri::HTML(open(art.link)).css('.post .content').to_html
|
61
61
|
art.title = Nokogiri::HTML(open(art.link)).css('.post h2').text
|
@@ -90,8 +90,8 @@ class Epub
|
|
90
90
|
def to_epub
|
91
91
|
getArticles
|
92
92
|
getTitles
|
93
|
-
createFile('
|
94
|
-
createFile('
|
93
|
+
createFile('../tpl/nav.tpl', './nav.html')
|
94
|
+
createFile('../tpl/index.tpl', './index.html')
|
95
95
|
conf = @conf
|
96
96
|
articles = @articles
|
97
97
|
|