Sha256: f8cf8fe345a34358bb69af81b1af92c3e0a650cba8861cca0bef248049dce449

Contents?: true

Size: 1013 Bytes

Versions: 12

Compression:

Stored size: 1013 Bytes

Contents

require 'user-choices'
module Taza
  class Options < UserChoices::Command
    include UserChoices

    def add_sources(builder)
#     builder.add_source(CommandLineSource, :usage, "Usage: ruby #{$0} [options] file1 [file2]")
      builder.add_source(EnvironmentSource, :mapping, {:browser => 'BROWSER', :driver => 'DRIVER', :attach => 'ATTACH', :timeout => 'TIMEOUT', :server_ip => 'SERVER_IP', :server_port => 'SERVER_PORT'})
      builder.add_source(YamlConfigFileSource, :from_complete_path, Settings.config_file_path)
    end

    def add_choices(builder)
     builder.add_choice(:browser, :type=>:string, :default=>'firefox')
     builder.add_choice(:driver, :type=>:string, :default=>'selenium')
     builder.add_choice(:attach, :type=>:boolean, :default=>false)
     builder.add_choice(:timeout, :type=>:string)
     builder.add_choice(:server_ip, :type=>:string)
     builder.add_choice(:server_port, :type=>:string)
    end

    def execute
      @user_choices
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
taza-3.0.0 lib/taza/options.rb
taza-2.1.0 lib/taza/options.rb
taza-2.0 lib/taza/options.rb
taza-1.0 lib/taza/options.rb
scudco-taza-0.8.7 lib/taza/options.rb
taza-0.9.2.1 lib/taza/options.rb
taza-0.9.2.0 lib/taza/options.rb
taza-0.9.1.2 lib/taza/options.rb
taza-0.9.1.1 lib/taza/options.rb
taza-0.9.1 lib/taza/options.rb
taza-0.9.0 lib/taza/options.rb
taza-0.8.7 lib/taza/options.rb