Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 6472

Show
Ignore:
Timestamp:
03/27/07 14:17:01 (3 years ago)
Author:
minam
Message:

Added -F flag to make it easier to load the default config even when other files are explicitly given

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/capistrano/lib/capistrano/cli/options.rb

    r6457 r6472  
    3131            "Displays help (if available) for the task." 
    3232          ) { |value| options[:explain] = value } 
     33 
     34          opts.on("-F", "--default-config", 
     35            "Always use default config, even with -f." 
     36          ) { options[:default_config] = true } 
    3337 
    3438          opts.on("-f", "--file FILE", 
     
    111115        options[:verbose] = 3 if !options.has_key?(:verbose) 
    112116 
    113         look_for_default_recipe_file! if options[:recipes].empty? 
     117        look_for_default_recipe_file! if options[:default_config] || options[:recipes].empty? 
    114118        extract_environment_variables! 
    115119 
  • tools/capistrano/test/cli/options_test.rb

    r6457 r6472  
    149149  end 
    150150 
     151  def test_F_should_search_for_default_recipes_even_if_f_is_given 
     152    @cli.expects(:look_for_default_recipe_file!) 
     153    @cli.args << "-Ff" << "hello" 
     154    @cli.parse_options! 
     155  end 
     156 
    151157  def test_should_extract_env_vars_from_command_line 
    152158    assert_nil ENV["HELLO"]