softcover 1.6.2 → 1.7.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d45878d866d4e40b65f8e1003006551bfa627c59864133b5d9fdc6c32c608cb
4
- data.tar.gz: 01dd62e47a1f55b4a4b70f8ce5969491718cfe6927b6a76e7006d5b885ee1b1b
3
+ metadata.gz: '08e6aa64585e21d607f363c5255c4325b307ded45c4d466ac0b0479d6e7e5b8d'
4
+ data.tar.gz: b29be9fead7155966204d3637a8e823218ac0bb12a67358fc852ed8fad710019
5
5
  SHA512:
6
- metadata.gz: aa6fb51a924efde86189f94e24b03a8aad5b37e651f27319e4a2fff3f60946d27a410e2069e22e5bdc3ae9287be2c649a6b69b53510af729f14c6e014a085633
7
- data.tar.gz: e535781e8ecd46316ab045abebc55b637b1365792f73ed3be867155a4bddcac48e83f7878a0fe8f4f111e86644fcba6ad6a52c777cb006bf9fbe3ccaeb940bf1
6
+ metadata.gz: c8bdf333001c2d779b06535bf8b9fc49d7ba7b2e03432ef761fddc30b166a05cb46cd020f132195bc507b163cb92d9861728696d93c4e1131f53861d37457daa
7
+ data.tar.gz: 28ec74aa26980bddaf95d0021d83c1fdee6bef52ce5b7faccae621f7a5e01aaa8bc9d3b86effe7565640b3f9287d186aeec291640934b7596fe88958804a3e42
@@ -11,7 +11,7 @@ before_install:
11
11
  - sudo apt-get install -qq inkscape ghostscript
12
12
  - sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh
13
13
  - export PATH=$PATH:`echo ~`
14
- - curl -O -L https://github.com/IDPF/epubcheck/releases/download/v4.0.2/epubcheck-4.0.2.zip && unzip epubcheck-4.0.2.zip -d ~
14
+ - curl -O -L https://github.com/IDPF/epubcheck/releases/download/v4.2.2/epubcheck-4.2.2.zip && unzip epubcheck-4.2.2.zip -d ~
15
15
  - wget https://softcover-static.s3.amazonaws.com/Bodoni%2072%20Smallcaps%20Book.ttf && sudo cp 'Bodoni 72 Smallcaps Book.ttf' /usr/share/fonts/truetype/bodoni-classic
16
16
  - sudo fc-cache -fsv
17
17
  # - gem i softcover && softcover check # NOTE: enable to troubleshoot tex, gs, calibre, epubcheck, issus
@@ -1,23 +1,22 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- softcover (1.6.2)
4
+ softcover (1.7.1)
5
5
  activesupport (~> 4.2.3)
6
6
  async_sinatra (~> 1.1.0)
7
7
  coffee-script (>= 2.2.0)
8
8
  curb (>= 0.9.7)
9
9
  i18n (>= 0.7.0)
10
10
  kramdown (>= 1.6.0)
11
- listen (~> 1.3.1)
11
+ listen (~> 3.2.1)
12
12
  maruku (~> 0.7.1)
13
13
  msgpack (~> 1.2.0)
14
14
  nokogiri (>= 1.6.0, < 2.0)
15
- polytexnic (~> 1.5.16)
15
+ polytexnic (~> 1.6.0)
16
16
  pygments.rb (~> 1.2.1)
17
- rb-fsevent (~> 0.9.3)
18
17
  rest-client (>= 1.8.0)
19
18
  ruby-progressbar (~> 1.10)
20
- sanitize (~> 4.6.3)
19
+ sanitize (>= 4.6.3, < 5.3.0)
21
20
  sinatra (~> 1.4.4)
22
21
  sinatra-respond_to (~> 0.9.0)
23
22
  thin (~> 1.6.1)
@@ -26,7 +25,7 @@ PATH
26
25
  GEM
27
26
  remote: https://rubygems.org/
28
27
  specs:
29
- activesupport (4.2.11.1)
28
+ activesupport (4.2.11.3)
30
29
  i18n (~> 0.7)
31
30
  minitest (~> 5.1)
32
31
  thread_safe (~> 0.3, >= 0.3.4)
@@ -36,12 +35,12 @@ GEM
36
35
  async_sinatra (1.1.0)
37
36
  rack (>= 1.4.1)
38
37
  sinatra (>= 1.3.2)
