Sha256: 8549c5f6f3a147b28347cc4dab8923c8b21b4a63ac27f59cdcb665ad811a4764

Contents?: true

Size: 642 Bytes

Versions: 5

Compression:

Stored size: 642 Bytes

Contents

require 'rails/generators/base'

module Danthes
  module Generators
    class Base < Rails::Generators::Base
      def self.source_root
        File.dirname(__FILE__) + "/templates"
      end
      
      def self.banner
        "rails generate danthes:#{generator_name}"
      end
      
    private
      
      def add_gem(name, options = {})
        gemfile_path = File.join(destination_root, 'Gemfile')
        gemfile_content = File.read(gemfile_path)
        File.open(gemfile_path, 'a') { |f| f.write("\n") } unless gemfile_content =~ /\n\Z/
        gem name, options unless gemfile_content.include? name
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
danthes-1.0.5 lib/generators/danthes.rb
danthes-1.0.4 lib/generators/danthes.rb
danthes-1.0.3 lib/generators/danthes.rb
danthes-1.0.2 lib/generators/danthes.rb
danthes-1.0.1 lib/generators/danthes.rb