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 = {})
14 script_options = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] }
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
24 m.file 'all_stories.rb', 'stories/all.rb'
25 m.file 'stories_helper.rb', 'stories/helper.rb'