39
- coderay (1.1.2)
38
+ coderay (1.1.3)
40
39
  coffee-script (2.4.1)
41
40
  coffee-script-source
42
41
  execjs
43
42
  coffee-script-source (1.12.2)
44
- concurrent-ruby (1.1.6)
43
+ concurrent-ruby (1.1.7)
45
44
  coveralls (0.8.23)
46
45
  json (>= 1.8, < 3)
47
46
  simplecov (~> 0.16.1)
@@ -59,7 +58,7 @@ GEM
59
58
  unf (>= 0.0.5, < 1.0.0)
60
59
  eventmachine (1.2.7)
61
60
  execjs (2.7.0)
62
- ffi (1.12.2)
61
+ ffi (1.13.1)
63
62
  hashdiff (1.0.1)
64
63
  http-accept (1.7.0)
65
64
  http-cookie (1.0.3)
@@ -67,35 +66,35 @@ GEM
67
66
  i18n (0.9.5)
68
67
  concurrent-ruby (~> 1.0)
69
68
  json (2.3.0)
70
- kramdown (1.17.0)
71
- listen (1.3.1)
72
- rb-fsevent (>= 0.9.3)
73
- rb-inotify (>= 0.9)
74
- rb-kqueue (>= 0.2)
69
+ kramdown (2.3.0)
70
+ rexml
71
+ listen (3.2.1)
72
+ rb-fsevent (~> 0.10, >= 0.10.3)
73
+ rb-inotify (~> 0.9, >= 0.9.10)
75
74
  maruku (0.7.3)
76
75
  method_source (1.0.0)
77
76
  mime-types (3.3.1)
78
77
  mime-types-data (~> 3.2015)
79
- mime-types-data (3.2019.1009)
78
+ mime-types-data (3.2020.0512)
80
79
  mini_portile2 (2.4.0)
81
- minitest (5.14.0)
80
+ minitest (5.14.2)
82
81
  msgpack (1.2.10)
83
- multi_json (1.14.1)
82
+ multi_json (1.15.0)
84
83
  netrc (0.11.0)
85
- nokogiri (1.10.9)
84
+ nokogiri (1.10.10)
86
85
  mini_portile2 (~> 2.4.0)
87
- nokogumbo (1.5.0)
88
- nokogiri
89
- polytexnic (1.5.16)
86
+ nokogumbo (2.0.2)
87
+ nokogiri (~> 1.8, >= 1.8.4)
88
+ polytexnic (1.6.0)
90
89
  json (~> 2.3.0)
91
- kramdown (~> 1.17)
90
+ kramdown (>= 1.17, < 3.0)
92
91
  msgpack (~> 1.2.0)
93
92
  nokogiri (~> 1.10.8)
94
93
  pygments.rb (~> 1.2.1)
95
94
  pry (0.13.1)
96
95
  coderay (~> 1.1)
97
96
  method_source (~> 1.0)
98
- public_suffix (4.0.4)
97
+ public_suffix (4.0.5)
99
98
  pygments.rb (1.2.1)
100
99
  multi_json (>= 1.0.0)
101
100
  rack (1.6.13)
@@ -104,16 +103,15 @@ GEM
104
103
  rack-test (1.1.0)
105
104
  rack (>= 1.0, < 3)
106
105
  rake (13.0.1)
107
- rb-fsevent (0.9.8)
106
+ rb-fsevent (0.10.4)
108
107
  rb-inotify (0.10.1)
109
108
  ffi (~> 1.0)
110
- rb-kqueue (0.2.5)
111
- ffi (>= 0.5.0)
112
109
  rest-client (2.1.0)
113
110
  http-accept (>= 1.7.0, < 2.0)
114
111
  http-cookie (>= 1.0.2, < 2.0)
115
112
  mime-types (>= 1.16, < 4.0)
116
113
  netrc (~> 0.8)
114
+ rexml (3.2.4)
117
115
  rspec (2.14.1)
118
116
  rspec-core (~> 2.14.0)
119
117
  rspec-expectations (~> 2.14.0)
@@ -122,13 +120,13 @@ GEM
122
120
  rspec-expectations (2.14.5)
123
121
  diff-lcs (>= 1.1.3, < 2.0)
124
122
  rspec-mocks (2.14.6)
125
- ruby-prof (1.3.1)
123
+ ruby-prof (1.4.1)
126
124
  ruby-progressbar (1.10.1)
127
125
  safe_yaml (1.0.4)
