softcover 1.6.0 → 1.6.5

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: 886ab5a917abf3257be857060db1093474d3c7f44f8beecc1efbf06aed972862
4
- data.tar.gz: aff32e009c3e4ca5098394186602116b6c6fc63c87cadd73c9ab5bd96f2cae95
3
+ metadata.gz: fdc44d8461381cc3eb23550881a861920e13b4871b6c88316a0cb18caa42e01b
4
+ data.tar.gz: 51b7b019c7f17c40c2db7c541f4be6b7186ec364ecc63664925ddade113b8387
5
5
  SHA512:
6
- metadata.gz: cdce663475b349497cdb1aa53f472d26ccf8f9043fcdde5590ff46ea73c33692dd54b766810e3c31b1386876f2f71a1fd2e445a8063d0bd403fb1105955b5c9a
7
- data.tar.gz: 20c08b57bb53e0e0189096b60f8fe33a665129b4ea7980d51d899c184cead1ec7b262f9044bdd8ac7989e5ac7ec90cbe4c3c24476f94028c9936b244ebda7c1f
6
+ metadata.gz: 53e90a529f6aada9c98a3c6ab1e77d184012bb7937e4b85b3d12b1ea5e0b628e0abcba6efb36d5a7cccadbe95262da36bbe8a7faaf46d4bae4af1aaa3be4470a
7
+ data.tar.gz: c8f42906932593725cd79330400a6eba119c51d8bec219761bce9b3da90d60b2d8573cd075708c178e6f3bb97ef164786cb403dfa2dbb39a30cfd29085754164
@@ -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.0)
4
+ softcover (1.6.5)
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.14)
15
+ polytexnic (~> 1.5.16)
16
16
  pygments.rb (~> 1.2.1)
17
- rb-fsevent (~> 0.9.3)
18
17
  rest-client (>= 1.8.0)
19
- ruby-progressbar (~> 1.4.2)
20
- sanitize (~> 4.6.3)
18
+ ruby-progressbar (~> 1.10)
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,7 +35,7 @@ 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
@@ -59,43 +58,42 @@ 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)
63
- hashdiff (1.0.0)
61
+ ffi (1.13.1)
62
+ hashdiff (1.0.1)
64
63
  http-accept (1.7.0)
65
64
  http-cookie (1.0.3)
66
65
  domain_name (~> 0.5)
67
66
  i18n (0.9.5)
68
67
  concurrent-ruby (~> 1.0)
69
- json (1.8.6)
68
+ json (2.3.0)
70
69
  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)
70
+ listen (3.2.1)
71
+ rb-fsevent (~> 0.10, >= 0.10.3)
72
+ rb-inotify (~> 0.9, >= 0.9.10)
75
73
  maruku (0.7.3)
76
- method_source (0.9.2)
74
+ method_source (1.0.0)
77
75
  mime-types (3.3.1)
78
76
  mime-types-data (~> 3.2015)
79
- mime-types-data (3.2019.1009)
77
+ mime-types-data (3.2020.0512)
80
78
  mini_portile2 (2.4.0)
81
- minitest (5.14.0)
79
+ minitest (5.14.1)
82
80
  msgpack (1.2.10)
83
81
  multi_json (1.14.1)
84
82
  netrc (0.11.0)
85
83
  nokogiri (1.10.9)
86
84
  mini_portile2 (~> 2.4.0)
87
- nokogumbo (1.5.0)
88
- nokogiri
89
- polytexnic (1.5.14)
90
- json (~> 1.8.1)
85
+ nokogumbo (2.0.2)
86
+ nokogiri (~> 1.8, >= 1.8.4)
87
+ polytexnic (1.5.16)
88
+ json (~> 2.3.0)
91
89
  kramdown (~> 1.17)
92
90
  msgpack (~> 1.2.0)
93
91
  nokogiri (~> 1.10.8)
94
92
  pygments.rb (~> 1.2.1)
95
- pry (0.12.2)
96
- coderay (~> 1.1.0)
97
- method_source (~> 0.9.0)
98
- public_suffix (4.0.3)
93
+ pry (0.13.1)
94
+ coderay (~> 1.1)
95
+ method_source (~> 1.0)
96
+ public_suffix (4.0.5)
99
97
  pygments.rb (1.2.1)
100
98
  multi_json (>= 1.0.0)
101
99
  rack (1.6.13)
@@ -104,11 +102,9 @@ GEM
104
102
  rack-test (1.1.0)
105
103
  rack (>= 1.0, < 3)
106
104
  rake (13.0.1)
107
- rb-fsevent (0.9.8)
105
+ rb-fsevent (0.10.4)
108
106
  rb-inotify (0.10.1)
109
107
  ffi (~> 1.0)
110
- rb-kqueue (0.2.5)
111
- ffi (>= 0.5.0)
112
108
  rest-client (2.1.0)
113
109
  http-accept (>= 1.7.0, < 2.0)
