softcover 1.0.beta15 → 1.0.beta16

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
  SHA1:
3
- metadata.gz: 10659515786ab1d7b7cf6ef524e9627541552882
4
- data.tar.gz: d47c64674835297c856e4df0d8cac9c789766dbd
3
+ metadata.gz: b8137c81992908717396867abb601cd2848c9b51
4
+ data.tar.gz: 9eab005f7c11be7b6891e6155a184297ac68298c
5
5
  SHA512:
6
- metadata.gz: 2a2d0d335d51b75da5d4d8c137148f8a1e13022376d95ddfe3184b9fdb5c1cbc5ad45b64f786229848e51c5aec75922760f53d2edab6d4a071b10e5468021b26
7
- data.tar.gz: d9968d17c255ad40eb49c6906686c94cf5576fc89a4850cd39e4a7d77afe506621178ac46f23cbe8441ce9b4b2ca42ad0540185f1fa33b45e0490f1fc17964c1
6
+ metadata.gz: 887cd0da96df9dd87cd932fef09a4c2531bf2b6388fe1962269cefbb1e0026065807b20d6524e88d8ac504b62f2a3cf58a979836f32ea96fea958d830964ffba
7
+ data.tar.gz: eda12cf4e9470df7ec1d42a1cd03c4794d47019066636f3e8954423bc4a6c5642fd78c1b43c07d427c6a9a7242fd98e9a8f45da85cd33b664875039ecaaeb90d
@@ -58,7 +58,8 @@ class Softcover::Book
58
58
 
59
59
  # get array of paths and checksums
60
60
  def files
61
- paths = %W{html/#{slug}.html html/*_fragment.html images/**/* config/*}
61
+ paths = %W{html/#{slug}.html html/*_fragment.html images/**/* config/*
62
+ html/stylesheets/custom.css}
62
63
  Dir[*paths].map do |path|
63
64
  BookFile.new(path) unless File.directory?(path)
64
65
  end.compact
@@ -23,12 +23,15 @@ module Softcover
23
23
 
24
24
  # Returns the command for making a MOBI, based on the options.
25
25
  def mobi_command(filename, options={})
26
+ silent = options[:silent] || Softcover.test?
26
27
  if options[:kindlegen]
27
- "#{kindlegen} ebooks/#{filename}.epub"
28
+ cmd = "#{kindlegen} ebooks/#{filename}.epub"
28
29
  else
29
- "#{calibre} ebooks/#{filename}.epub ebooks/#{filename}.mobi" +
30
- " #{calibre_options}"
30
+ cmd = "#{calibre} ebooks/#{filename}.epub ebooks/#{filename}.mobi" +
31
+ " #{calibre_options}"
31
32
  end
33
+ puts cmd unless (options[:quiet] || silent)
34
+ cmd
32
35
  end
33
36
 
34
37
  private
@@ -35,6 +35,9 @@ module Softcover
35
35
  'tr' => %w{id class},
36
36
  'td' => %w{id class colspan}
37
37
  },
38
+ css: {
39
+ properties: %w{color height width}
40
+ },
38
41
  protocols: {
39
42
  'a' => {'href' => [:relative, 'http', 'https', 'mailto']},
40
43
  'img' => {'src' => [:relative, 'http', 'https']}
@@ -45,4 +48,4 @@ module Softcover
45
48
  Sanitize.clean(html.force_encoding("UTF-8"), sanitize_options)
46
49
  end
47
50
  end
48
- end
51
+ end
@@ -1,3 +1,3 @@
1
1
  module Softcover
2
- VERSION = "1.0.beta15"
2
+ VERSION = "1.0.beta16"
3
3
  end
data/softcover.gemspec CHANGED
@@ -38,5 +38,5 @@ Gem::Specification.new do |gem|
38
38
  gem.add_dependency 'coffee-script', '~> 2.2.0'
39
39
  gem.add_dependency 'listen', '~> 1.3.1'
40
40
  gem.add_dependency 'rb-fsevent', '~> 0.9.3'
41
- gem.add_dependency 'sanitize', '~> 2.0.6'
41
+ gem.add_dependency 'sanitize', '~> 3.0.3'
42
42
  end
data/spec/book_spec.rb CHANGED
@@ -14,6 +14,7 @@ describe Softcover::Book do
14
14
  its(:filenames) { should include "html/#{subject.slug}.html"}
15
15
 
16
16
  its(:filenames) { should include "config/marketing.yml"}
17
+ its(:filenames) { should include "html/stylesheets/custom.css"}
17
18
 
18
19
  its(:slug) { should eq "book" }
19
20
  its(:url) { should match /\/books\/(.*?)\/redirect/ }
@@ -11,23 +11,24 @@ describe Softcover::Sanitizer do
11
11
  end
12
12
 
13
13
  context "safe html" do
14
- let(:html) do Nokogiri::HTML.fragment(<<-EOS
14
+ let(:html) do <<-EOS
15
15
  <div id="a" class="b"></div>
16
16
  <div data-tralics-id="c" data-number="d" data-chapter="e"></div>
17
- <a id="a" class="b" href="c"></a>
18
- <span id="a" class="b" style="c"></span>
19
- <ol id="a" class="b"></ol>
20
- <ul id="a" class="b"></ul>
21
- <li id="a" class="b"></li>
22
- <sup id="a" class="b"></sup>
23
- <h1 id="a" class="b"></h1>
24
- <h2 id="a" class="b"></h2>
25
- <h3 id="a" class="b"></h3>
26
- <h4 id="a" class="b"></h4>
27
- <img id="a" class="b" src="c" alt="d" />
28
- <em id="a" class="b"></em>
17
+ <a id="b" class="b" href="c"></a>
18
+ <span id="c" class="b" style="color:white"></span>
19
+ <ol id="d" class="b"></ol>
20
+ <ul id="e" class="b">
21
+ <li id="f" class="b">
22
+ </li>
23
+ </ul>
24
+ <sup id="g" class="b"></sup>
25
+ <h1 id="h" class="b"></h1>
26
+ <h2 id="i" class="b"></h2>
27
+ <h3 id="j" class="b"></h3>
28
+ <h4 id="k" class="b"></h4>
29
+ <img id="l" class="b" src="c" alt="d">
30
+ <em id="m" class="b"></em>
29
31
  EOS
30
- ).to_xhtml
31
32
  end
32
33
 
33
34
  it "allows class and id" do
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.0.beta15
4
+ version: 1.0.beta16
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: 2014-11-20 00:00:00.000000000 Z
12
+ date: 2014-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: polytexnic
@@ -283,14 +283,14 @@ dependencies:
283
283
  requirements:
284
284
  - - "~>"
285
285
  - !ruby/object:Gem::Version
286
- version: 2.0.6
286
+ version: 3.0.3
287
287
  type: :runtime
288
288
  prerelease: false
289
289
  version_requirements: !ruby/object:Gem::Requirement
290
290
  requirements:
291
291
  - - "~>"
292
292
  - !ruby/object:Gem::Version
293
- version: 2.0.6
293
+ version: 3.0.3
294
294
  description: CLI interface for softcover.io
295
295
  email:
296
296
  - michael@softcover.io
@@ -1071,7 +1071,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1071
1071
  version: 1.3.1
1072
1072
  requirements: []
1073
1073
  rubyforge_project:
1074
- rubygems_version: 2.2.2
1074
+ rubygems_version: 2.4.4
1075
1075
  signing_key:
1076
1076
  specification_version: 4
1077
1077
  summary: A typesetting system for technical authors