kitabu 1.0.0.rc4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,17 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kitabu (1.0.0.rc4)
4
+ kitabu (1.0.0)
5
5
  RedCloth
6
6
  activesupport
7
7
  coderay
8
8
  eeepub-with-cover-support
9
9
  i18n
10
10
  nokogiri
11
- notifier
12
11
  rdiscount
13
12
  thor
14
- watchr
15
13
 
16
14
  GEM
17
15
  remote: http://rubygems.org/
@@ -21,13 +19,13 @@ GEM
21
19
  i18n (~> 0.6)
22
20
  multi_json (~> 1.0)
23
21
  awesome_print (1.0.2)
24
- builder (3.0.0)
22
+ builder (3.1.3)
25
23
  coderay (1.0.7)
26
24
  diff-lcs (1.1.3)
27
25
  eeepub-with-cover-support (0.8.7)
28
26
  builder
29
27
  rubyzip
30
- i18n (0.6.0)
28
+ i18n (0.6.1)
31
29
  method_source (0.8)
32
30
  multi_json (1.3.6)
33
31
  nokogiri (1.5.5)
@@ -36,6 +34,8 @@ GEM
36
34
  coderay (~> 1.0.5)
37
35
  method_source (~> 0.8)
38
36
  slop (~> 3.3.1)
37
+ pry-nav (0.2.2)
38
+ pry (~> 0.9.10)
39
39
  rake (0.9.2.2)
40
40
  rdiscount (1.6.8)
41
41
  rspec (2.11.0)
@@ -51,7 +51,6 @@ GEM
51
51
  test_notifier (1.0.0)
52
52
  notifier
53
53
  thor (0.16.0)
54
- watchr (0.7)
55
54
 
56
55
  PLATFORMS
57
56
  ruby
@@ -60,6 +59,7 @@ DEPENDENCIES
60
59
  awesome_print
61
60
  kitabu!
62
61
  pry
62
+ pry-nav
63
63
  rake
64
64
  rspec
65
65
  test_notifier
@@ -15,7 +15,7 @@ While Prince is too expensive (495USD for a single user license), the free versi
15
15
  To install Kitabu, you’ll need a working Ruby 1.9+ installation.
16
16
  If you’re cool with it, just run the following command to install it.
17
17
 
18
- gem install kitabu --pre
18
+ gem install kitabu
19
19
 
20
20
  After installing Kitabu, run the following command to check your external
21
21
  dependencies.
@@ -26,13 +26,12 @@ Gem::Specification.new do |s|
26
26
  s.add_dependency "i18n"
27
27
  s.add_dependency "thor"
28
28
  s.add_dependency "eeepub-with-cover-support"
29
- s.add_dependency "watchr"
30
- s.add_dependency "notifier"
31
29
  s.add_dependency "coderay"
32
30
 
33
31
  s.add_development_dependency "rspec"
34
32
  s.add_development_dependency "test_notifier"
35
33
  s.add_development_dependency "rake"
36
34
  s.add_development_dependency "pry"
35
+ s.add_development_dependency "pry-nav"
37
36
  s.add_development_dependency "awesome_print"
38
37
  end
@@ -10,9 +10,10 @@ require "optparse"
10
10
  require "ostruct"
11
11
  require "RedCloth"
12
12
  require "tempfile"
13
+ require "pathname"
13
14
  require "thor"
14
15
  require "thor/group"
15
- require "watchr"
16
+ require "listen"
16
17
  require "yaml"
17
18
  require "cgi"
18
19
 
@@ -26,7 +26,6 @@ module Kitabu
26
26
 
27
27
  desc "export [OPTIONS]", "Export e-book"
28
28
  method_option :only, :type => :string, :desc => "Can be one of: #{FORMATS.join(", ")}"
29
- method_option :auto, :type => :boolean, :desc => "Watch changes and automatically export files"
30
29
  method_option :open, :type => :boolean, :desc => "Automatically open PDF (Mac OS X only)"
31
30
 
32
31
  def export
@@ -2,13 +2,7 @@ module Kitabu
2
2
  class Exporter
3
3
  def self.run(root_dir, options)
4
4
  exporter = new(root_dir, options)
5
-
6
- if options[:auto]
7
- exporter.export!
8
- exporter.auto! if options[:auto]
9
- else
10
- exporter.export!
11
- end
5
+ exporter.export!
12
6
  end
13
7
 
14
8
  attr_accessor :root_dir
@@ -64,17 +58,5 @@ module Kitabu
64
58
  def config
65
59
  Kitabu.config(root_dir)
66
60
  end
67
-
68
- def auto!
69
- script = Watchr::Script.new
70
-
71
- script.watch(%r[(code|config|images|templates|text)/.*]) do |match|
72
- ui.say "* #{match[0]}... ", :yellow, false
73
- export!
74
- end
75
-
76
- contrl = Watchr::Controller.new(script, Watchr.handler.new)
77
- contrl.run
78
- end
79
61
  end
80
62
  end
@@ -59,6 +59,10 @@ module Kitabu
59
59
  create_file "code/.gitkeep"
60
60
  end
61
61
 
62
+ def copy_guardfile
63
+ copy_file "Guardfile", "Guardfile"
64
+ end
65
+
62
66
  private
63
67
  # Retrieve user's name using finger.
64
68
  # Defaults to <tt>John Doe</tt>.
@@ -123,18 +123,18 @@ module Kitabu
123
123
  index = self.class.footnote_index
124
124
  actual_index = fn["id"].gsub(/[^\d]/, "")
125
125
 
126
- fn.set_attribute("id", "fn#{index}")
126
+ fn.set_attribute("id", "_fn#{index}")
127
127
 
128
128
  html.css("a[href='#fn#{actual_index}']").each do |link|
129
- link.set_attribute("href", "#fn#{index}")
129
+ link.set_attribute("href", "#_fn#{index}")
130
130
  end
131
131
 
132
132
  html.css("a[href='#fnr#{actual_index}']").each do |link|
133
- link.set_attribute("href", "#fnr#{index}")
133
+ link.set_attribute("href", "#_fnr#{index}")
134
134
  end
135
135
 
136
136
  html.css("[id=fnr#{actual_index}]").each do |tag|
137
- tag.set_attribute("id", "fnr#{index}")
137
+ tag.set_attribute("id", "_fnr#{index}")
138
138
  end
139
139
 
140
140
  self.class.footnote_index += 1
@@ -16,7 +16,7 @@ module Kitabu
16
16
  element.delete("xml:lang")
17
17
  end
18
18
 
19
- html.css("p.footnote[id^='fn']").each do |fn|
19
+ html.css("p.footnote[id^='_fn']").each do |fn|
20
20
  fn.node_name = "span"
21
21
  fn.set_attribute("class", "fn")
22
22
 
@@ -3,6 +3,6 @@ module Kitabu
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
5
  PATCH = 0
6
- STRING = "#{MAJOR}.#{MINOR}.#{PATCH}.rc4"
6
+ STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
@@ -33,6 +33,10 @@ shared_examples_for "e-book" do
33
33
  mybook.join("text/01_Welcome.md")
34
34
  end
35
35
 
36
+ it "copies Guardfile" do
37
+ mybook.join("Guardfile")
38
+ end
39
+
36
40
  it "copies html template files" do
37
41
  mybook.join("templates/html/user.css").should be_file
38
42
  mybook.join("templates/html/layout.css").should be_file
@@ -0,0 +1,8 @@
1
+ notification :off
2
+ interactor :off
3
+
4
+ guard :shell do
5
+ watch %r[^(?!output)] do |m|
6
+ `kitabu export`
7
+ end
8
+ end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitabu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc4
5
- prerelease: 6
4
+ version: 1.0.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Nando Vieira
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-27 00:00:00.000000000 Z
12
+ date: 2012-10-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -124,23 +124,7 @@ dependencies:
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  - !ruby/object:Gem::Dependency
127
- name: watchr
128
- requirement: !ruby/object:Gem::Requirement
129
- none: false
130
- requirements:
131
- - - ! '>='
132
- - !ruby/object:Gem::Version
133
- version: '0'
134
- type: :runtime
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
- requirements:
139
- - - ! '>='
140
- - !ruby/object:Gem::Version
141
- version: '0'
142
- - !ruby/object:Gem::Dependency
143
- name: notifier
127
+ name: coderay
144
128
  requirement: !ruby/object:Gem::Requirement
145
129
  none: false
146
130
  requirements:
@@ -156,14 +140,14 @@ dependencies:
156
140
  - !ruby/object:Gem::Version
157
141
  version: '0'
158
142
  - !ruby/object:Gem::Dependency
159
- name: coderay
143
+ name: rspec
160
144
  requirement: !ruby/object:Gem::Requirement
161
145
  none: false
162
146
  requirements:
163
147
  - - ! '>='
164
148
  - !ruby/object:Gem::Version
165
149
  version: '0'
166
- type: :runtime
150
+ type: :development
167
151
  prerelease: false
168
152
  version_requirements: !ruby/object:Gem::Requirement
169
153
  none: false
@@ -172,7 +156,7 @@ dependencies:
172
156
  - !ruby/object:Gem::Version
173
157
  version: '0'
174
158
  - !ruby/object:Gem::Dependency
175
- name: rspec
159
+ name: test_notifier
176
160
  requirement: !ruby/object:Gem::Requirement
177
161
  none: false
178
162
  requirements:
@@ -188,7 +172,7 @@ dependencies:
188
172
  - !ruby/object:Gem::Version
189
173
  version: '0'
190
174
  - !ruby/object:Gem::Dependency
191
- name: test_notifier
175
+ name: rake
192
176
  requirement: !ruby/object:Gem::Requirement
193
177
  none: false
194
178
  requirements:
@@ -204,7 +188,7 @@ dependencies:
204
188
  - !ruby/object:Gem::Version
205
189
  version: '0'
206
190
  - !ruby/object:Gem::Dependency
207
- name: rake
191
+ name: pry
208
192
  requirement: !ruby/object:Gem::Requirement
209
193
  none: false
210
194
  requirements:
@@ -220,7 +204,7 @@ dependencies:
220
204
  - !ruby/object:Gem::Version
221
205
  version: '0'
222
206
  - !ruby/object:Gem::Dependency
223
- name: pry
207
+ name: pry-nav
224
208
  requirement: !ruby/object:Gem::Requirement
225
209
  none: false
226
210
  requirements:
@@ -359,6 +343,7 @@ files:
359
343
  - spec/support/mybook/text/TOC.textile
360
344
  - spec/support/mybook/text/_00_Introduction.markdown
361
345
  - spec/support/shared.rb
346
+ - templates/Guardfile
362
347
  - templates/config.erb
363
348
  - templates/cover.erb
364
349
  - templates/cover.png
@@ -387,9 +372,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
387
372
  required_rubygems_version: !ruby/object:Gem::Requirement
388
373
  none: false
389
374
  requirements:
390
- - - ! '>'
375
+ - - ! '>='
391
376
  - !ruby/object:Gem::Version
392
- version: 1.3.1
377
+ version: '0'
393
378
  requirements: []
394
379
  rubyforge_project:
395
380
  rubygems_version: 1.8.23