From ebfe41ca2126132e780b47f73245d8f4e4a13187 Mon Sep 17 00:00:00 2001 From: Matthew Michihara Date: Sun, 5 May 2013 16:00:18 -0700 Subject: Improve model generator USAGE grammar --- railties/lib/rails/generators/rails/model/USAGE | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/rails/model/USAGE b/railties/lib/rails/generators/rails/model/USAGE index 1998a392aa..145d9ee6e0 100644 --- a/railties/lib/rails/generators/rails/model/USAGE +++ b/railties/lib/rails/generators/rails/model/USAGE @@ -46,18 +46,18 @@ Available field types: `rails generate model photo title:string album:references` - It will generate an album_id column. You should generate this kind of fields when - you will use a `belongs_to` association for instance. `references` also support - the polymorphism, you could enable the polymorphism like this: + It will generate an `album_id` column. You should generate these kinds of fields when + you will use a `belongs_to` association, for instance. `references` also supports + polymorphism, you can enable polymorphism like this: `rails generate model product supplier:references{polymorphic}` - For integer, string, text and binary fields an integer in curly braces will + For integer, string, text and binary fields, an integer in curly braces will be set as the limit: `rails generate model user pseudo:string{30}` - For decimal two integers separated by a comma in curly braces will be used + For decimal, two integers separated by a comma in curly braces will be used for precision and scale: `rails generate model product price:decimal{10,2}` -- cgit v1.2.3 From 430e5dce42523066368d46f6d5a769dd1ffcd743 Mon Sep 17 00:00:00 2001 From: Joe Kutner Date: Fri, 10 May 2013 13:04:40 -0500 Subject: Removed jruby-openssl gem from default template Gemfile --- railties/lib/rails/generators/rails/app/templates/Gemfile | 2 -- railties/test/generators/app_generator_test.rb | 3 --- 2 files changed, 5 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile index 243e7e9da8..577ff651e5 100644 --- a/railties/lib/rails/generators/rails/app/templates/Gemfile +++ b/railties/lib/rails/generators/rails/app/templates/Gemfile @@ -4,8 +4,6 @@ source 'https://rubygems.org' <%= database_gemfile_entry -%> -<%= "gem 'jruby-openssl'\n" if defined?(JRUBY_VERSION) -%> - <%= assets_gemfile_entry %> <%= javascript_gemfile_entry -%> diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 0ffb615764..e992534938 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -183,9 +183,6 @@ class AppGeneratorTest < Rails::Generators::TestCase run_generator([destination_root, "-d", "jdbcmysql"]) assert_file "config/database.yml", /mysql/ assert_gem "activerecord-jdbcmysql-adapter" - # TODO: When the JRuby guys merge jruby-openssl in - # jruby this will be removed - assert_gem "jruby-openssl" if defined?(JRUBY_VERSION) end def test_config_jdbcsqlite3_database -- cgit v1.2.3 From 524f09a5e7fe8f8a8ee1bdbaa32a944e1981f10c Mon Sep 17 00:00:00 2001 From: Teng Siong Ong Date: Sat, 11 May 2013 03:12:59 -0700 Subject: Clean up unused method for `rake doc`. --- railties/lib/rails/tasks/documentation.rake | 5 ----- 1 file changed, 5 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/tasks/documentation.rake b/railties/lib/rails/tasks/documentation.rake index d45e892424..8544890553 100644 --- a/railties/lib/rails/tasks/documentation.rake +++ b/railties/lib/rails/tasks/documentation.rake @@ -44,11 +44,6 @@ else end namespace :doc do - def gem_path(gem_name) - path = $LOAD_PATH.grep(/#{gem_name}[\w.-]*\/lib$/).first - yield File.dirname(path) if path - end - RDocTaskWithoutDescriptions.new("app") { |rdoc| rdoc.rdoc_dir = 'doc/app' rdoc.template = ENV['template'] if ENV['template'] -- cgit v1.2.3 From bde14bef61b16fe3f7190f66cf9d93f14c4c7b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hrvoje=20=C5=A0imi=C4=87?= Date: Sun, 12 May 2013 22:55:41 +0200 Subject: better error message when app name is not passed in `rails new` Prior to this change, for the following command: $ rails new we received "Options should be given after the application name" as an error message. This is outdated and should be "Application name should be provided in arguments". --- railties/lib/rails/generators/rails/app/app_generator.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 5877579fc4..d48dcf9ef3 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -151,7 +151,15 @@ module Rails desc: "Show Rails version number and quit" def initialize(*args) - raise Error, "Options should be given after the application name. For details run: rails --help" if args[0].blank? + if args[0].blank? + if args[1].blank? + # rails new + raise Error, "Application name should be provided in arguments. For details run: rails --help" + else + # rails new --skip-bundle my_new_application + raise Error, "Options should be given after the application name. For details run: rails --help" + end + end super -- cgit v1.2.3 From 2a57cbc762ef9c8c9aca7965a2b863486000ab65 Mon Sep 17 00:00:00 2001 From: AJ Acevedo Date: Sun, 12 May 2013 22:47:25 -0400 Subject: Updated comment to Rails 4 --- railties/lib/rails/generators/rails/plugin_new/templates/bin/rails.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/bin/rails.tt b/railties/lib/rails/generators/rails/plugin_new/templates/bin/rails.tt index aa87d1b50c..c8de9f3e0f 100644 --- a/railties/lib/rails/generators/rails/plugin_new/templates/bin/rails.tt +++ b/railties/lib/rails/generators/rails/plugin_new/templates/bin/rails.tt @@ -1,4 +1,4 @@ -# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. +# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. ENGINE_ROOT = File.expand_path('../..', __FILE__) ENGINE_PATH = File.expand_path('../../lib/<%= name -%>/engine', __FILE__) -- cgit v1.2.3