Class: InfinityTest::Options
- Inherits:
- 
      Hash
      
        - Object
- Hash
- InfinityTest::Options
 
- Defined in:
- lib/infinity_test/options.rb
Instance Method Summary collapse
- 
  
    
      #initialize(arguments)  ⇒ Options 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Options. 
- #parse_bacon(options) ⇒ Object
- #parse_bundler(options) ⇒ Object
- 
  
    
      #parse_patterns(options)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    def parse_cucumber(options) options.on(‘–cucumber’, ‘Run with the Cucumber too’) do self = true end end. 
- #parse_rails(options) ⇒ Object
- #parse_rspec(options) ⇒ Object
- #parse_rubies(options) ⇒ Object
- #parse_rubygems(options) ⇒ Object
- #parse_test_unit(options) ⇒ Object
- #parse_verbose(options) ⇒ Object
- #parse_version(options) ⇒ Object
Constructor Details
#initialize(arguments) ⇒ Options
Returns a new instance of Options.
| 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # File 'lib/infinity_test/options.rb', line 6 def initialize(arguments) super() @options = OptionParser.new do || [:test_unit, :rspec, :bacon, :rubygems, :rails, :rubies, :verbose, :patterns, :bundler, :version].each do |name| send("parse_#{name}", ) end . = [ "Usage: infinity_test [options]", "Starts a continuous test server."].join("\n") .on_tail("--help", "You're looking at it.") do print .help exit end end @options.parse!(arguments.clone) end | 
Instance Method Details
#parse_bacon(options) ⇒ Object
| 33 34 35 36 37 | # File 'lib/infinity_test/options.rb', line 33 def parse_bacon() .on('--bacon', 'Test Framework: Bacon') do self[:test_framework] = :bacon end end | 
#parse_bundler(options) ⇒ Object
| 75 76 77 78 79 | # File 'lib/infinity_test/options.rb', line 75 def parse_bundler() .on('--skip-bundler', "InfinityTest try to use bundler if Gemfile is present. If you don't want to use this convention, set this option.") do self[:skip_bundler?] = true end end | 
#parse_patterns(options) ⇒ Object
def parse_cucumber(options)
.on('--cucumber', 'Run with the Cucumber too') do
  self[:cucumber] = true
end
end
| 69 70 71 72 73 | # File 'lib/infinity_test/options.rb', line 69 def parse_patterns() .on('--heuristics', 'Show all the Default Patterns and added by #heuristics method and EXIT.') do self[:show_heuristics?] = true end end | 
#parse_rails(options) ⇒ Object
| 51 52 53 54 55 | # File 'lib/infinity_test/options.rb', line 51 def parse_rails() .on('--rails', 'Application Framework: Rails') do self[:app_framework] = :rails end end | 
#parse_rspec(options) ⇒ Object
| 21 22 23 24 25 | # File 'lib/infinity_test/options.rb', line 21 def parse_rspec() .on('--rspec', 'Test Framework: Rspec') do self[:test_framework] = :rspec end end | 
#parse_rubies(options) ⇒ Object
| 39 40 41 42 43 | # File 'lib/infinity_test/options.rb', line 39 def parse_rubies() .on('--rubies=rubies', 'Specify the Ruby Versions for Testing with many Rubies') do |versions| self[:rubies] = versions end end | 
#parse_rubygems(options) ⇒ Object
| 57 58 59 60 61 | # File 'lib/infinity_test/options.rb', line 57 def parse_rubygems() .on('--rubygems', 'Application Framework: Rubygems (Default)') do self[:app_framework] = :rubygems end end | 
#parse_test_unit(options) ⇒ Object
| 27 28 29 30 31 | # File 'lib/infinity_test/options.rb', line 27 def parse_test_unit() .on('--test-unit', 'Test Framework: Test Unit [Default]') do self[:test_framework] = :test_unit end end | 
#parse_verbose(options) ⇒ Object
| 45 46 47 48 49 | # File 'lib/infinity_test/options.rb', line 45 def parse_verbose() .on('--verbose', 'The Infinity Test dont print the commands', 'To print the commands set this option!') do self[:verbose] = true end end | 
#parse_version(options) ⇒ Object
| 81 82 83 84 85 86 | # File 'lib/infinity_test/options.rb', line 81 def parse_version() .on("--version", "Show version and exit") do puts InfinityTest.version exit end end |