114
110
  http-cookie (>= 1.0.2, < 2.0)
@@ -122,13 +118,13 @@ GEM
122
118
  rspec-expectations (2.14.5)
123
119
  diff-lcs (>= 1.1.3, < 2.0)
124
120
  rspec-mocks (2.14.6)
125
- ruby-prof (1.2.0)
126
- ruby-progressbar (1.4.2)
121
+ ruby-prof (1.4.1)
122
+ ruby-progressbar (1.10.1)
127
123
  safe_yaml (1.0.4)
128
- sanitize (4.6.6)
124
+ sanitize (5.2.1)
129
125
  crass (~> 1.0.2)
130
- nokogiri (>= 1.4.4)
131
- nokogumbo (~> 1.4)
126
+ nokogiri (>= 1.8.0)
127
+ nokogumbo (~> 2.0)
132
128
  simplecov (0.16.1)
133
129
  docile (~> 1.1)
134
130
  json (>= 1.8, < 3)
@@ -150,14 +146,14 @@ GEM
150
146
  thor (1.0.1)
151
147
  thread_safe (0.3.6)
152
148
  tilt (2.0.10)
153
- tins (1.24.1)
149
+ tins (1.25.0)
154
150
  sync
155
- tzinfo (1.2.6)
151
+ tzinfo (1.2.7)
156
152
  thread_safe (~> 0.1)
157
153
  unf (0.1.4)
158
154
  unf_ext
159
- unf_ext (0.0.7.6)
160
- webmock (3.8.2)
155
+ unf_ext (0.0.7.7)
156
+ webmock (3.8.3)
161
157
  addressable (>= 2.3.6)
162
158
  crack (>= 0.3.2)
163
159
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -57,6 +57,19 @@ p {
57
57
  padding: 0;
58
58
  text-indent: 0.95em;
59
59
  }
60
+ /* No indentation in first paragraph of chapters or sections */
61
+ div.chapter > p:first-of-type {
62
+ text-indent: 0;
63
+ }
64
+ div.section > p:first-of-type {
65
+ text-indent: 0;
66
+ }
67
+ div.chapter-star > p:first-of-type {
68
+ text-indent: 0;
69
+ }
70
+ div.section-star > p:first-of-type {
71
+ text-indent: 0;
72
+ }
60
73
 
61
74
  p.noindent {
62
75
  text-indent: 0;
@@ -57,6 +57,19 @@ p {
57
57
  padding: 0;
58
58
  text-indent: 0.95em;
59
59
  }
60
+ /* No indentation in first paragraph of chapters or sections */
61
+ div.chapter > p:first-of-type {
62
+ text-indent: 0;
63
+ }
64
+ div.section > p:first-of-type {
65
+ text-indent: 0;
66
+ }
67
+ div.chapter-star > p:first-of-type {
68
+ text-indent: 0;
69
+ }
70
+ div.section-star > p:first-of-type {
71
+ text-indent: 0;
72
+ }
60
73
 
61
74
  p.noindent {
62
75
  text-indent: 0;
@@ -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"/>
@@ -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'
@@ -275,7 +275,7 @@ module Softcover::Utils
275
275
  ""
276
276
  end
277
277
  when :python2
278
- python = get_filename(:python)
278
+ python = get_filename(:python2)
279
279
  # Python 2 stupidly outputs the version number to STDERR instead of STDOUT.
280
280
  require 'open3'
281
281
  stdout, stderr, status = Open3.capture3("#{python} --version")
@@ -1,3 +1,3 @@
1
1
  module Softcover
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.5"
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.14'
21
+ gem.add_dependency 'polytexnic', '~> 1.5.16'
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'
@@ -26,7 +26,7 @@ Gem::Specification.new do |gem|
26
26
  gem.add_dependency 'i18n', '>= 0.7.0'
27
27
  gem.add_dependency 'rest-client', '>= 1.8.0'
28
28
  gem.add_dependency 'curb', '>= 0.9.7'
29
- gem.add_dependency 'ruby-progressbar', '~> 1.4.2'
29
+ gem.add_dependency 'ruby-progressbar', '~> 1.10'
30
30
  gem.add_dependency 'maruku', '~> 0.7.1'
31
31
  gem.add_dependency 'pygments.rb', '~> 1.2.1'
32
32
  gem.add_dependency 'kramdown', '>= 1.6.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
@@ -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.0
4
+ version: 1.6.5
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-03-21 00:00:00.000000000 Z
12
+ date: 2020-06-20 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.14
20
+ version: 1.5.16
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.14
27
+ version: 1.5.16
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: msgpack
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -141,14 +141,14 @@ dependencies:
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: 1.4.2
144
+ version: '1.10'
145
145
  type: :runtime
146
146
  prerelease: false
147
147
  version_requirements: !ruby/object:Gem::Requirement
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: 1.4.2
151
+ version: '1.10'
152
152
  - !ruby/object:Gem::Dependency
153
153
  name: maruku
154
154
  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