Class: Rails::Generators::AppBase

Inherits:
Base
  • Object
show all
Defined in:
railties/lib/rails/generators/app_base.rb

Direct Known Subclasses

AppGenerator, PluginNewGenerator

Constant Summary collapse

DATABASES =
%w( mysql oracle postgresql sqlite3 frontbase ibm_db sqlserver )
JDBC_DATABASES =
%w( jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc )

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

base_root, class_option, default_source_root, desc, hook_for, inherited, namespace, remove_hook_for, source_root

Methods included from Actions

#add_source, #capify!, #environment, #gem, #generate, #git, #initializer, #lib, #plugin, #rake, #rakefile, #readme, #route, #vendor

Constructor Details

#initialize(*args) ⇒ AppBase

Returns a new instance of AppBase.



68
69
70
71
72
# File 'railties/lib/rails/generators/app_base.rb', line 68

def initialize(*args)
  @original_wd = Dir.pwd
  super
  convert_database_option_for_jruby
end

Instance Attribute Details

#rails_templateObject

Returns the value of attribute rails_template



16
17
18
# File 'railties/lib/rails/generators/app_base.rb', line 16

def rails_template
  @rails_template
end

Class Method Details

.add_shared_options_for(name) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'railties/lib/rails/generators/app_base.rb', line 21

def self.add_shared_options_for(name)
  class_option :builder,            :type => :string, :aliases => "-b",
                                    :desc => "Path to a #{name} builder (can be a filesystem path or URL)"

  class_option :template,           :type => :string, :aliases => "-m",
                                    :desc => "Path to an #{name} template (can be a filesystem path or URL)"

  class_option :skip_gemfile,       :type => :boolean, :default => false,
                                    :desc => "Don't create a Gemfile"

  class_option :skip_bundle,        :type => :boolean, :default => false,
                                    :desc => "Don't run bundle install"

  class_option :skip_git,           :type => :boolean, :aliases => "-G", :default => false,
                                    :desc => "Skip Git ignores and keeps"

  class_option :skip_active_record, :type => :boolean, :aliases => "-O", :default => false,
                                    :desc => "Skip Active Record files"

  class_option :skip_sprockets,     :type => :boolean, :aliases => "-S", :default => false,
                                    :desc => "Skip Sprockets files"

  class_option :database,           :type => :string, :aliases => "-d", :default => "sqlite3",
                                    :desc => "Preconfigure for selected database (options: #{DATABASES.join('/')})"

  class_option :javascript,         :type => :string, :aliases => '-j', :default => 'jquery',
                                    :desc => 'Preconfigure for selected JavaScript library'

  class_option :skip_javascript,    :type => :boolean, :aliases => "-J", :default => false,
                                    :desc => "Skip JavaScript files"

  class_option :dev,                :type => :boolean, :default => false,
                                    :desc => "Setup the #{name} with Gemfile pointing to your Rails checkout"

  class_option :edge,               :type => :boolean, :default => false,
                                    :desc => "Setup the #{name} with Gemfile pointing to Rails repository"

  class_option :skip_test_unit,     :type => :boolean, :aliases => "-T", :default => false,
                                    :desc => "Skip Test::Unit files"

  class_option :help,               :type => :boolean, :aliases => "-h", :group => :rails,
                                    :desc => "Show this help message and quit"

  class_option :old_style_hash,     :type => :boolean, :default => false,
                                    :desc => "Force using old style hash (:foo => 'bar') on Ruby >= 1.9"
end