Upgraded Rails and RSpec
[monkeycharger.git] / vendor / plugins / rspec / rspec_on_rails / generators / rspec / rspec_generator.rb
blobd5512e3864fe7a4d8e38a24864279c39d50dc660
1 require 'rbconfig'
3 # This generator bootstraps a Rails project for use with RSpec
4 class RspecGenerator < Rails::Generator::Base
5   DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
6                               Config::CONFIG['ruby_install_name'])
8   def initialize(runtime_args, runtime_options = {})
9     super
10   end
12   def manifest
13     record do |m|
14       script_options     = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] }
16       m.directory 'spec'
17       m.template  'spec_helper.rb',                'spec/spec_helper.rb'
18       m.file      'spec.opts',                     'spec/spec.opts'
19       m.file      'rcov.opts',                     'spec/rcov.opts'
20       m.file      'script/spec_server',            'script/spec_server', script_options
21       m.file      'script/spec',                   'script/spec',        script_options
23       m.directory 'stories'
24       m.file      'all_stories.rb',                'stories/all.rb'
25       m.file      'stories_helper.rb',             'stories/helper.rb'
26     end
27   end
29 protected
31   def banner
32     "Usage: #{$0} rspec"
33   end
35 end