class Bookbinder::CLI

Attributes

legacy_commands[R]

Public Class Methods

exit_on_failure?() click to toggle source
# File lib/bookbinder/cli.rb, line 10
def self.exit_on_failure?
  true
end
new(*) click to toggle source
Calls superclass method
# File lib/bookbinder/cli.rb, line 86
def initialize(*)
  super

  @legacy_commands = Bookbinder::Commands::Collection.new(colorized_streams, git)
end

Public Instance Methods

bind(source) click to toggle source
# File lib/bookbinder/cli.rb, line 39
def bind(source)
  code = legacy_commands.bind(source, options[:verbose], options['dita-flags'], options[:require_valid_subnav_links], options[:proof])
  raise Thor::Error, '' if code != 0
end
generate(book_name) click to toggle source
# 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(command=nil) click to toggle source
Calls superclass method
# File lib/bookbinder/cli.rb, line 24
def help(command=nil)
  super
end
imprint(source) click to toggle source
# File lib/bookbinder/cli.rb, line 71
def imprint(source)
  code = legacy_commands.imprint(source, options[:verbose], options['dita-flags'])
  raise Thor::Error, '' if code != 0
end
method_missing(command, *args) click to toggle source
# File lib/bookbinder/cli.rb, line 76
def method_missing(command, *args)
  puts "Unknown command '#{command}'"
  puts ""
  help
end
punch(git_tag) click to toggle source
# File lib/bookbinder/cli.rb, line 45
def punch(git_tag)
  code = legacy_commands.punch(git_tag)
  raise Thor::Error, '' if code != 0
end
update_local_doc_repos() click to toggle source
# File lib/bookbinder/cli.rb, line 51
def update_local_doc_repos
  code = legacy_commands.update_local_doc_repos
  raise Thor::Error, '' if code != 0
end
version() click to toggle source
# 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(*repos) click to toggle source
# File lib/bookbinder/cli.rb, line 63
def watch(*repos)
  code = legacy_commands.watch(repos)
  raise Thor::Error, '' if code != 0
end

Private Instance Methods

colorized_streams() click to toggle source
# File lib/bookbinder/cli.rb, line 96
def colorized_streams
  @streams ||= {
    err: Streams::ColorizedStream.new(Colorizer::Colors.red, $stderr),
    out: $stdout,
    success: Streams::ColorizedStream.new(Colorizer::Colors.green, $stdout),
    warn: Streams::ColorizedStream.new(Colorizer::Colors.yellow, $stdout),
  }
end
git() click to toggle source
# File lib/bookbinder/cli.rb, line 92
def git
  @git ||= Ingest::GitAccessor.new
end