Class: RailsApp::OptionsData
- Inherits:
-
Object
- Object
- RailsApp::OptionsData
- Defined in:
- lib/rails_app/options_data.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #app_name ⇒ Object
- #default_action_cable ⇒ Object
- #default_action_mailbox ⇒ Object
- #default_action_mailer ⇒ Object
- #default_action_storage ⇒ Object
- #default_action_text ⇒ Object
- #default_assets ⇒ Object
- #default_database ⇒ Object
- #default_styling ⇒ Object
-
#initialize(args) ⇒ OptionsData
constructor
A new instance of OptionsData.
Constructor Details
#initialize(args) ⇒ OptionsData
Returns a new instance of OptionsData.
7 8 9 |
# File 'lib/rails_app/options_data.rb', line 7 def initialize(args) @options = args end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/rails_app/options_data.rb', line 5 def @options end |
Instance Method Details
#app_name ⇒ Object
11 12 13 |
# File 'lib/rails_app/options_data.rb', line 11 def app_name @options[0] end |
#default_action_cable ⇒ Object
77 78 79 |
# File 'lib/rails_app/options_data.rb', line 77 def default_action_cable @options.include?("skip_action_cable") end |
#default_action_mailbox ⇒ Object
65 66 67 |
# File 'lib/rails_app/options_data.rb', line 65 def default_action_mailbox @options.include?("skip_action_mailbox") end |
#default_action_mailer ⇒ Object
61 62 63 |
# File 'lib/rails_app/options_data.rb', line 61 def default_action_mailer @options.include?("skip_action_mailer") end |
#default_action_storage ⇒ Object
73 74 75 |
# File 'lib/rails_app/options_data.rb', line 73 def default_action_storage @options.include?("skip_action_storage") end |
#default_action_text ⇒ Object
69 70 71 |
# File 'lib/rails_app/options_data.rb', line 69 def default_action_text @options.include?("skip_action_text") end |
#default_assets ⇒ Object
15 16 17 18 19 |
# File 'lib/rails_app/options_data.rb', line 15 def default_assets # puts "@options: #{@options.include?("sprockets")}" @options.include?("sprockets") ? "sprockets" : "propshaft" end |
#default_database ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/rails_app/options_data.rb', line 37 def default_database if @options.include?("postgresql") "postgresql" elsif @options.include?("mysql") "mysql" elsif @options.include?("trilogy") "trilogy" elsif @options.include?("oracle") "oracle" elsif @options.include?("sqlserver") "sqlserver" elsif @options.include?("jdbcmysql") "jdbcmysql" elsif @options.include?("jdbcsqlite3") "jdbcsqlite3" elsif @options.include?("jdbcpostgresql") "jdbcpostgresql" elsif @options.include?("jdbc") "jdbc" else "sqlite3" end end |
#default_styling ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rails_app/options_data.rb', line 21 def default_styling if @options.any? { |option| option.end_with?("tailwind") } "tailwind".strip elsif @options.any? { |option| option.end_with?("bulma") } "bulma".strip elsif @options.any? { |option| option.end_with?("postcss") } "postcss".strip elsif @options.any? { |option| option.end_with?("sass") } "sass" elsif @options.any? { |option| option.end_with?("bootstrap") } "bootstrap" else "bootstrap" end end |