Sha256: b6accdc02dea1cb0874512b82f953e5318c0bb28a1c536cd3be0eed3498281ee
Contents?: true
Size: 824 Bytes
Versions: 4
Compression:
Stored size: 824 Bytes
Contents
require 'rails/generators/base' module Nifty module Generators class Base < Rails::Generators::Base #:nodoc: def self.source_root @_nifty_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'nifty', generator_name, 'templates')) end def self.banner "rails generate nifty:#{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
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
aslon_scaffold-0.0.15 | lib/generators/nifty.rb |
aslon_scaffold-0.0.14 | lib/generators/nifty.rb |
aslon_scaffold-0.0.13 | lib/generators/nifty.rb |
aslon_scaffold-0.0.12 | lib/generators/nifty.rb |