Class: Vapir::Options

Inherits:
UserChoices::Command
  • Object
show all
Includes:
UserChoices
Defined in:
lib/vapir-common/options.rb

Instance Method Summary collapse

Instance Method Details

#add_choices(builder) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/vapir-common/options.rb', line 34

def add_choices builder
  builder.add_choice :browser, 
  :type => Vapir::Browser.browser_names, 
  :default => Vapir::Browser.default
  builder.add_choice :speed, 
  :type => ['slow', 'fast', 'zippy'], 
  :default => 'fast'
  builder.add_choice :visible,
  :type => :boolean
end

#add_sources(builder) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/vapir-common/options.rb', line 27

def add_sources builder
  builder.add_source EnvironmentSource, :with_prefix, 'watir_'
  if Vapir.options_file
    builder.add_source YamlConfigFileSource, :from_complete_path, 
      Vapir.options_file
  end
end

#executeObject



44
45
46
47
# File 'lib/vapir-common/options.rb', line 44

def execute 
  @user_choices[:speed] = @user_choices[:speed].to_sym
  @user_choices
end