softcover 1.10.6 → 1.10.8
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/Gemfile +3 -2
- data/Gemfile.lock +53 -57
- data/lib/softcover/book.rb +1 -1
- data/lib/softcover/client.rb +1 -1
- data/lib/softcover/commands/publisher.rb +1 -1
- data/lib/softcover/config.rb +2 -2
- data/lib/softcover/uploader.rb +1 -1
- data/lib/softcover/utils.rb +2 -1
- data/lib/softcover/version.rb +1 -1
- data/lib/softcover.rb +2 -0
- data/softcover.gemspec +3 -1
- data/spec/app_spec.rb +1 -1
- data/spec/book_manifest_spec.rb +1 -1
- data/spec/builders/epub_spec.rb +5 -5
- data/spec/builders/html_spec.rb +1 -1
- data/spec/cli_spec.rb +6 -5
- data/spec/commands/build_spec.rb +10 -9
- data/spec/commands/check_spec.rb +1 -1
- data/spec/commands/deployment_spec.rb +1 -1
- data/spec/commands/epub_validator_spec.rb +1 -1
- data/spec/commands/generator_spec.rb +2 -2
- data/spec/commands/opener_spec.rb +2 -2
- data/spec/commands/publisher_spec.rb +8 -8
- data/spec/commands/server_spec.rb +1 -1
- data/spec/mathjax_spec.rb +1 -1
- data/spec/output_spec.rb +4 -3
- data/spec/spec_helper.rb +8 -3
- data/spec/support/exist_matcher.rb +1 -1
- metadata +33 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92c6c4c29448983d66d98a6acb696421ea3bcc1222f0bbea6a729ace3b96efd9
|
4
|
+
data.tar.gz: 25642153d1805000c5ebc67bc83caa9a817942003fb57b78af3fd603d4576d86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91444f0a79e9b23a4504c1ba1493c482556c686cc06f3ee522e3d03820cdd464ee753935d50a032837cf43dd7f75238e82a2700fd4e22d42f0c6ca237e929c6c
|
7
|
+
data.tar.gz: 643aa0f95a6ee9c98b80d21713308d1fd8978f02a86f28401edec1eb8cc20c9bc06176c0d964e98d099c65209a4d1c82f8d36294d7df5d041492b733c32dc095
|
data/Gemfile
CHANGED
@@ -13,10 +13,11 @@ LC_ALL="en_US.UTF-8"
|
|
13
13
|
gemspec
|
14
14
|
|
15
15
|
group :test do
|
16
|
-
gem 'rspec', '
|
16
|
+
gem 'rspec', '3.13.0'
|
17
|
+
gem 'rspec-its', '~> 2.0'
|
17
18
|
gem 'safe_yaml', '1.0.4'
|
18
19
|
gem 'webmock', '~> 3', require: false
|
19
|
-
gem 'coveralls', require: false
|
20
|
+
# gem 'coveralls', require: false
|
20
21
|
gem 'rack-test'
|
21
22
|
gem 'ruby-prof'
|
22
23
|
gem 'pry'
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
softcover (1.10.
|
4
|
+
softcover (1.10.8)
|
5
5
|
activesupport (= 4.2.11.3)
|
6
6
|
async_sinatra (= 1.1.0)
|
7
|
+
base64 (= 0.2.0)
|
7
8
|
coffee-script (= 2.4.1)
|
8
9
|
curb (= 1.0.5)
|
9
10
|
i18n (= 0.9.5)
|
10
11
|
kramdown (= 2.4.0)
|
11
12
|
listen (= 3.7.1)
|
12
13
|
maruku (= 0.7.3)
|
14
|
+
mutex_m (= 0.3.0)
|
13
15
|
nokogiri (= 1.15.2)
|
14
16
|
polytexnic (~> 1.10)
|
15
17
|
pygments.rb (= 2.3.1)
|
@@ -18,7 +20,7 @@ PATH
|
|
18
20
|
sanitize (= 6.0.1)
|
19
21
|
sinatra (= 1.4.8)
|
20
22
|
sinatra-respond_to (= 0.9.0)
|
21
|
-
thin (= 1.
|
23
|
+
thin (= 1.8.2)
|
22
24
|
thor (= 1.2.2)
|
23
25
|
|
24
26
|
GEM
|
@@ -34,35 +36,29 @@ GEM
|
|
34
36
|
async_sinatra (1.1.0)
|
35
37
|
rack (>= 1.4.1)
|
36
38
|
sinatra (>= 1.3.2)
|
37
|
-
|
39
|
+
base64 (0.2.0)
|
40
|
+
bigdecimal (3.2.1)
|
38
41
|
coderay (1.1.3)
|
39
42
|
coffee-script (2.4.1)
|
40
43
|
coffee-script-source
|
41
44
|
execjs
|
42
45
|
coffee-script-source (1.12.2)
|
43
|
-
concurrent-ruby (1.3.
|
44
|
-
coveralls (0.8.23)
|
45
|
-
json (>= 1.8, < 3)
|
46
|
-
simplecov (~> 0.16.1)
|
47
|
-
term-ansicolor (~> 1.3)
|
48
|
-
thor (>= 0.19.4, < 2.0)
|
49
|
-
tins (~> 1.6)
|
46
|
+
concurrent-ruby (1.3.5)
|
50
47
|
crack (1.0.0)
|
51
48
|
bigdecimal
|
52
49
|
rexml
|
53
50
|
crass (1.0.6)
|
54
51
|
curb (1.0.5)
|
55
52
|
daemons (1.4.1)
|
56
|
-
diff-lcs (1.
|
57
|
-
docile (1.4.1)
|
53
|
+
diff-lcs (1.6.2)
|
58
54
|
domain_name (0.6.20240107)
|
59
55
|
eventmachine (1.2.7)
|
60
|
-
execjs (2.
|
61
|
-
ffi (1.17.
|
62
|
-
ffi (1.17.
|
63
|
-
hashdiff (1.
|
56
|
+
execjs (2.10.0)
|
57
|
+
ffi (1.17.2-arm64-darwin)
|
58
|
+
ffi (1.17.2-x86_64-darwin)
|
59
|
+
hashdiff (1.2.0)
|
64
60
|
http-accept (1.7.0)
|
65
|
-
http-cookie (1.0.
|
61
|
+
http-cookie (1.0.8)
|
66
62
|
domain_name (~> 0.5)
|
67
63
|
i18n (0.9.5)
|
68
64
|
concurrent-ruby (~> 1.0)
|
@@ -72,38 +68,39 @@ GEM
|
|
72
68
|
listen (3.7.1)
|
73
69
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
74
70
|
rb-inotify (~> 0.9, >= 0.9.10)
|
75
|
-
logger (1.
|
71
|
+
logger (1.7.0)
|
76
72
|
maruku (0.7.3)
|
77
73
|
method_source (1.1.0)
|
78
|
-
mime-types (3.
|
74
|
+
mime-types (3.7.0)
|
79
75
|
logger
|
80
|
-
mime-types-data (~> 3.
|
81
|
-
mime-types-data (3.
|
82
|
-
|
76
|
+
mime-types-data (~> 3.2025, >= 3.2025.0507)
|
77
|
+
mime-types-data (3.2025.0527)
|
78
|
+
mini_portile2 (2.8.9)
|
79
|
+
minitest (5.25.5)
|
83
80
|
msgpack (1.7.2)
|
81
|
+
mutex_m (0.3.0)
|
84
82
|
netrc (0.11.0)
|
85
|
-
nokogiri (1.15.2
|
83
|
+
nokogiri (1.15.2)
|
84
|
+
mini_portile2 (~> 2.8.2)
|
86
85
|
racc (~> 1.4)
|
87
|
-
|
88
|
-
racc (~> 1.4)
|
89
|
-
polytexnic (1.10.8)
|
86
|
+
polytexnic (1.10.10)
|
90
87
|
json (= 2.7.2)
|
91
88
|
kramdown (= 2.4.0)
|
92
89
|
msgpack (= 1.7.2)
|
93
90
|
nokogiri (= 1.15.2)
|
94
91
|
pygments.rb (~> 2.3.1)
|
95
|
-
pry (0.
|
92
|
+
pry (0.15.2)
|
96
93
|
coderay (~> 1.1)
|
97
94
|
method_source (~> 1.0)
|
98
|
-
public_suffix (6.0.
|
95
|
+
public_suffix (6.0.2)
|
99
96
|
pygments.rb (2.3.1)
|
100
97
|
racc (1.8.1)
|
101
98
|
rack (1.6.13)
|
102
99
|
rack-protection (1.5.5)
|
103
100
|
rack
|
104
|
-
rack-test (2.
|
101
|
+
rack-test (2.2.0)
|
105
102
|
rack (>= 1.3)
|
106
|
-
rake (13.
|
103
|
+
rake (13.3.0)
|
107
104
|
rb-fsevent (0.11.2)
|
108
105
|
rb-inotify (0.11.1)
|
109
106
|
ffi (~> 1.0)
|
@@ -112,48 +109,46 @@ GEM
|
|
112
109
|
http-cookie (>= 1.0.2, < 2.0)
|
113
110
|
mime-types (>= 1.16, < 4.0)
|
114
111
|
netrc (~> 0.8)
|
115
|
-
rexml (3.
|
116
|
-
rspec (
|
117
|
-
rspec-core (~>
|
118
|
-
rspec-expectations (~>
|
119
|
-
rspec-mocks (~>
|
120
|
-
rspec-core (
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
112
|
+
rexml (3.4.1)
|
113
|
+
rspec (3.13.0)
|
114
|
+
rspec-core (~> 3.13.0)
|
115
|
+
rspec-expectations (~> 3.13.0)
|
116
|
+
rspec-mocks (~> 3.13.0)
|
117
|
+
rspec-core (3.13.4)
|
118
|
+
rspec-support (~> 3.13.0)
|
119
|
+
rspec-expectations (3.13.5)
|
120
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
121
|
+
rspec-support (~> 3.13.0)
|
122
|
+
rspec-its (2.0.0)
|
123
|
+
rspec-core (>= 3.13.0)
|
124
|
+
rspec-expectations (>= 3.13.0)
|
125
|
+
rspec-mocks (3.13.5)
|
126
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
127
|
+
rspec-support (~> 3.13.0)
|
128
|
+
rspec-support (3.13.4)
|
129
|
+
ruby-prof (1.7.2)
|
130
|
+
base64
|
125
131
|
ruby-progressbar (1.13.0)
|
126
132
|
safe_yaml (1.0.4)
|
127
133
|
sanitize (6.0.1)
|
128
134
|
crass (~> 1.0.2)
|
129
135
|
nokogiri (>= 1.12.0)
|
130
|
-
simplecov (0.16.1)
|
131
|
-
docile (~> 1.1)
|
132
|
-
json (>= 1.8, < 3)
|
133
|
-
simplecov-html (~> 0.10.0)
|
134
|
-
simplecov-html (0.10.2)
|
135
136
|
sinatra (1.4.8)
|
136
137
|
rack (~> 1.5)
|
137
138
|
rack-protection (~> 1.4)
|
138
139
|
tilt (>= 1.3, < 3)
|
139
140
|
sinatra-respond_to (0.9.0)
|
140
141
|
sinatra (~> 1.3)
|
141
|
-
|
142
|
-
term-ansicolor (1.11.2)
|
143
|
-
tins (~> 1.0)
|
144
|
-
thin (1.6.4)
|
142
|
+
thin (1.8.2)
|
145
143
|
daemons (~> 1.0, >= 1.0.9)
|
146
144
|
eventmachine (~> 1.0, >= 1.0.4)
|
147
|
-
rack (
|
145
|
+
rack (>= 1, < 3)
|
148
146
|
thor (1.2.2)
|
149
147
|
thread_safe (0.3.6)
|
150
|
-
tilt (2.
|
151
|
-
tins (1.37.0)
|
152
|
-
bigdecimal
|
153
|
-
sync
|
148
|
+
tilt (2.6.0)
|
154
149
|
tzinfo (1.2.11)
|
155
150
|
thread_safe (~> 0.1)
|
156
|
-
webmock (3.
|
151
|
+
webmock (3.25.1)
|
157
152
|
addressable (>= 2.8.0)
|
158
153
|
crack (>= 0.3.2)
|
159
154
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -161,15 +156,16 @@ GEM
|
|
161
156
|
PLATFORMS
|
162
157
|
arm64-darwin-21
|
163
158
|
arm64-darwin-22
|
159
|
+
arm64-darwin-24
|
164
160
|
x86_64-darwin-19
|
165
161
|
x86_64-darwin-21
|
166
162
|
|
167
163
|
DEPENDENCIES
|
168
|
-
coveralls
|
169
164
|
pry
|
170
165
|
rack-test
|
171
166
|
rake
|
172
|
-
rspec (=
|
167
|
+
rspec (= 3.13.0)
|
168
|
+
rspec-its (~> 2.0)
|
173
169
|
ruby-prof
|
174
170
|
safe_yaml (= 1.0.4)
|
175
171
|
softcover!
|
data/lib/softcover/book.rb
CHANGED
@@ -223,7 +223,7 @@ class Softcover::Book
|
|
223
223
|
return if files.empty?
|
224
224
|
|
225
225
|
manifest_path = File.join(path, "manifest.yml")
|
226
|
-
manifest = File.
|
226
|
+
manifest = File.exist?(manifest_path) ? File.read(manifest_path) : nil
|
227
227
|
|
228
228
|
res = @client.get_media_upload_params path, files, manifest, options
|
229
229
|
|
data/lib/softcover/client.rb
CHANGED
@@ -101,7 +101,7 @@ module Softcover
|
|
101
101
|
end
|
102
102
|
|
103
103
|
def params_with_key(params)
|
104
|
-
@api_key.present? ? params.merge({api_key: @api_key}) : params
|
104
|
+
@api_key && @api_key.present? ? params.merge({api_key: @api_key}) : params
|
105
105
|
end
|
106
106
|
|
107
107
|
def formatted_headers(headers={})
|
data/lib/softcover/config.rb
CHANGED
@@ -29,7 +29,7 @@ module Softcover
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def exists?
|
32
|
-
File.
|
32
|
+
File.exist?(file_path)
|
33
33
|
end
|
34
34
|
|
35
35
|
protected
|
@@ -56,7 +56,7 @@ module Softcover
|
|
56
56
|
|
57
57
|
class Config < BaseConfig
|
58
58
|
def self.path
|
59
|
-
File.
|
59
|
+
File.exist?(".softcover") ? ".softcover" : "~/.softcover"
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
data/lib/softcover/uploader.rb
CHANGED
@@ -18,7 +18,7 @@ module Softcover
|
|
18
18
|
bar = ProgressBar.create title: "Starting Upload...",
|
19
19
|
format: "%t |%B| %P%% %e",
|
20
20
|
total: total_size,
|
21
|
-
smoothing: 0.75,
|
21
|
+
projector: { type: 'smoothing', strength: 0.75 },
|
22
22
|
output: Softcover::Output.stream
|
23
23
|
|
24
24
|
upload_host = "http://#{@bucket}.s3.amazonaws.com"
|
data/lib/softcover/utils.rb
CHANGED
data/lib/softcover/version.rb
CHANGED
data/lib/softcover.rb
CHANGED
data/softcover.gemspec
CHANGED
@@ -31,10 +31,12 @@ Gem::Specification.new do |gem|
|
|
31
31
|
gem.add_dependency 'kramdown', '2.4.0'
|
32
32
|
|
33
33
|
gem.add_dependency 'sinatra', '1.4.8'
|
34
|
-
gem.add_dependency 'thin', '1.
|
34
|
+
gem.add_dependency 'thin', '1.8.2'
|
35
35
|
gem.add_dependency 'async_sinatra', '1.1.0'
|
36
36
|
gem.add_dependency 'sinatra-respond_to', '0.9.0'
|
37
37
|
gem.add_dependency 'coffee-script', '2.4.1'
|
38
38
|
gem.add_dependency 'listen', '3.7.1'
|
39
39
|
gem.add_dependency 'sanitize', '6.0.1'
|
40
|
+
gem.add_dependency 'base64', '0.2.0'
|
41
|
+
gem.add_dependency 'mutex_m', '0.3.0'
|
40
42
|
end
|
data/spec/app_spec.rb
CHANGED
@@ -84,7 +84,7 @@ describe Softcover::App do
|
|
84
84
|
def expect_server_response_of_type(type)
|
85
85
|
expect(last_response).to be_ok
|
86
86
|
expect(last_response.content_type).to match type
|
87
|
-
expect(last_response.content_length > 0).to
|
87
|
+
expect(last_response.content_length > 0).to be_truthy
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
data/spec/book_manifest_spec.rb
CHANGED
@@ -50,7 +50,7 @@ describe Softcover::BookManifest do
|
|
50
50
|
|
51
51
|
context "with mixed Markdown & PolyTeX files" do
|
52
52
|
before do
|
53
|
-
manifest.
|
53
|
+
allow(manifest).to receive(:source_files).and_return(['foo.md', 'bar.tex'])
|
54
54
|
end
|
55
55
|
|
56
56
|
it "should have the right basenames" do
|
data/spec/builders/epub_spec.rb
CHANGED
@@ -137,13 +137,13 @@ describe Softcover::Builders::Epub do
|
|
137
137
|
|
138
138
|
context "math? method" do
|
139
139
|
it "should return true when there's math" do
|
140
|
-
expect(builder.math?('\(')).to
|
141
|
-
expect(builder.math?('\[')).to
|
142
|
-
expect(builder.math?('\begin{equation}')).to
|
140
|
+
expect(builder.math?('\(')).to be_truthy
|
141
|
+
expect(builder.math?('\[')).to be_truthy
|
142
|
+
expect(builder.math?('\begin{equation}')).to be_truthy
|
143
143
|
end
|
144
144
|
|
145
145
|
it "should return false when there's no math" do
|
146
|
-
expect(builder.math?('foo')).to
|
146
|
+
expect(builder.math?('foo')).to be_falsy
|
147
147
|
end
|
148
148
|
end
|
149
149
|
|
@@ -161,7 +161,7 @@ describe Softcover::Builders::Epub do
|
|
161
161
|
expect(fragment).to exist
|
162
162
|
end
|
163
163
|
# Make sure at least one template file has math.
|
164
|
-
expect(has_math).to
|
164
|
+
expect(has_math).to be_truthy
|
165
165
|
end
|
166
166
|
|
167
167
|
describe "cover file" do
|
data/spec/builders/html_spec.rb
CHANGED
@@ -159,7 +159,7 @@ describe Softcover::Builders::Html do
|
|
159
159
|
describe "commented-out lines of Book.txt" do
|
160
160
|
let(:lines) { ['foo.md', '# bar.md'] }
|
161
161
|
let(:content) { builder.master_content(builder.manifest) }
|
162
|
-
before { builder.
|
162
|
+
before { allow(builder).to receive(:book_file_lines).and_return(lines) }
|
163
163
|
it "should be ignored" do
|
164
164
|
expect(content).to include 'generated_polytex/foo'
|
165
165
|
expect(content).not_to include 'generated_polytex/bar'
|
data/spec/cli_spec.rb
CHANGED
@@ -185,19 +185,20 @@ describe Softcover::CLI do
|
|
185
185
|
describe "stubbed commands" do
|
186
186
|
|
187
187
|
context "unpublish" do
|
188
|
-
before { Softcover::Utils.
|
188
|
+
before { allow(Softcover::Utils).to receive(:source).and_return(:markdown) }
|
189
189
|
it "should have the right slug" do
|
190
|
-
|
191
|
-
|
190
|
+
expect(Softcover::BookManifest).to receive(:new).with(origin: :markdown)
|
191
|
+
.and_return(OpenStruct.new(slug: ""))
|
192
|
+
|
192
193
|
Softcover::Utils.unpublish_slug
|
193
194
|
end
|
194
195
|
end
|
195
196
|
|
196
197
|
|
197
198
|
context "open" do
|
198
|
-
before { Softcover::Utils.
|
199
|
+
before { allow(Softcover::Utils).to receive(:source).and_return(:markdown) }
|
199
200
|
it "should have the right book" do
|
200
|
-
Softcover::Book.
|
201
|
+
expect(Softcover::Book).to receive(:new).with(origin: :markdown)
|
201
202
|
Softcover::Commands::Opener::book
|
202
203
|
end
|
203
204
|
end
|
data/spec/commands/build_spec.rb
CHANGED
@@ -14,7 +14,7 @@ describe Softcover::Commands::Build do
|
|
14
14
|
context 'invalid builder format' do
|
15
15
|
subject { lambda { Softcover::Commands::Build.for_format('derp') } }
|
16
16
|
|
17
|
-
it {
|
17
|
+
it { should_not be_a Softcover::Builder }
|
18
18
|
end
|
19
19
|
|
20
20
|
context 'building all' do
|
@@ -25,11 +25,12 @@ describe Softcover::Commands::Build do
|
|
25
25
|
pdf_builder = build.builder_for('pdf')
|
26
26
|
mobi_builder = build.builder_for('mobi')
|
27
27
|
|
28
|
-
pdf_builder
|
29
|
-
mobi_builder.
|
30
|
-
|
31
|
-
build.
|
32
|
-
build.
|
28
|
+
expect(pdf_builder).to receive(:build!)
|
29
|
+
expect(mobi_builder).to receive(:build!)
|
30
|
+
|
31
|
+
expect(build).to receive(:builder_for).with('pdf').and_return(pdf_builder)
|
32
|
+
expect(build).to receive(:builder_for).with('mobi').and_return(mobi_builder)
|
33
|
+
|
33
34
|
|
34
35
|
build.all_formats
|
35
36
|
end
|
@@ -41,9 +42,9 @@ describe Softcover::Commands::Build do
|
|
41
42
|
it { should respond_to(:preview) }
|
42
43
|
it "should build previews" do
|
43
44
|
preview_builder = build.builder_for('preview')
|
44
|
-
preview_builder.
|
45
|
-
build.
|
46
|
-
|
45
|
+
expect(preview_builder).to receive(:build!)
|
46
|
+
expect(build).to receive(:builder_for).with('preview').
|
47
|
+
and_return(preview_builder)
|
47
48
|
build.preview
|
48
49
|
end
|
49
50
|
end
|
data/spec/commands/check_spec.rb
CHANGED
@@ -27,7 +27,7 @@ describe Softcover::Commands::Check do
|
|
27
27
|
describe "missing dependencies" do
|
28
28
|
before do
|
29
29
|
Softcover::Commands::Check.dependency_labels.each do |label|
|
30
|
-
Softcover::Commands::Check.
|
30
|
+
allow(Softcover::Commands::Check).to receive(:present?).with(label).and_return(false)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe Softcover::Commands::Deployment do
|
4
4
|
|
5
5
|
describe "default commands" do
|
6
|
-
before { Softcover::Commands::Deployment.
|
6
|
+
before { allow(Softcover::Commands::Deployment).to receive(:article?).and_return(false) }
|
7
7
|
subject { Softcover::Commands::Deployment.default_commands }
|
8
8
|
|
9
9
|
it { should match /softcover build:all/ }
|
@@ -18,11 +18,11 @@ describe Softcover::Commands::Generator do
|
|
18
18
|
|
19
19
|
after(:all) do
|
20
20
|
chdir_to_non_book
|
21
|
-
FileUtils.rm_rf name
|
21
|
+
FileUtils.rm_rf @name
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should copy files" do
|
25
|
-
expect(Softcover::Commands::Generator.verify!).to
|
25
|
+
expect(Softcover::Commands::Generator.verify!).to be_truthy
|
26
26
|
end
|
27
27
|
|
28
28
|
describe "book.yml" do
|
@@ -6,12 +6,12 @@ describe Softcover::Commands::Opener do
|
|
6
6
|
|
7
7
|
it 'opens in browser' do
|
8
8
|
opened = false
|
9
|
-
Softcover::Book.
|
9
|
+
allow_any_instance_of(Softcover::Book).to receive(:open_in_browser) do
|
10
10
|
opened = true
|
11
11
|
end
|
12
12
|
|
13
13
|
Softcover::Commands::Opener.open!
|
14
14
|
|
15
|
-
expect(opened).to
|
15
|
+
expect(opened).to be_truthy
|
16
16
|
end
|
17
17
|
end
|
@@ -14,7 +14,7 @@ describe Softcover::Commands::Publisher do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it "rejects the publish" do
|
17
|
-
expect(subject.publish!).to
|
17
|
+
expect(subject.publish!).to be_falsy
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -26,7 +26,7 @@ describe Softcover::Commands::Publisher do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it "publishes" do
|
29
|
-
expect(subject.publish!(publish_options)).to
|
29
|
+
expect(subject.publish!(publish_options)).to be_truthy
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -38,7 +38,7 @@ describe Softcover::Commands::Publisher do
|
|
38
38
|
end
|
39
39
|
|
40
40
|
it "rejects the unpublish" do
|
41
|
-
expect(subject.unpublish!).to
|
41
|
+
expect(subject.unpublish!).to be_falsy
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -52,12 +52,12 @@ describe Softcover::Commands::Publisher do
|
|
52
52
|
end
|
53
53
|
|
54
54
|
it "unpublishes" do
|
55
|
-
expect(subject.unpublish!).to
|
55
|
+
expect(subject.unpublish!).to be_truthy
|
56
56
|
end
|
57
57
|
|
58
58
|
it "removes book config" do
|
59
59
|
subject.unpublish!
|
60
|
-
expect(Softcover::BookConfig.exists?).to
|
60
|
+
expect(Softcover::BookConfig.exists?).to be_falsy
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -72,7 +72,7 @@ describe Softcover::Commands::Publisher do
|
|
72
72
|
end
|
73
73
|
|
74
74
|
it "does not unpublish" do
|
75
|
-
expect(subject.unpublish!).to
|
75
|
+
expect(subject.unpublish!).to be_falsy
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
@@ -89,7 +89,7 @@ describe Softcover::Commands::Publisher do
|
|
89
89
|
before { stub_destroy_book_by_slug book }
|
90
90
|
|
91
91
|
it "unpublishes" do
|
92
|
-
expect(subject.unpublish!(book.slug)).to
|
92
|
+
expect(subject.unpublish!(book.slug)).to be_truthy
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
@@ -98,7 +98,7 @@ describe Softcover::Commands::Publisher do
|
|
98
98
|
before { stub_destroy_book_by_invalid_slug slug }
|
99
99
|
|
100
100
|
it "does not unpublish" do
|
101
|
-
expect(subject.unpublish!(slug)).to
|
101
|
+
expect(subject.unpublish!(slug)).to be_falsy
|
102
102
|
end
|
103
103
|
end
|
104
104
|
end
|
data/spec/mathjax_spec.rb
CHANGED
@@ -21,7 +21,7 @@ describe Softcover::Mathjax do
|
|
21
21
|
|
22
22
|
context "with a custom.sty" do
|
23
23
|
|
24
|
-
before { Softcover.
|
24
|
+
before { allow(Softcover).to receive(:custom_styles).and_return(custom_sty) }
|
25
25
|
|
26
26
|
it "should include the custom macros" do
|
27
27
|
expect(config).to include foo
|
data/spec/output_spec.rb
CHANGED
@@ -26,8 +26,9 @@ describe Softcover::Output do
|
|
26
26
|
|
27
27
|
it 'redirects output' do
|
28
28
|
Softcover::Output.stream = $stderr
|
29
|
-
$stderr.
|
30
|
-
$stderr.
|
29
|
+
expect($stderr).to receive(:puts).with('hello')
|
30
|
+
expect($stderr).to receive(:print).twice.with('hello')
|
31
|
+
|
31
32
|
|
32
33
|
OutputTest.puts_hello
|
33
34
|
OutputTest.print_hello
|
@@ -35,7 +36,7 @@ describe Softcover::Output do
|
|
35
36
|
end
|
36
37
|
|
37
38
|
it 'redirects system command output' do
|
38
|
-
Softcover::Output.stream.
|
39
|
+
expect(Softcover::Output.stream).to receive(:puts)
|
39
40
|
OutputTest.system_cmd
|
40
41
|
end
|
41
42
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
require 'coveralls'
|
2
|
-
Coveralls::Output.silent = !ENV['CI']
|
3
|
-
Coveralls.wear!
|
1
|
+
# require 'coveralls'
|
2
|
+
# Coveralls::Output.silent = !ENV['CI']
|
3
|
+
# Coveralls.wear!
|
4
4
|
|
5
5
|
require 'rubygems'
|
6
6
|
require 'bundler/setup'
|
7
|
+
require 'rspec/its'
|
7
8
|
require 'webmock/rspec'
|
8
9
|
require 'webmock_helpers'
|
9
10
|
require 'ostruct'
|
@@ -48,6 +49,10 @@ RSpec.configure do |config|
|
|
48
49
|
end
|
49
50
|
|
50
51
|
config.include WebmockHelpers
|
52
|
+
|
53
|
+
RSpec::Expectations.configuration.on_potential_false_positives = :nothing
|
54
|
+
|
55
|
+
config.raise_errors_for_deprecations!
|
51
56
|
end
|
52
57
|
|
53
58
|
TEST_API_KEY = 'asdfasdfasdfasdfasdf'
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: softcover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Hartl
|
8
8
|
- Nick Merwin
|
9
|
-
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: polytexnic
|
@@ -185,14 +184,14 @@ dependencies:
|
|
185
184
|
requirements:
|
186
185
|
- - '='
|
187
186
|
- !ruby/object:Gem::Version
|
188
|
-
version: 1.
|
187
|
+
version: 1.8.2
|
189
188
|
type: :runtime
|
190
189
|
prerelease: false
|
191
190
|
version_requirements: !ruby/object:Gem::Requirement
|
192
191
|
requirements:
|
193
192
|
- - '='
|
194
193
|
- !ruby/object:Gem::Version
|
195
|
-
version: 1.
|
194
|
+
version: 1.8.2
|
196
195
|
- !ruby/object:Gem::Dependency
|
197
196
|
name: async_sinatra
|
198
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -263,6 +262,34 @@ dependencies:
|
|
263
262
|
- - '='
|
264
263
|
- !ruby/object:Gem::Version
|
265
264
|
version: 6.0.1
|
265
|
+
- !ruby/object:Gem::Dependency
|
266
|
+
name: base64
|
267
|
+
requirement: !ruby/object:Gem::Requirement
|
268
|
+
requirements:
|
269
|
+
- - '='
|
270
|
+
- !ruby/object:Gem::Version
|
271
|
+
version: 0.2.0
|
272
|
+
type: :runtime
|
273
|
+
prerelease: false
|
274
|
+
version_requirements: !ruby/object:Gem::Requirement
|
275
|
+
requirements:
|
276
|
+
- - '='
|
277
|
+
- !ruby/object:Gem::Version
|
278
|
+
version: 0.2.0
|
279
|
+
- !ruby/object:Gem::Dependency
|
280
|
+
name: mutex_m
|
281
|
+
requirement: !ruby/object:Gem::Requirement
|
282
|
+
requirements:
|
283
|
+
- - '='
|
284
|
+
- !ruby/object:Gem::Version
|
285
|
+
version: 0.3.0
|
286
|
+
type: :runtime
|
287
|
+
prerelease: false
|
288
|
+
version_requirements: !ruby/object:Gem::Requirement
|
289
|
+
requirements:
|
290
|
+
- - '='
|
291
|
+
- !ruby/object:Gem::Version
|
292
|
+
version: 0.3.0
|
266
293
|
description: Command-line interface for softcover.io
|
267
294
|
email:
|
268
295
|
- michael@softcover.io
|
@@ -571,7 +598,6 @@ homepage: https://github.com/softcover/softcover
|
|
571
598
|
licenses:
|
572
599
|
- MIT
|
573
600
|
metadata: {}
|
574
|
-
post_install_message:
|
575
601
|
rdoc_options: []
|
576
602
|
require_paths:
|
577
603
|
- lib
|
@@ -586,8 +612,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
586
612
|
- !ruby/object:Gem::Version
|
587
613
|
version: '0'
|
588
614
|
requirements: []
|
589
|
-
rubygems_version: 3.
|
590
|
-
signing_key:
|
615
|
+
rubygems_version: 3.6.9
|
591
616
|
specification_version: 4
|
592
617
|
summary: An ebook production system & sales and marketing platform for technical authors
|
593
618
|
test_files:
|