Sha256: ec30582e5bf52eca3ed50d9a22345d8670eb58e6f8416ae6fc1877c83cf0cec3

Contents?: true

Size: 671 Bytes

Versions: 7

Compression:

Stored size: 671 Bytes

Contents

module Stationed
  module Generators
    class TemplatesGenerator < Rails::Generators::Base
      source_root File.expand_path('../../../templates', __FILE__)

      def self.banner
        <<-BANNER.chomp
rails generate stationed:templates

Copies all generator templates from the Stationed gem into your project
directory for easy customisation.
        BANNER
      end

      def copy_files
        root = Pathname(self.class.source_root)
        Pathname.glob(root.join('**', '*.{haml,rb}')).each do |path|
          relpath = path.relative_path_from(root)
          copy_file relpath, Pathname('lib/templates').join(relpath)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
stationed-0.6.0 lib/generators/stationed/templates_generator.rb
stationed-0.5.0 lib/generators/stationed/templates_generator.rb
stationed-0.4.0 lib/generators/stationed/templates_generator.rb
stationed-0.3.0 lib/generators/stationed/templates_generator.rb
stationed-0.2.0 lib/generators/stationed/templates_generator.rb
stationed-0.1.0 lib/generators/stationed/templates_generator.rb
stationed-0.0.1 lib/generators/stationed/templates_generator.rb