Sha256: 4401723abe5136d0db92cfe2bd2d188825c4aab06d4835871add21fb227ca064

Contents?: true

Size: 930 Bytes

Versions: 1

Compression:

Stored size: 930 Bytes

Contents

require File.dirname(__FILE__) + '/lib/generators/active_unimod/active_unimod_generator.rb'

# Gem Generators require the generator to be available from
# a 'generators' or 'rails_generators' path, or a '_generator.rb' 
# file within the gem.  Like so:
#
#   gems/gem_generator-0.1.0/gem_generator.rb
#
# By contrast the natural place to develop a gem is within the 
# 'lib/generators' directory.  When the gem generaator is loaded
# it recieves a spec that defines the path where the generator
# was found, and that path is used to discover templates, etc.
#
# This module redirects the path to the natural packaging location
# for the generator.
module RedirectSpecPath # :nodoc:
  def spec=(spec)
    if spec.source == :RubyGems
      spec.instance_variable_set("@path",  File.join(spec.path, "/lib/generators/active_unimod"))
    end
    super
  end
end

ActiveUnimodGenerator.extend RedirectSpecPath

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_unimod_generator-0.1.0 active_unimod_generator.rb