Class: Steamd::CliOptions
- Inherits:
-
Object
- Object
- Steamd::CliOptions
- Defined in:
- lib/steamd/cli_options.rb
Overview
Options that the CLI can take
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ CliOptions
constructor
Create a CliOptions object.
-
#input ⇒ Object
Returns the absolute path of the input directory specified by the cli.
-
#output ⇒ Object
Returns the absolute path of the output directory specified by the cli.
Constructor Details
#initialize(opts = {}) ⇒ CliOptions
Create a CliOptions object
13 14 15 16 17 18 |
# File 'lib/steamd/cli_options.rb', line 13 def initialize(opts = {}) @options = opts @output = opts[:output] @input = opts[:input] self end |
Instance Method Details
#input ⇒ Object
Returns the absolute path of the input directory specified by the cli.
Throws an exception if the input is not a directory
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/steamd/cli_options.rb', line 28 def input o = if @input.nil? Steamd.language_dir else @input end raise 'input must be a directory' unless File.directory?(o) File.(o) end |
#output ⇒ Object
Returns the absolute path of the output directory specified by the cli.
Throws an exception if the output is not a directory
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/steamd/cli_options.rb', line 47 def output o = if @output.nil? './lib/steamd' else @output end raise 'output must be a directory' unless File.directory?(o) File.(o) end |