aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudiob <claudiob@inventati.org>2017-03-22 15:51:02 -0700
committerclaudiob <claudiob@inventati.org>2017-03-22 15:54:19 -0700
commit1c6d394da188071588d07957ca7ad67025cab637 (patch)
treec53015faa1bff4d15912df4550cfa76e367f7cf7
parent12b684985837bc8ee9ad15c174cf4e07ca82d7c4 (diff)
downloadrails-1c6d394da188071588d07957ca7ad67025cab637.tar.gz
rails-1c6d394da188071588d07957ca7ad67025cab637.tar.bz2
rails-1c6d394da188071588d07957ca7ad67025cab637.zip
List options for `rails new --webpack=WEBPACK`
When you type `rails new -h`, the `--database=DATABASE` options display this useful message: > Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc) However, the `--webpack=WEBPACK` option only displays this: > Preconfigure for app-like JavaScript with Webpack so it's hard to know *which* values are valid for `WEBPACK`. This commit improves the help message to display: > Preconfigure for app-like JavaScript with Webpack (options: react/vue/angular) The implication of this commit is that the list needs to be manually updated whenever rails/webpacker adds support for a new framework. However, I don't imagine this list to change very frequently, and I think that the benefit of display the list to the users is greater than the hustle of updating the list when needed.
-rw-r--r--railties/lib/rails/generators/app_base.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index 3e7f69e9eb..fbb6b5039c 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -13,6 +13,7 @@ module Rails
DATABASES = %w( mysql postgresql sqlite3 oracle frontbase ibm_db sqlserver )
JDBC_DATABASES = %w( jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc )
DATABASES.concat(JDBC_DATABASES)
+ WEBPACKS = %w( react vue angular )
attr_accessor :rails_template
add_shebang_option!
@@ -34,7 +35,7 @@ module Rails
desc: "Preconfigure for selected JavaScript library"
class_option :webpack, type: :string, default: nil,
- desc: "Preconfigure for app-like JavaScript with Webpack"
+ desc: "Preconfigure for app-like JavaScript with Webpack (options: #{WEBPACKS.join('/')})"
class_option :skip_yarn, type: :boolean, default: false,
desc: "Don't use Yarn for managing JavaScript dependencies"