Sha256: 647852a18bbab13cc1e17245c3efd9172529447c1e8c2c751562b61efb686242

Contents?: true

Size: 1.33 KB

Versions: 31

Compression:

Stored size: 1.33 KB

Contents

require 'rbconfig'

# This generator bootstraps a Rails project for use with RSpec
class RspecGenerator < Rails::Generator::Base
  DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
                              Config::CONFIG['ruby_install_name'])

  def initialize(runtime_args, runtime_options = {})
    Dir.mkdir('lib/tasks') unless File.directory?('lib/tasks')
    super
  end

  def manifest
    record do |m|
      script_options     = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] }

      m.file      'rspec.rake',                    'lib/tasks/rspec.rake'

      m.file      'script/autospec',               'script/autospec',    script_options
      m.file      'script/spec',                   'script/spec',        script_options
      m.file      'script/spec_server',            'script/spec_server', script_options

      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'

      m.directory 'stories'
      m.file      'all_stories.rb',                'stories/all.rb'
      m.file      'stories_helper.rb',             'stories/helper.rb'
    end
  end

protected

  def banner
    "Usage: #{$0} rspec"
  end

end

Version data entries

31 entries across 31 versions & 6 rubygems

Version Path
dchelimsky-rspec-rails-1.1.10 generators/rspec/rspec_generator.rb
dchelimsky-rspec-rails-1.1.11.1 generators/rspec/rspec_generator.rb
dchelimsky-rspec-rails-1.1.11.2 generators/rspec/rspec_generator.rb
dchelimsky-rspec-rails-1.1.11.3 generators/rspec/rspec_generator.rb
dchelimsky-rspec-rails-1.1.11 generators/rspec/rspec_generator.rb
dchelimsky-rspec-rails-1.1.6 generators/rspec/rspec_generator.rb
dchelimsky-rspec-rails-1.1.7 generators/rspec/rspec_generator.rb
dchelimsky-rspec-rails-1.1.8 generators/rspec/rspec_generator.rb
dchelimsky-rspec-rails-1.1.9 generators/rspec/rspec_generator.rb
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec-rails/generators/rspec/rspec_generator.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec-rails/generators/rspec/rspec_generator.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec-rails/generators/rspec/rspec_generator.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec-rails/generators/rspec/rspec_generator.rb
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb