Sha256: 9382a3c0627ab438973fafadbdb4c8786e1727c77204ffd26ebb322b3d0cafe7

Contents?: true

Size: 625 Bytes

Versions: 4

Compression:

Stored size: 625 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

4 entries across 4 versions & 2 rubygems

Version Path
edmond-danthes-2.1.1 lib/generators/danthes_generator.rb
edmond-danthes-2.1.0 lib/generators/danthes_generator.rb
danthes-2.0.1 lib/generators/danthes_generator.rb
danthes-2.0.0 lib/generators/danthes_generator.rb