Class: Elrio::CLI
- Inherits:
-
Object
- Object
- Elrio::CLI
- Defined in:
- lib/elrio/cli.rb
Instance Method Summary collapse
-
#initialize(output = $stdout) ⇒ CLI
constructor
A new instance of CLI.
- #run(args) ⇒ Object
Constructor Details
#initialize(output = $stdout) ⇒ CLI
Returns a new instance of CLI.
3 4 5 |
# File 'lib/elrio/cli.rb', line 3 def initialize(output = $stdout) @output = output end |
Instance Method Details
#run(args) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/elrio/cli.rb', line 7 def run(args) runner = Runner.new cmd = args.shift return usage unless cmd args.each do |path| insets = runner.send(cmd, path) @output.puts "#{path}: #{insets}" end end |