Class: Mkmatter::App::CLI
Constant Summary collapse
- HILINE =
(see HighLine#new)
HighLine.new($stdin, $stderr, 80)
Instance Method Summary collapse
-
#__debug ⇒ NilClass
Prints debug info.
-
#__print_info ⇒ NilClass
Prints Gem info.
-
#__print_version ⇒ NilClass
Prints version string.
Instance Method Details
#__debug ⇒ NilClass
Prints debug info
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mkmatter/cli/app.rb', line 30 def __debug report = YAML.safe_load(OS.report) rows = { :mkmatter_version => Mkmatter::VERSION, :ruby_version => RbConfig::CONFIG['RUBY_PROGRAM_VERSION'], } rows.merge! report rows.merge!({ 'ruby bin' => OS.ruby_bin, :windows => OS.windows?, :posix => OS.posix?, :mac => OS.mac?, 'under windows' => OS::.windows?, 'under bsd' => OS::.bsd?, }) table = Terminal::Table.new table.title = 'mkmatter Debug Info' table.rows = rows.to_a table.align_column(0, :left) puts table end |
#__print_info ⇒ NilClass
Returns Prints Gem info.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/mkmatter/cli/app.rb', line 57 def __print_info format = [:'info-format'] rows = { 'author(s)': Mkmatter::GemInfo..join(', '), 'e-mail': Mkmatter::GemInfo.email.join(', '), 'mkmatter version': Mkmatter::VERSION, 'Ruby version': RbConfig::CONFIG['RUBY_PROGRAM_VERSION'], 'Platform': RbConfig::CONFIG['build_os'], } case format when 'table' table = Terminal::Table.new table.style.alignment = :center table.title = 'mkmatter Info' table.rows = rows.to_a table.align_column(0, :left) puts table when 'yaml' puts rows.stringify_keys.to_yaml else # noop # this doesn't get run because of # the logic of options and their # enum parameter. end end |
#__print_version ⇒ NilClass
Prints version string
22 23 24 |
# File 'lib/mkmatter/cli/app.rb', line 22 def __print_version puts Mkmatter::VERSION end |