Class: RspecGenerator
- Defined in:
- lib/vendor/plugins/rspec-rails/generators/rspec/rspec_generator.rb
Overview
This generator bootstraps a Rails project for use with RSpec
Constant Summary collapse
- DEFAULT_SHEBANG =
File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
Instance Method Summary collapse
-
#initialize(runtime_args, runtime_options = {}) ⇒ RspecGenerator
constructor
A new instance of RspecGenerator.
- #manifest ⇒ Object
Constructor Details
#initialize(runtime_args, runtime_options = {}) ⇒ RspecGenerator
Returns a new instance of RspecGenerator.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/vendor/plugins/rspec-rails/generators/rspec/rspec_generator.rb', line 8 def initialize(runtime_args, = {}) if test ?f, 'spec/spec_helper.rb' puts <<-HELPFUL_INSTRUCTIONS It looks like you are upgrading rspec-rails in this application. Please let this script overwrite everything it wants to with the following exceptions, *if* you have customized any of these files: * spec/spec.opts * spec/rcov.opts * spec/spec_helper.rb If you have customized spec/spec_helper.rb, please set aside a copy of that file so that it can be updated and you can manually restore your changes. HELPFUL_INSTRUCTIONS end Dir.mkdir('lib/tasks') unless File.directory?('lib/tasks') super end |
Instance Method Details
#manifest ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/vendor/plugins/rspec-rails/generators/rspec/rspec_generator.rb', line 30 def manifest record do |m| = { :chmod => 0755, :shebang => [:shebang] == DEFAULT_SHEBANG ? nil : [:shebang] } m.directory 'lib/tasks' m.file 'rspec.rake', 'lib/tasks/rspec.rake' m.file 'script/autospec', 'script/autospec', m.file 'script/spec', 'script/spec', m.directory 'spec' m.file 'rcov.opts', 'spec/rcov.opts' m.file 'spec.opts', 'spec/spec.opts' m.template 'spec_helper.rb', 'spec/spec_helper.rb' end end |