epubforge 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
@@ -6,17 +6,16 @@ module EpubForge
6
6
  usage "#{$PROGRAM_NAME} mobify <project_directory(optional)>"
7
7
  # requires_executable "ebook-convert", "ebook-convert is included as part of the Calibre ebook management software."
8
8
 
9
- desc( "do:kindle", "Turn your .epub file into a .mobi file. Check to see if your Kindle is connected, then pushes it." )
9
+ desc( "do:mobify", "Turn your .epub file into a .mobi file." )
10
10
  def do( project, *args )
11
11
  @project = project
12
12
  @src_epub = @project.filename_for_epub_book.fwf_filepath
13
13
  @dst_mobi = @project.filename_for_mobi_book.fwf_filepath
14
14
 
15
15
  @args = args
16
+ @regenerate_epub = !!( @args.include?( "--no-cache" ) )
16
17
 
17
18
  mobify
18
-
19
-
20
19
  end
21
20
 
22
21
  protected
@@ -30,24 +29,13 @@ module EpubForge
30
29
 
31
30
  if $?.success? && @dst_mobi.exist?
32
31
  say_all_is_well "Formatted for Kindle (.mobi file). File at #{@dst_mobi}."
33
- push_to_device @dst_mobi
34
32
  else
35
33
  warn( "Something went wrong during the conversion process." )
36
34
  warn( "#{@dst_mobi} exists, but may not be complete or correct." ) if @dst_mobi.exist?
37
35
  false
38
36
  end
39
37
  end
40
-
41
- def push_to_device mobi_file
42
- if KINDLE_DEVICE_DIR.directory? && KINDLE_PUSH_DIR.directory?
43
- FileUtils.copy( mobi_file, KINDLE_PUSH_DIR )
44
- say_all_is_well "File pushed to Kindle."
45
- true
46
- else
47
- say_error "NOT installed on Kindle. It may not be plugged in."
48
- false
49
- end
50
- end
38
+
51
39
 
52
40
  def fulfill_requirements
53
41
  unless ebook_convert_installed?
@@ -55,7 +43,9 @@ module EpubForge
55
43
  return false
56
44
  end
57
45
 
58
- BookToEpub.new.do( @project )
46
+ if !@src_epub.exist? || @regenerate_epub
47
+ BookToEpub.new.do( @project )
48
+ end
59
49
 
60
50
  unless @src_epub.exist?
61
51
  say_error( "Cannot find source .epub #{src_epub}" )
@@ -0,0 +1,15 @@
1
+ module EpubForge
2
+ module Action
3
+ class Version < ThorAction
4
+ description "Print version (v.#{EpubForge::VERSION}, to save you the trouble)"
5
+ keywords :version, :"--version"
6
+ usage "#{$PROGRAM_NAME} -v"
7
+ project_not_required
8
+
9
+ desc( "do:version", "print out help for the various actions.")
10
+ def do( project, *args )
11
+ puts "epubforge v. #{EpubForge::VERSION}, Copyright Bryce Anderson. MIT License."
12
+ end
13
+ end
14
+ end
15
+ end
data/lib/action/runner.rb CHANGED
@@ -18,7 +18,6 @@ module EpubForge
18
18
 
19
19
  def run
20
20
  @run_description.run
21
- puts @run_description
22
21
  @run_description
23
22
  end
24
23
 
data/lib/epubforge.rb CHANGED
@@ -23,9 +23,9 @@ require 'fun_with_configurations'
23
23
 
24
24
  EpubForge = Module.new
25
25
  EpubForge::DEBUG = false
26
-
27
26
  # EpubForge.root responds with the gem directory
28
27
  FunWith::Files::RootPath.rootify( EpubForge, __FILE__.fwf_filepath.dirname.up )
28
+ EpubForge::VERSION = EpubForge.root("VERSION").read
29
29
 
30
30
  def debugger?
31
31
  debugger if debugging?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epubforge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -226,6 +226,7 @@ files:
226
226
  - ./config/actions/mobify.rb
227
227
  - ./config/actions/notes_to_epub.rb
228
228
  - ./config/actions/notes_to_kindle.rb
229
+ - ./config/actions/version.rb
229
230
  - ./config/actions/word_count.rb
230
231
  - ./config/actions/wrap_scene_notes_in_hidden_div.rb
231
232
  - ./config/htmlizers.rb
@@ -315,7 +316,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
315
316
  version: '0'
316
317
  segments:
317
318
  - 0
318
- hash: 243230996870064853
319
+ hash: 1574289628664459478
319
320
  required_rubygems_version: !ruby/object:Gem::Requirement
320
321
  none: false
321
322
  requirements: