Class: RailsLogConverter::CLI

Inherits:
Object
  • Object
show all
Includes:
Execute, Options
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

Modules: Execute, Options

Instance Attribute Summary collapse

Attributes included from Options

#options

Instance Method Summary collapse

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
  parse_options!
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



8
9
10
# File 'lib/rails_log_converter/cli.rb', line 8

def args
  @args
end

#file_pathObject

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_nameObject



27
28
29
# File 'lib/rails_log_converter/cli.rb', line 27

def database_name
  "#{file_name}.db"
end

#directory_pathObject



23
24
25
# File 'lib/rails_log_converter/cli.rb', line 23

def directory_path
  File.dirname file_path
end

#file_nameObject



19
20
21
# File 'lib/rails_log_converter/cli.rb', line 19

def file_name
  File.basename file_path
end