git-scribe 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. data/bin/git-scribe +1 -1
  2. data/lib/git-scribe.rb +16 -6
  3. metadata +3 -3
data/bin/git-scribe CHANGED
@@ -3,4 +3,4 @@ $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
3
3
 
4
4
  require 'git-scribe'
5
5
 
6
- GitScribe.start(ARGV)
6
+ GitScribe.start
data/lib/git-scribe.rb CHANGED
@@ -8,11 +8,14 @@ require 'pp'
8
8
 
9
9
  class GitScribe
10
10
 
11
+ include Subcommands
12
+
11
13
  BOOK_FILE = 'book.asc'
12
14
  OUTPUT_TYPES = ['pdf', 'epub', 'mobi', 'html', 'site']
13
15
  SCRIBE_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
14
16
 
15
- def initialize(args)
17
+ def initialize
18
+
16
19
  @options = {}
17
20
  global_options do |opts|
18
21
  opts.banner = "Usage: #{$0} [options] [subcommand [options]]"
@@ -25,20 +28,23 @@ class GitScribe
25
28
  end
26
29
 
27
30
  command :init do |opts|
28
- opts.banner = "Usage: init [options]"
31
+ opts.banner = "Usage: git scribe init (directory)"
29
32
  opts.description = "initialize a new book layout"
30
33
  opts.on("-l", "--lang", "choose a default language (en)") do |v|
31
34
  @options[:lang] = lang || 'en'
32
35
  end
33
36
  end
34
37
 
35
- pp @options
38
+ command :gen do |opts|
39
+ opts.banner = "Usage: git scribe gen [options]"
40
+ opts.description = "generate digital formats"
41
+ end
36
42
 
37
- opt_parse
43
+ @command = opt_parse
38
44
  end
39
45
 
40
- def self.start(args)
41
- GitScribe.new(args).run
46
+ def self.start
47
+ GitScribe.new.run
42
48
  end
43
49
 
44
50
  def run
@@ -52,6 +58,10 @@ class GitScribe
52
58
  ## COMMANDS ##
53
59
 
54
60
 
61
+ def die(message)
62
+ raise message
63
+ end
64
+
55
65
  # start a new scribe directory with skeleton structure
56
66
  def init
57
67
  name = ARGV.shift
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-scribe
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Scott Chacon