Parent

Class Index [+]

Quicksearch

RSpec::Core::ProjectInitializer

Public Class Methods

new(arg=nil) click to toggle source
   # File lib/rspec/core/project_initializer.rb, line 4
4:       def initialize(arg=nil)
5:         @arg = arg
6:       end

Public Instance Methods

create_dot_rspec_file() click to toggle source
    # File lib/rspec/core/project_initializer.rb, line 23
23:       def create_dot_rspec_file
24:         if File.exist?('.rspec')
25:           report_exists('.rspec')
26:         else
27:           report_creating('.rspec')
28:           File.open('.rspec','w') do |f|
29:             f.write --color--format progress
30:           end
31:         end
32:       end
create_spec_helper_file() click to toggle source
    # File lib/rspec/core/project_initializer.rb, line 37
37:       def create_spec_helper_file
38:         if File.exist?('spec/spec_helper.rb')
39:           report_exists("spec/spec_helper.rb")
40:         else
41:           report_creating("spec/spec_helper.rb")
42:           FileUtils.mkdir_p('spec')
43:           File.open('spec/spec_helper.rb','w') do |f|
44:             f.write # This file was generated by the `rspec --init` command. Conventionally, all# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.# Require this file using `require "spec_helper.rb"` to ensure that it is only# loaded once.## See http://rubydoc.info/gems/rspec-core/RSpec/Core/ConfigurationRSpec.configure do |config|  config.treat_symbols_as_metadata_keys_with_true_values = true  config.run_all_when_everything_filtered = true  config.filter_run :focusend
45:           end
46:         end
47:       end
delete_if_confirmed(path, message) click to toggle source
    # File lib/rspec/core/project_initializer.rb, line 61
61:       def delete_if_confirmed(path, message)
62:         if File.exist?(path)
63:           puts
64:           puts message
65:           puts
66:           puts "  delete   #{path}? [y/n]"
67:           FileUtils.rm_rf(path) if gets =~ /y/
68:         end
69:       end
report_creating(file) click to toggle source
    # File lib/rspec/core/project_initializer.rb, line 75
75:       def report_creating(file)
76:         puts "  create   #{file}"
77:       end
report_exists(file) click to toggle source
    # File lib/rspec/core/project_initializer.rb, line 71
71:       def report_exists(file)
72:         puts "   exist   #{file}"
73:       end
run() click to toggle source
    # File lib/rspec/core/project_initializer.rb, line 8
 8:       def run
 9:         warn "The --configure option no longer needs any arguments, so #{@arg} was ignored." if @arg
10:         create_spec_helper_file
11:         create_dot_rspec_file
12:         delete_if_confirmed("autotest/discover.rb",   RSpec registers its own discover.rb with Autotest, so autotest/discover.rb is  no longer needed.)
13: 
14:         delete_if_confirmed("lib/tasks/rspec.rake",   If the file in lib/tasks/rspec.rake is the one generated by rspec-rails-1x,  you can get rid of it, as it is no longer needed with rspec-2.)
15:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.