softcover 1.0.beta3 → 1.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,8 @@
18
18
  % Include graphics
19
19
  \usepackage{graphicx}
20
20
  \def\maxwidth#1{\ifdim\Gin@nat@width>#1 #1\else\Gin@nat@width\fi}
21
+ % Support the \url command
22
+ \usepackage{url}
21
23
  % Commands included by PolyTeXnic
22
24
  \usepackage{latex_styles/polytexnic_commands}
23
25
  % Links
@@ -143,6 +145,9 @@
143
145
  % Enable the \pbox command for paragraph boxes in tables.
144
146
  \usepackage{pbox}
145
147
 
148
+ % Enable float placement options.
149
+ \usepackage{float}
150
+
146
151
  % Define some commonly used Unicode characters.
147
152
  \usepackage{newunicodechar}
148
153
  \newunicodechar{—}{---}
@@ -237,37 +237,30 @@ module Softcover::Utils
237
237
  def dependency_filename(label)
238
238
  case label
239
239
  when :latex
240
- `which xelatex`.chomp
240
+ get_filename(:xelatex)
241
241
  when :ghostscript
242
- `which gs`.chomp
243
- when :convert
244
- `which convert`.chomp
245
- when :node
246
- `which node`.chomp
247
- when :phantomjs
248
- `which phantomjs`.chomp
249
- when :kindlegen
250
- `which kindlegen`.chomp
251
- when :java
252
- `which java`.chomp
253
- when :zip
254
- `which zip`.chomp
242
+ get_filename(:gs)
255
243
  when :calibre
256
- `which ebook-convert`.chomp
244
+ get_filename(:'ebook-convert')
257
245
  when :epubcheck
258
- File.join(Dir.home, 'bin', 'epubcheck-3.0', 'epubcheck-3.0.jar')
246
+ default = File.join(Dir.home, 'bin', 'epubcheck-3.0', 'epubcheck-3.0.jar')
247
+ filename_or_default(:epubcheck, default)
259
248
  when :inkscape
260
- filename = `which inkscape`.chomp
261
- if filename.empty?
262
- filename = '/Applications/Inkscape.app/Contents/Resources/bin/' +
263
- 'inkscape'
264
- end
265
- filename
249
+ default = '/Applications/Inkscape.app/Contents/Resources/bin/inkscape'
250
+ filename_or_default(:inkscape, default)
266
251
  else
267
- raise "Unknown label #{label}"
252
+ get_filename(label)
268
253
  end
269
254
  end
270
255
 
256
+ def get_filename(name)
257
+ `which #{name}`.chomp
258
+ end
259
+
260
+ def filename_or_default(name, default)
261
+ (f = get_filename(name)).empty? ? default : f
262
+ end
263
+
271
264
  # Returns the language labels from the config file.
272
265
  def language_labels
273
266
  YAML.load_file(File.join(Softcover::Directories::CONFIG, 'lang.yml'))
@@ -1,3 +1,3 @@
1
1
  module Softcover
2
- VERSION = "1.0.beta3"
2
+ VERSION = "1.0.beta4"
3
3
  end
data/softcover.gemspec CHANGED
@@ -18,11 +18,12 @@ 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.0.beta2'
21
+ gem.add_dependency 'polytexnic', '~> 1.0.beta5'
22
22
  gem.add_dependency 'msgpack', '~> 0.4.2'
23
23
  gem.add_dependency 'nokogiri', '~> 1.6.0'
24
24
  gem.add_dependency 'thor', '~> 0.18.1'
25
25
  gem.add_dependency 'activesupport', '~> 3.2.16'
26
+ gem.add_dependency 'i18n', '~> 0.6.11'
26
27
  gem.add_dependency 'rest-client', '~> 1.6.7'
27
28
  gem.add_dependency 'curb', '~> 0.8.5'
28
29
  gem.add_dependency 'ruby-progressbar', '~> 1.4.2'
@@ -39,7 +39,7 @@ describe Softcover::Builders::Pdf do
39
39
 
40
40
  it "should prepend the fontsize verbatim declaration for source code" do
41
41
  fontsize = '\begin{Verbatim}[fontsize=\relsize'
42
- expect(File.read(Dir.glob('tmp/*.tmp.tex').first)).to include fontsize
42
+ expect(File.read(File.join('tmp', 'a_chapter.tmp.tex'))).to include fontsize
43
43
  end
44
44
 
45
45
  it "should replace the main file's \\includes with tmp files" 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.beta3
4
+ version: 1.0.beta4
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-07-25 00:00:00.000000000 Z
12
+ date: 2014-08-28 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.0.beta2
20
+ version: 1.0.beta5
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.0.beta2
27
+ version: 1.0.beta5
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: msgpack
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -81,6 +81,20 @@ dependencies:
81
81
  - - ~>
82
82
  - !ruby/object:Gem::Version
83
83
  version: 3.2.16
84
+ - !ruby/object:Gem::Dependency
85
+ name: i18n
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ~>
89
+ - !ruby/object:Gem::Version
90
+ version: 0.6.11
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ~>
96
+ - !ruby/object:Gem::Version
97
+ version: 0.6.11
84
98
  - !ruby/object:Gem::Dependency
85
99
  name: rest-client
86
100
  requirement: !ruby/object:Gem::Requirement