128
- sanitize (4.6.6)
126
+ sanitize (5.2.1)
129
127
  crass (~> 1.0.2)
130
- nokogiri (>= 1.4.4)
131
- nokogumbo (~> 1.4)
128
+ nokogiri (>= 1.8.0)
129
+ nokogumbo (~> 2.0)
132
130
  simplecov (0.16.1)
133
131
  docile (~> 1.1)
134
132
  json (>= 1.8, < 3)
@@ -150,7 +148,7 @@ GEM
150
148
  thor (1.0.1)
151
149
  thread_safe (0.3.6)
152
150
  tilt (2.0.10)
153
- tins (1.24.1)
151
+ tins (1.25.0)
154
152
  sync
155
153
  tzinfo (1.2.7)
156
154
  thread_safe (~> 0.1)
@@ -434,7 +434,7 @@ body #book {
434
434
  color: red;
435
435
  }
436
436
 
437
- #book .sc {
437
+ #book .smallcaps {
438
438
  font-variant: small-caps;
439
439
  }
440
440
 
@@ -434,7 +434,7 @@ body #book {
434
434
  color: red;
435
435
  }
436
436
 
437
- #book .sc {
437
+ #book .smallcaps {
438
438
  font-variant: small-caps;
439
439
  }
440
440
 
@@ -31,25 +31,10 @@ module Softcover
31
31
  def ensure_style_file_locations
32
32
  styles_dir = Softcover::Directories::STYLES
33
33
  mkdir styles_dir
34
- fix_custom_include
35
34
  files = Dir.glob('*.sty')
36
35
  FileUtils.mv(files, styles_dir)
37
36
  end
38
37
 
39
- # Fixes the custom include.
40
- # The template includes the custom style file as an example
41
- # of file inclusion. Unfortunately, the location of 'custom.sty', has
42
- # changed, which will result in older templates spontaneously breaking.
43
- def fix_custom_include
44
- first_chapter = File.join('chapters', 'a_chapter.tex')
45
- if File.exist?(first_chapter)
46
- text = File.read(first_chapter)
47
- text.gsub!('<<(custom.sty',
48
- "<<(#{Softcover::Directories::STYLES}/custom.sty" )
49
- File.write(first_chapter, text)
50
- end
51
- end
52
-
53
38
  # Writes out the PolyTeXnic commands from polytexnic.
54
39
  def write_polytexnic_commands_file
55
40
  Polytexnic.write_polytexnic_style_file(styles_dir)
@@ -83,4 +68,4 @@ module Softcover
83
68
  end
84
69
 
85
70
  end
