Class: Attractor::CLI
- Inherits:
-
Thor
- Object
- Thor
- Attractor::CLI
- Defined in:
- lib/attractor/cli.rb
Overview
contains methods implementing the CLI
Instance Method Summary collapse
Instance Method Details
#calc ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/attractor/cli.rb', line 50 def calc file_prefix = [:file_prefix] output_format = [:format] report! Attractor::ConsoleReporter.new(file_prefix: file_prefix, ignores: [:ignore], calculators: calculators(), format: output_format) rescue RuntimeError => e puts "Runtime error: #{e.}" end |
#clean ⇒ Object
31 32 33 34 |
# File 'lib/attractor/cli.rb', line 31 def clean puts "Clearing attractor cache" Attractor.clear end |
#init ⇒ Object
40 41 42 43 |
# File 'lib/attractor/cli.rb', line 40 def init puts "Warming attractor cache" Attractor.init(calculators()) end |
#report ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'lib/attractor/cli.rb', line 63 def report file_prefix = [:file_prefix] open_browser = !([:no_open_browser] || [:ci]) report! Attractor::HtmlReporter.new(file_prefix: file_prefix, ignores: [:ignore], calculators: calculators(), open_browser: open_browser) rescue RuntimeError => e puts "Runtime error: #{e.}" end |
#serve ⇒ Object
76 77 78 79 80 81 |
# File 'lib/attractor/cli.rb', line 76 def serve file_prefix = [:file_prefix] open_browser = !([:no_open_browser] || [:ci]) report! Attractor::SinatraReporter.new(file_prefix: file_prefix, ignores: [:ignore], calculators: calculators(), open_browser: open_browser) end |