Class: PopulateEnv::CLI::Runner
- Inherits:
-
Object
- Object
- PopulateEnv::CLI::Runner
- Defined in:
- lib/populate_env/cli/runner.rb
Instance Attribute Summary collapse
-
#argv ⇒ Object
readonly
Returns the value of attribute argv.
-
#executable ⇒ Object
readonly
Returns the value of attribute executable.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #help ⇒ Object
- #heroku ⇒ Object
-
#initialize(argv: ARGV, output: $stdout, executable: File.basename($0)) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(argv: ARGV, output: $stdout, executable: File.basename($0)) ⇒ Runner
Returns a new instance of Runner.
6 7 8 |
# File 'lib/populate_env/cli/runner.rb', line 6 def initialize(argv: ARGV, output: $stdout, executable: File.basename($0)) @argv, @output, @executable = Array(argv), output, executable end |
Instance Attribute Details
#argv ⇒ Object (readonly)
Returns the value of attribute argv.
4 5 6 |
# File 'lib/populate_env/cli/runner.rb', line 4 def argv @argv end |
#executable ⇒ Object (readonly)
Returns the value of attribute executable.
4 5 6 |
# File 'lib/populate_env/cli/runner.rb', line 4 def executable @executable end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
4 5 6 |
# File 'lib/populate_env/cli/runner.rb', line 4 def output @output end |
Instance Method Details
#help ⇒ Object
14 15 16 |
# File 'lib/populate_env/cli/runner.rb', line 14 def help output.puts option_parser.to_s end |
#heroku ⇒ Object
22 23 24 25 |
# File 'lib/populate_env/cli/runner.rb', line 22 def heroku = CLI::HerokuOptions.parse(argv, command: "#{executable} heroku") PopulateEnv::Heroku.call() end |
#run ⇒ Object
10 11 12 |
# File 'lib/populate_env/cli/runner.rb', line 10 def run send(subcommand) end |
#version ⇒ Object
18 19 20 |
# File 'lib/populate_env/cli/runner.rb', line 18 def version output.puts "#{executable} version #{VERSION}" end |