Class: Bugsage::CLI
- Inherits:
-
Thor
- Object
- Thor
- Bugsage::CLI
- Defined in:
- lib/bugsage/cli.rb
Instance Method Summary collapse
Instance Method Details
#explain ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/bugsage/cli.rb', line 43 def explain fake_exception = begin nil.foo rescue NoMethodError => e e end suggestion = Rule.match(fake_exception) if suggestion Formatter.print(suggestion) else puts "No matching rule found." end end |
#hello ⇒ Object
14 15 16 |
# File 'lib/bugsage/cli.rb', line 14 def hello puts "BugSage is alive." end |
#install ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/bugsage/cli.rb', line 22 def install if [:guide_only] Installation.print_guide return end Installation.print_guide say "" result = Installer.run(destination: [:destination] || Dir.pwd, force: [:force]) if result[:created_initializer] say "Created #{result[:initializer_path]}", :green else say "Skipped #{result[:initializer_path]} (already exists). Use --force to overwrite.", :yellow end say "\n#{result[:summary].join("\n")}\n" end |