Sha256: 9639f79b2cfdb8fd3cfb9d84b891936f1a9114d5080b766f6be3527264f179b6
Contents?: true
Size: 816 Bytes
Versions: 6
Compression:
Stored size: 816 Bytes
Contents
require 'rails/generators/base' module Zoo module Generators class Base < Rails::Generators::Base #:nodoc: def self.source_root @_haml_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'zoo', generator_name, 'templates')) end def self.banner "rails generate zoo:#{generator_name} #{self.arguments.map{ |a| a.usage }.join(' ')} [options]" end private def add_gem(name, options = {}) gemfile_content = File.read(destination_path("Gemfile")) File.open(destination_path("Gemfile"), 'a') { |f| f.write("\n") } unless gemfile_content =~ /\n\Z/ gem name, options unless gemfile_content.include? name end def print_usage self.class.help(Thor::Base.shell.new) exit end end end end
Version data entries
6 entries across 6 versions & 1 rubygems