Class: Rails::Generators::AppBase

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

Overview

:nodoc:

Direct Known Subclasses

AppGenerator, PluginGenerator

Defined Under Namespace

Classes: GemfileEntry

Constant Summary collapse

DATABASES =
%w( mysql postgresql sqlite3 oracle 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, exit_on_failure?, hide!, hook_for, inherited, namespace, remove_hook_for, source_root

Methods included from Actions

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

Constructor Details

#initialize(*args) ⇒ AppBase

Returns a new instance of AppBase.



106
107
108
109
110
111
# File 'lib/rails/generators/app_base.rb', line 106

def initialize(*args)
  @gem_filter    = lambda { |gem| true }
  @extra_entries = []
  super
  convert_database_option_for_jruby
end

Instance Attribute Details

#rails_templateObject

Returns the value of attribute rails_template.



19
20
21
# File 'lib/rails/generators/app_base.rb', line 19

def rails_template
  @rails_template
end

Class Method Details

.add_shared_options_for(name) ⇒ Object



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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/rails/generators/app_base.rb', line 28

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

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

  class_option :skip_yarn,           type: :boolean, default: false,
                                     desc: "Don't use Yarn for managing JavaScript dependencies"

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

  class_option :skip_git,            type: :boolean, aliases: "-G", default: false,
                                     desc: "Skip .gitignore file"

  class_option :skip_keeps,          type: :boolean, default: false,
                                     desc: "Skip source control .keep files"

  class_option :skip_action_mailer,  type: :boolean, aliases: "-M",
                                     default: false,
                                     desc: "Skip Action Mailer files"

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

  class_option :skip_active_storage, type: :boolean, default: false,
                                     desc: "Skip Active Storage files"

  class_option :skip_puma,           type: :boolean, aliases: "-P", default: false,
                                     desc: "Skip Puma related files"

  class_option :skip_action_cable,   type: :boolean, aliases: "-C", default: false,
                                     desc: "Skip Action Cable files"

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

  class_option :skip_spring,         type: :boolean, default: false,
                                     desc: "Don't install Spring application preloader"

  class_option :skip_listen,         type: :boolean, default: false,
                                     desc: "Don't generate configuration that depends on the listen gem"

  class_option :skip_coffee,         type: :boolean, default: false,
                                     desc: "Don't use CoffeeScript"

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

  class_option :skip_turbolinks,     type: :boolean, default: false,
                                     desc: "Skip turbolinks gem"

  class_option :skip_test,           type: :boolean, aliases: "-T", default: false,
                                     desc: "Skip test files"

  class_option :skip_system_test,    type: :boolean, default: false,
                                     desc: "Skip system test files"

  class_option :skip_bootsnap,       type: :boolean, default: false,
                                     desc: "Skip bootsnap gem"

  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 :rc,                  type: :string, default: nil,
                                     desc: "Path to file containing extra configuration options for rails command"

  class_option :no_rc,               type: :boolean, default: false,
                                     desc: "Skip loading of extra configuration options from .railsrc file"

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

.strict_args_positionObject



24
25
26
# File 'lib/rails/generators/app_base.rb', line 24

def self.strict_args_position
  false
end