Sha256: e1e0bb20f675e7348358b0fedd9973d5a877e805a7e78a06d71dc210956c6fce

Contents?: true

Size: 648 Bytes

Versions: 4

Compression:

Stored size: 648 Bytes

Contents

require 'generators/my_scaffold_generator'

module MySpec
  module Generators
    class IntegrationGenerator < Rails::Generators::NamedBase
      include MyGenerators::Generators::MyScaffoldGenerator
      class_option :request_specs, :type => :boolean, :default => true,  :desc => "Generate request specs"

      def generate_request_spec
        return unless options[:request_specs]

        template 'request_spec.rb',
                 File.join('spec/requests', class_path, "#{table_name}_spec.rb")
      end
      def self.source_root
        @source_root ||= File.expand_path("templates", File.dirname(__FILE__))
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
my_generators-0.0.4 lib/generators/my_spec/integration/integration_generator.rb
my_generators-0.0.3 lib/generators/my_spec/integration/integration_generator.rb
my_generators-0.0.2 lib/generators/my_spec/integration/integration_generator.rb
my_generators-0.0.1 lib/generators/my_spec/integration/integration_generator.rb