Class: RailsLogConverter::CLI
- Defined in:
- lib/rails_log_converter/cli.rb,
lib/rails_log_converter/cli/execute.rb,
lib/rails_log_converter/cli/options.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#file_path ⇒ Object
Returns the value of attribute file_path.
Attributes included from Options
Instance Method Summary collapse
- #database_name ⇒ Object
- #directory_path ⇒ Object
- #file_name ⇒ Object
-
#initialize(arguments, stdin = $stdin, stdout = $stdout) ⇒ CLI
constructor
A new instance of CLI.
Methods included from Execute
#close_database, #create_database, #execute!, included
Methods included from Options
included, #option_parser, #parse_options!
Constructor Details
#initialize(arguments, stdin = $stdin, stdout = $stdout) ⇒ CLI
Returns a new instance of CLI.
12 13 14 15 16 17 |
# File 'lib/rails_log_converter/cli.rb', line 12 def initialize(arguments, stdin=$stdin, stdout=$stdout) @args = arguments.dup RailsLogConverter::Configuration.in_stream = stdin RailsLogConverter::Configuration.out_stream = stdout end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
8 9 10 |
# File 'lib/rails_log_converter/cli.rb', line 8 def args @args end |
#file_path ⇒ Object
Returns the value of attribute file_path.
9 10 11 |
# File 'lib/rails_log_converter/cli.rb', line 9 def file_path @file_path end |
Instance Method Details
#database_name ⇒ Object
27 28 29 |
# File 'lib/rails_log_converter/cli.rb', line 27 def database_name "#{file_name}.db" end |
#directory_path ⇒ Object
23 24 25 |
# File 'lib/rails_log_converter/cli.rb', line 23 def directory_path File.dirname file_path end |
#file_name ⇒ Object
19 20 21 |
# File 'lib/rails_log_converter/cli.rb', line 19 def file_name File.basename file_path end |