86
- end
71
+ end
@@ -100,7 +100,7 @@ module Softcover
100
100
  %(<?xml version="1.0" encoding="UTF-8"?>
101
101
  <ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
102
102
  <head>
103
- <meta name="dtb:uid" content="#{uuid}"/>
103
+ <meta name="dtb:uid" content="urn:uuid:#{uuid}"/>
104
104
  <meta name="dtb:depth" content="2"/>
105
105
  <meta name="dtb:totalPageCount" content="0"/>
106
106
  <meta name="dtb:maxPageNumber" content="0"/>
@@ -205,8 +205,8 @@ module Softcover
205
205
  method_option :polytex,
206
206
  :type => :boolean,
207
207
  :default => false,
208
- :aliases => "-p",
209
- :desc => "Generate a PolyTeX document."
208
+ :aliases => %w[-p --latex -l],
209
+ :desc => "Generate a LaTeX document."
210
210
  method_option :article,
211
211
  :type => :boolean,
212
212
  :default => false,
@@ -81,9 +81,9 @@ module Softcover
81
81
  when :zip
82
82
  "Install zip (e.g., apt-get install zip)"
83
83
  when :epubcheck
84
- url = 'https://github.com/IDPF/epubcheck/releases/download/v4.0.2/epubcheck-4.0.2.zip'
85
- message = "EpubCheck 4.0.2 (#{url})\n"
86
- message += " ∟ Unzip and place epubcheck-4.0.2/ in a directory on your path"
84
+ url = 'https://github.com/w3c/epubcheck/releases/download/v4.2.2/epubcheck-4.2.2.zip'
85
+ message = "EpubCheck 4.2.2 (#{url})\n"
86
+ message += " ∟ Unzip and place epubcheck-4.2.2/ in a directory on your path"
87
87
  when :inkscape
88
88
  message = "Inkscape (https://inkscape.org/)"
89
89
  when :python2
@@ -10,7 +10,7 @@ module Softcover
10
10
  epub = path("ebooks/#{manifest.filename}.epub")
11
11
  if File.exist?(epub)
12
12
  puts "Validating EPUB..."
13
- system("#{java} -jar #{epubcheck} #{epub}")
13
+ system("#{java} -jar #{epubcheck} --locale en -w #{epub}")
14
14
  else
15
15
  puts "File '#{epub}' not found"
16
16
  puts "Run 'softcover build:epub' to generate"
@@ -11,16 +11,14 @@ module Softcover::Commands::Server
11
11
  return if defined?(@no_listener) && @no_listener
12
12
  server_pid = Process.pid
13
13
  filter_regex = /(\.md|\.tex|custom\.sty|custom\.css|Book\.txt|book\.yml)$/
14
- @listener = Listen.to('.')
15
- @listener.filter(filter_regex)
16
-
17
- @listener.change do |modified|
14
+ @listener = Listen.to('.', only: filter_regex, ignore: /html\//) do |modified|
18
15
  first_modified = modified.try(:first)
19
16
  unless first_modified =~ ignore_regex
20
17
  rebuild first_modified
21
18
  Process.kill("HUP", server_pid)
22
19
  end
23
20
  end
21
+
24
22
  @listener.start
25
23
  end
26
24
 
@@ -65,3 +63,15 @@ module Softcover::Commands::Server
65
63
  start_server port, bind
66
64
  end
67
65
  end
66
+
67
+ # Listen >=2.8 patch to silence duplicate directory errors. USE AT YOUR OWN RISK
68
+ require 'listen/record/symlink_detector'
69
+ module Listen
70
+ class Record
71
+ class SymlinkDetector
72
+ def _fail(_, _)
73
+ fail Error, "Don't watch locally-symlinked directory twice"
74
+ end
75
+ end
76
+ end
77
+ end
@@ -260,7 +260,7 @@ module Softcover::Utils
260
260
  get_filename(:'ebook-convert')
261
261
  when :epubcheck
262
262
  # Finds EpubCheck anywhere on the path.
263
- version_4 = path('epubcheck-4.0.2/epubcheck.jar')
263
+ version_4 = path('epubcheck-4.2.2/epubcheck.jar')
264
264
  first_path(version_4) || get_filename(:'epubcheck') || ""
265
265
  when :inkscape
266
266
  default = '/Applications/Inkscape.app/Contents/MacOS/inkscape'
@@ -1,3 +1,3 @@
1
1
  module Softcover
2
- VERSION = "1.6.2"
2
+ VERSION = "1.7.1"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.require_paths = ["lib"]
20
20
 
21
- gem.add_dependency 'polytexnic', '~> 1.5.16'
21
+ gem.add_dependency 'polytexnic', '~> 1.6.0'
22
22
  gem.add_dependency 'msgpack', '~> 1.2.0'
23
23
  gem.add_dependency 'nokogiri', '>= 1.6.0', '< 2.0'
24
24
  gem.add_dependency 'thor', '>= 0.18.1', '< 2.0'
@@ -36,7 +36,6 @@ Gem::Specification.new do |gem|
36
36
  gem.add_dependency 'async_sinatra', '~> 1.1.0'
37
37
  gem.add_dependency 'sinatra-respond_to', '~> 0.9.0'
38
38
  gem.add_dependency 'coffee-script', '>= 2.2.0'
39
- gem.add_dependency 'listen', '~> 1.3.1'
40
- gem.add_dependency 'rb-fsevent', '~> 0.9.3'
41
- gem.add_dependency 'sanitize', '~> 4.6.3'
39
+ gem.add_dependency 'listen', '~> 3.2.1'
40
+ gem.add_dependency 'sanitize', '>= 4.6.3', '< 5.3.0'
42
41
  end
@@ -48,7 +48,7 @@ describe Softcover::CLI do
48
48
 
49
49
  context "softcover new options" do
50
50
  subject { `softcover help new` }
51
- it { should include '-p, [--polytex]' }
51
+ it { should include '-p, --latex, -l, [--polytex]' }
52
52
  it { should include '-a, [--article]' }
53
53
  end
54
54
 
@@ -155,6 +155,19 @@ describe Softcover::CLI do
155
155
  it_should_behave_like "book"
156
156
  end
157
157
 
158
+ describe "LaTeX books" do
159
+
160
+ before(:all) do
161
+ remove_book
162
+ chdir_to_fixtures
163
+ silence { `softcover new book --latex` }
164
+ chdir_to_book
165
+ end
166
+ after(:all) { remove_book }
167
+
168
+ it_should_behave_like "book"
169
+ end
170
+
158
171
  describe "Markdown books" do
159
172
 
160
173
  before(:all) do
@@ -0,0 +1,34 @@
1
+ require 'spec_helper'
2
+
3
+ describe Softcover::Commands::EpubValidator do
4
+ context 'epub file exists' do
5
+ before(:all) do
6
+ remove_book
7
+ chdir_to_fixtures
8
+ silence { `softcover new book --polytex` }
9
+ chdir_to_book
10
+ silence { `softcover build:epub` }
11
+ end
12
+
13
+ after(:all) { remove_book }
14
+
15
+ subject { silence { Softcover::Commands::EpubValidator.validate! } }
16
+ it { should be_true }
17
+ end
18
+
19
+ context 'epub file not exists' do
20
+ before(:all) do
21
+ remove_book
22
+ chdir_to_fixtures
23
+ silence { `softcover new book --polytex` }
24
+ chdir_to_book
25
+ end
26
+
27
+ after(:all) { remove_book }
28
+
29
+ it 'should raise SystemExit error' do
30
+ expect { silence { Softcover::Commands::EpubValidator.validate! } }.to raise_error(SystemExit)
31
+ end
32
+ end
33
+ end
34
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: softcover
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Hartl
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-04-16 00:00:00.000000000 Z
12
+ date: 2020-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: polytexnic
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 1.5.16
20
+ version: 1.6.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 1.5.16
27
+ version: 1.6.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: msgpack
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -267,42 +267,34 @@ dependencies:
267
267
  requirements:
268
268
  - - "~>"
269
269
  - !ruby/object:Gem::Version
270
- version: 1.3.1
270
+ version: 3.2.1
271
271
  type: :runtime
272
272
  prerelease: false
273
273
  version_requirements: !ruby/object:Gem::Requirement
274
274
  requirements:
275
275
  - - "~>"
276
276
  - !ruby/object:Gem::Version
277
- version: 1.3.1
278
- - !ruby/object:Gem::Dependency
279
- name: rb-fsevent
280
- requirement: !ruby/object:Gem::Requirement
281
- requirements:
282
- - - "~>"
283
- - !ruby/object:Gem::Version
284
- version: 0.9.3
285
- type: :runtime
286
- prerelease: false
287
- version_requirements: !ruby/object:Gem::Requirement
288
- requirements:
289
- - - "~>"
290
- - !ruby/object:Gem::Version
291
- version: 0.9.3
277
+ version: 3.2.1
292
278
  - !ruby/object:Gem::Dependency
293
279
  name: sanitize
294
280
  requirement: !ruby/object:Gem::Requirement
295
281
  requirements:
296
- - - "~>"
282
+ - - ">="
297
283
  - !ruby/object:Gem::Version
298
284
  version: 4.6.3
285
+ - - "<"
286
+ - !ruby/object:Gem::Version
287
+ version: 5.3.0
299
288
  type: :runtime
300
289
  prerelease: false
301
290
  version_requirements: !ruby/object:Gem::Requirement
302
291
  requirements:
303
- - - "~>"
292
+ - - ">="
304
293
  - !ruby/object:Gem::Version
305
294
  version: 4.6.3
295
+ - - "<"
296
+ - !ruby/object:Gem::Version
297
+ version: 5.3.0
306
298
  description: Command-line interface for softcover.io
307
299
  email:
308
300
  - michael@softcover.io
@@ -593,6 +585,7 @@ files:
593
585
  - spec/commands/build_spec.rb
594
586
  - spec/commands/check_spec.rb
595
587
  - spec/commands/deployment_spec.rb
588
+ - spec/commands/epub_validator_spec.rb
596
589
  - spec/commands/generator_spec.rb
597
590
  - spec/commands/opener_spec.rb
598
591
  - spec/commands/publisher_spec.rb
@@ -645,6 +638,7 @@ test_files:
645
638
  - spec/commands/build_spec.rb
646
639
  - spec/commands/check_spec.rb
647
640
  - spec/commands/deployment_spec.rb
641
+ - spec/commands/epub_validator_spec.rb
648
642
  - spec/commands/generator_spec.rb
649
643
  - spec/commands/opener_spec.rb
650
644
  - spec/commands/publisher_spec.rb