jekyll-build-ebook 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ae167dec5aabb0fa3899583a0042bc2b5f43b57e346a4097279716b03e01713
4
- data.tar.gz: d91bd0ed56d86c6765a12320c05967cae1cf2eb5e88928c71b528bcfc393e86b
3
+ metadata.gz: a2ea3637eef335ee5fce9668019b413e42229a65fb0b74d37b36c38197c71893
4
+ data.tar.gz: 55cec7a0b8c977db0296dc1a70d982e762f3615015bc872d3125e5d76bee5742
5
5
  SHA512:
6
- metadata.gz: 0a5362e8afd4661efe3e8bcd0d10c18f5e9848ad2882c11ef62d56cc2f9c9382ed5dc027513033a6d387c79a68f89007a4695fa78ef76faf707ffc62cf4bae34
7
- data.tar.gz: da2bb097718d75b7e482b94d7dc46dcc3116cb3a56afd620b2c2d9abbbb52779a0baa32d3b517977de8c752158725614efcb4a2486dc9a167c57300c5b46e529
6
+ metadata.gz: e079214f1a3b876f0b367b941146f30a93cf7fa94f6172a3e9a92ea228bc8cdb81a7eda24ece8047828414c10695d8c39842c8694576896417702968069beeda
7
+ data.tar.gz: ce42b836d7acb17a0c7952f04af748785e17b9677172d913e64dab413568b831342c5434082161500395ab0045daedd861548a3a2c8cd5eeb1ba05b7d103bf59
data/.gitignore CHANGED
@@ -13,3 +13,56 @@
13
13
  # fixtures output
14
14
  /spec/dest/
15
15
  /spec/ebook/
16
+
17
+ ### https://raw.github.com/github/gitignore/9da1b5d8ce4e009ff627c4fe49a4488b2a3f60d4/Ruby.gitignore
18
+
19
+ *.gem
20
+ *.rbc
21
+ /.config
22
+ /coverage/
23
+ /InstalledFiles
24
+ /pkg/
25
+ /spec/reports/
26
+ /spec/examples.txt
27
+ /test/tmp/
28
+ /test/version_tmp/
29
+ /tmp/
30
+
31
+ # Used by dotenv library to load environment variables.
32
+ # .env
33
+
34
+ ## Specific to RubyMotion:
35
+ .dat*
36
+ .repl_history
37
+ build/
38
+ *.bridgesupport
39
+ build-iPhoneOS/
40
+ build-iPhoneSimulator/
41
+
42
+ ## Specific to RubyMotion (use of CocoaPods):
43
+ #
44
+ # We recommend against adding the Pods directory to your .gitignore. However
45
+ # you should judge for yourself, the pros and cons are mentioned at:
46
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
47
+ #
48
+ # vendor/Pods/
49
+
50
+ ## Documentation cache and generated files:
51
+ /.yardoc/
52
+ /_yardoc/
53
+ /doc/
54
+ /rdoc/
55
+
56
+ ## Environment normalization:
57
+ /.bundle/
58
+ /vendor/bundle
59
+ /lib/bundler/man/
60
+
61
+ # for a library or gem, you might want to ignore these files since the code is
62
+ # intended to run in multiple environments; otherwise, check them in:
63
+ Gemfile.lock
64
+ .ruby-version
65
+ .ruby-gemset
66
+
67
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
68
+ .rvmrc
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Jekyll plugin that adds a subcommand to generate an ebook including your posts.
4
4
 
