Class: Bookbinder::CLI
- Inherits:
-
Thor
- Object
- Thor
- Bookbinder::CLI
show all
- Defined in:
- lib/bookbinder/cli.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(command, *args) ⇒ Object
68
69
70
71
72
|
# File 'lib/bookbinder/cli.rb', line 68
def method_missing(command, *args)
puts "Unknown command '#{command}'"
puts ""
help
end
|
Class Method Details
.exit_on_failure? ⇒ Boolean
10
11
12
|
# File 'lib/bookbinder/cli.rb', line 10
def self.exit_on_failure?
true
end
|
Instance Method Details
#bind(source) ⇒ Object
37
38
39
40
|
# File 'lib/bookbinder/cli.rb', line 37
def bind(source)
code = legacy_commands.bind(source, options[:verbose], options['dita-flags'])
raise Thor::Error, '' if code != 0
end
|
#generate(book_name) ⇒ Object
29
30
31
32
|
# File 'lib/bookbinder/cli.rb', line 29
def generate(book_name)
code = legacy_commands.generate(book_name)
raise Thor::Error, '' if code != 0
end
|
#help ⇒ Object
24
25
26
|
# File 'lib/bookbinder/cli.rb', line 24
def help
super
end
|
#imprint(source) ⇒ Object
63
64
65
66
|
# File 'lib/bookbinder/cli.rb', line 63
def imprint(source)
code = legacy_commands.imprint(source, options[:verbose], options['dita-flags'])
raise Thor::Error, '' if code != 0
end
|
#punch(git_tag) ⇒ Object
43
44
45
46
|
# File 'lib/bookbinder/cli.rb', line 43
def punch(git_tag)
code = legacy_commands.punch(git_tag)
raise Thor::Error, '' if code != 0
end
|
#update_local_doc_repos ⇒ Object
49
50
51
52
|
# File 'lib/bookbinder/cli.rb', line 49
def update_local_doc_repos
code = legacy_commands.update_local_doc_repos
raise Thor::Error, '' if code != 0
end
|
#version ⇒ Object
18
19
20
21
|
# File 'lib/bookbinder/cli.rb', line 18
def version
gemspec = File.expand_path('../../../bookbinder.gemspec', __FILE__)
say "bookbinder #{Gem::Specification::load(gemspec).version}"
end
|
#watch ⇒ Object
55
56
57
58
|
# File 'lib/bookbinder/cli.rb', line 55
def watch
code = legacy_commands.watch
raise Thor::Error, '' if code != 0
end
|