Sha256: 93ccc11a98c65081ce5f6db3e16edee6f989c69bfc78fae23ee8f3ba9450a89d

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

require 'rails_generator'

module PluginAWeek #:nodoc:
  module PluginTestHelper
    # The base generator for creating parts of the test application
    class Generator < Rails::Generator::NamedBase
      attr_accessor :plugin_name
      
      def initialize(*runtime_args) #:nodoc:
        @plugin_name = runtime_args.first.shift if runtime_args.first.is_a?(Array)
        super(*runtime_args)
      end
      
      private
        def plugin_test_root
          "vendor/plugins/#{plugin_name}/test"
        end
        
        def plugin_app_root
          "#{plugin_test_root}/app_root"
        end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
plugin_test_helper-0.1.3 lib/plugin_test_helper/generator.rb
plugin_test_helper-0.1.4 lib/plugin_test_helper/generator.rb