Class: LambdaRubyBundler::CLI::OptionParser Private

Inherits:
OptionParser
  • Object
show all
Defined in:
lib/lambda_ruby_bundler/cli/option_parser.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Custom OptionParser which collects user-supplied options about the build.

Constant Summary collapse

OPTIONS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

%i[
  root_path_option
  app_path_option
  output_option
  no_dependencies_option
  dependencies_path_option
  cache_dir_option
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOptionParser

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of OptionParser.



19
20
21
22
23
# File 'lib/lambda_ruby_bundler/cli/option_parser.rb', line 19

def initialize
  @options = defaults

  super { |builder| OPTIONS.each { |option| send(option, builder) } }
end

Instance Attribute Details

#optionsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

def options
  @options
end

Instance Method Details

#parse!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
28
29
30
31
32
33
# File 'lib/lambda_ruby_bundler/cli/option_parser.rb', line 25

def parse!(*)
  super

  options[:dependencies_path] ||= build_default_dependencies_path(
    options[:output_path]
  )

  options
end