5
+ This gem is built on [gepub](https://github.com/skoji/gepub).
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your site's Gemfile:
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_dependency 'jekyll', '~> 3.5'
24
24
 
25
- spec.add_dependency 'gepub', '~> 0.7'
25
+ spec.add_dependency 'gepub', '~> 1.0'
26
26
  spec.add_dependency 'kindlegen', '~> 3.0'
27
27
  spec.add_dependency 'nokogiri', '~> 1.8'
28
28
 
@@ -8,6 +8,7 @@ require 'nokogiri'
8
8
 
9
9
  require_relative 'jekyll/commands/build_ebook'
10
10
  require_relative 'jekyll-build-ebook/config'
11
+ require_relative 'jekyll-build-ebook/error'
11
12
  require_relative 'jekyll-build-ebook/filters'
12
13
  require_relative 'jekyll-build-ebook/generator'
13
14
  require_relative 'jekyll-build-ebook/hooks'
@@ -1,6 +1,4 @@
1
1
  module JekyllBuildEbook
2
- InvalidConfigError = Class.new(StandardError)
3
-
4
2
  class Config
5
3
  DEFAULTS = {
6
4
  'ebook' => {
@@ -0,0 +1,4 @@
1
+ module JekyllBuildEbook
2
+ Error = Class.new(StandardError)
3
+ InvalidConfigError = Class.new(Error)
4
+ end
@@ -20,8 +20,9 @@ module JekyllBuildEbook
20
20
  book.page_progression_direction = config['page_progression_direction']
21
21
 
22
22
  site.static_files.each do |static_file|
23
+ href = remove_head_slash(File.join(static_file.destination_rel_dir, static_file.name))
23
24
  File.open(static_file.path) do |io|
24
- book.add_item(File.join(static_file.destination_rel_dir, static_file.name)[1..-1], io)
25
+ book.add_item(href, content: io)
25
26
  end
26
27
  end
27
28
 
@@ -30,7 +31,7 @@ module JekyllBuildEbook
30
31
  post.output = Jekyll::Renderer.new(site, post).run
31
32
 
32
33
  book
33
- .add_item(post.url[1..-1])
34
+ .add_item(remove_head_slash(post.url))
34
35
  .add_content(StringIO.new(Nokogiri::HTML(post.output).to_xhtml))
35
36
  .toc_text(post['title'])
36
37
  end
@@ -45,5 +46,9 @@ module JekyllBuildEbook
45
46
  logger.debug('Kindlegen:', stdout) unless stdout.empty?
46
47
  logger.error('Kindlegen:', stderr) unless stderr.empty?
47
48
  end
49
+
50
+ def remove_head_slash(str)
51
+ str.sub(%r{\A/}, '')
52
+ end
48
53
  end
49
54
  end
@@ -1,3 +1,3 @@
1
1
  module JekyllBuildEbook
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-build-ebook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fuji Nakahara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-24 00:00:00.000000000 Z
11
+ date: 2018-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.7'
33
+ version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.7'
40
+ version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: kindlegen
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -135,7 +135,6 @@ files:
135
135
  - ".travis.yml"
136
136
  - CODE_OF_CONDUCT.md
137
137
  - Gemfile
138
- - Gemfile.lock
139
138
  - LICENSE.txt
140
139
  - README.md
141
140
  - Rakefile
@@ -144,6 +143,7 @@ files:
144
143
  - jekyll-build-ebook.gemspec
145
144
  - lib/jekyll-build-ebook.rb
146
145
  - lib/jekyll-build-ebook/config.rb
146
+ - lib/jekyll-build-ebook/error.rb
147
147
  - lib/jekyll-build-ebook/filters.rb
148
148
  - lib/jekyll-build-ebook/generator.rb
149
149
  - lib/jekyll-build-ebook/hooks.rb
@@ -1,120 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- jekyll-build-ebook (0.3.0)
5
- gepub (~> 0.7)
6
- jekyll (~> 3.5)
7
- kindlegen (~> 3.0)
8
- nokogiri (~> 1.8)
9
-
10
- GEM
11
- remote: https://rubygems.org/
12
- specs:
13
- addressable (2.5.2)
14
- public_suffix (>= 2.0.2, < 4.0)
15
- ast (2.4.0)
16
- colorator (1.1.0)
17
- concurrent-ruby (1.0.5)
18
- diff-lcs (1.3)
19
- em-websocket (0.5.1)
20
- eventmachine (>= 0.12.9)
21
- http_parser.rb (~> 0.6.0)
22
- eventmachine (1.2.7)
23
- ffi (1.9.25)
24
- forwardable-extended (2.6.0)
25
- gepub (0.7.1)
26
- nokogiri (>= 1.8.2, < 1.9)
27
- rubyzip (>= 1.1.1)
28
- http_parser.rb (0.6.0)
29
- i18n (0.9.5)
30
- concurrent-ruby (~> 1.0)
31
- jaro_winkler (1.5.1)
32
- jekyll (3.8.4)
33
- addressable (~> 2.4)
34
- colorator (~> 1.0)
35
- em-websocket (~> 0.5)
36
- i18n (~> 0.7)
37
- jekyll-sass-converter (~> 1.0)
38
- jekyll-watch (~> 2.0)
39
- kramdown (~> 1.14)
40
- liquid (~> 4.0)
41
- mercenary (~> 0.3.3)
42
- pathutil (~> 0.9)
43
- rouge (>= 1.7, < 4)
44
- safe_yaml (~> 1.0)
45
- jekyll-sass-converter (1.5.2)
46
- sass (~> 3.4)
47
- jekyll-watch (2.0.0)
48
- listen (~> 3.0)
49
- kindlegen (3.0.3)
50
- rake
51
- rubyzip
52
- kramdown (1.17.0)
53
- liquid (4.0.0)
54
- listen (3.1.5)
55
- rb-fsevent (~> 0.9, >= 0.9.4)
56
- rb-inotify (~> 0.9, >= 0.9.7)
57
- ruby_dep (~> 1.2)
58
- meowcop (1.17.1)
59
- rubocop (>= 0.57.0)
60
- mercenary (0.3.6)
61
- mini_portile2 (2.3.0)
62
- nokogiri (1.8.4)
63
- mini_portile2 (~> 2.3.0)
64
- parallel (1.12.1)
65
- parser (2.5.1.2)
66
- ast (~> 2.4.0)
67
- pathutil (0.16.1)
68
- forwardable-extended (~> 2.6)
69
- powerpack (0.1.2)
70
- public_suffix (3.0.3)
71
- rainbow (3.0.0)
72
- rake (10.5.0)
73
- rb-fsevent (0.10.3)
74
- rb-inotify (0.9.10)
75
- ffi (>= 0.5.0, < 2)
76
- rouge (3.2.1)
77
- rspec (3.8.0)
78
- rspec-core (~> 3.8.0)
79
- rspec-expectations (~> 3.8.0)
80
- rspec-mocks (~> 3.8.0)
81
- rspec-core (3.8.0)
82
- rspec-support (~> 3.8.0)
83
- rspec-expectations (3.8.1)
84
- diff-lcs (>= 1.2.0, < 2.0)
85
- rspec-support (~> 3.8.0)
86
- rspec-mocks (3.8.0)
87
- diff-lcs (>= 1.2.0, < 2.0)
88
- rspec-support (~> 3.8.0)
89
- rspec-support (3.8.0)
90
- rubocop (0.59.1)
91
- jaro_winkler (~> 1.5.1)
92
- parallel (~> 1.10)
93
- parser (>= 2.5, != 2.5.1.1)
94
- powerpack (~> 0.1)
95
- rainbow (>= 2.2.2, < 4.0)
96
- ruby-progressbar (~> 1.7)
97
- unicode-display_width (~> 1.0, >= 1.0.1)
98
- ruby-progressbar (1.10.0)
99
- ruby_dep (1.5.0)
100
- rubyzip (1.2.2)
101
- safe_yaml (1.0.4)
102
- sass (3.6.0)
103
- sass-listen (~> 4.0.0)
104
- sass-listen (4.0.0)
105
- rb-fsevent (~> 0.9, >= 0.9.4)
106
- rb-inotify (~> 0.9, >= 0.9.7)
107
- unicode-display_width (1.4.0)
108
-
109
- PLATFORMS
110
- ruby
111
-
112
- DEPENDENCIES
113
- bundler (~> 1.16)
114
- jekyll-build-ebook!
115
- meowcop
116
- rake (~> 10.0)
117
- rspec (~> 3.0)
118
-
119
- BUNDLED WITH
120
- 1.16.4