Sha256: c4a7758a66ecb2d7172579cd54a50221a77fdf2d342b1bcf149b51d7d7832bc6

Contents?: true

Size: 795 Bytes

Versions: 80

Compression:

Stored size: 795 Bytes

Contents

module Beaker
  module Options
    #A set of functions to read options files
    module SubcommandOptionsParser

      def self.parse_options_file(options_file_path)
        result = OptionsHash.new
        if File.exist?(options_file_path)
          result = YAML.load_file(options_file_path)
        end
        result
      end

      # @return [OptionsHash, Hash] returns an empty OptionHash or loads subcommand options yaml
      #   from disk
      def self.parse_subcommand_options(argv, options_file)
        result = OptionsHash.new
        if Beaker::Subcommands::SubcommandUtil.execute_subcommand?(argv[0])
          return result if argv[0] == 'init'
          result = SubcommandOptionsParser.parse_options_file(options_file)
        end
        result
      end

    end
  end
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
beaker-4.42.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.41.2 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.41.1 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.41.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.40.2 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.40.1 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.40.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.39.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.38.1 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.38.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.37.2 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.37.1 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.37.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.36.1 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.36.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.35.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.34.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.33.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.32.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-4.31.0 lib/beaker/options/subcommand_options_file_parser.rb