Commit Graph

5830 Commits

Author SHA1 Message Date
Prathamesh Sonpatki
b05fec04e9
Don't generate HTML/ERB templates for scaffold controller with --api flag
- Fixes #27591.
2017-01-07 18:06:32 +05:30
Akira Matsuda
5473e390d3 self. is not needed when calling its own instance method
Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
2017-01-05 19:58:52 +09:00
Rafael Mendonça França
50cb1b697c
Merge pull request #27399 from sinogermany/rails-env-for-empty-string-env-vars
Rails env for empty string env vars
2017-01-03 23:37:37 -05:00
Daniel Deng
498370c05b Rails.env falls back to dev mode when env var is empty 2017-01-04 15:03:30 +11:00
Rafael Mendonça França
b6ffb5efcb
Revert "Merge pull request #27550 from mtsmfm/fix-generator-command-for-nested-rails-engine"
This reverts commit 1e969bfb98b88799e2c759fce25a1d8cf00d7ce7, reversing
changes made to a5041f267ded119c2d00b8786c2f2c1e3f93c8a1.

Reason: It breaks the public API
2017-01-03 21:51:18 -05:00
Rafael França
1e969bfb98 Merge pull request #27550 from mtsmfm/fix-generator-command-for-nested-rails-engine
Fix generator command for nested (namespaced) rails engine
2017-01-03 21:45:25 -05:00
Rafael Mendonça França
f9ed83321a
Remove deprecated CONTROLLER environment variable for routes task 2017-01-03 20:42:14 -05:00
Rafael Mendonça França
f7782812f7
Remove deprecated tasks in railties 2017-01-03 20:42:14 -05:00
Rafael Mendonça França
7563bf7b46
Remove deprecated file `rails/rack/debugger 2017-01-03 20:42:14 -05:00
Rafael Mendonça França
0129ca2eeb
Remove deprecated config.serve_static_files 2017-01-03 20:42:14 -05:00
Rafael Mendonça França
c861decd44
Remove deprecated config.static_cache_control 2017-01-03 20:42:13 -05:00
Arthur Nogueira Neves
bc87cd7f18 Merge pull request #24814 from vipulnsward/24811-fix-double-tasks
Don't list out tasks as separately that are under lib, which cause them to be listed twice under Libraries and tasks.
2017-01-03 15:33:49 -05:00
Sean Griffin
0d8069d365 Merge pull request #27435 from kamipo/follow_up_25307
Active Record supports MySQL >= 5.1.10
2017-01-03 11:19:47 -05:00
Fumiaki MATSUSHIMA
085546df45 Fix generator command for nested (namespaced) rails engine
If we create nested (namespaced) rails engine such like bukkits-admin,
`bin/rails g scaffold User name:string age:integer`
will create
`bukkits-admin/app/controllers/bukkits/users_controller.rb`
but it should create
`bukkits-admin/app/controllers/bukkits/admin/users_controller.rb`.

In #6643, we changed `namespaced_path` as root path
because we supposed application_controller is always in root
but nested rails engine's application_controller will not.
2017-01-03 21:18:09 +09:00
Prathamesh Sonpatki
7bb52d2781
Remove bin/yarn if yarn is skipped, tidy up tests
- No need to remove bin/yarn separately for API only apps because
  :skip_yarn is set to true for API only apps.
- Added a test for :skip_yarn config.
2017-01-01 15:16:39 +05:30
yuuji.yaginuma
4e5a96dd29 remove unnecessary remove_file
It deletes the `app/mailers` directory itself, it is not necessary to delete
the file individually.
https://github.com/rails/rails/blob/master/railties/lib/rails/generators/rails/app/app_generator.rb#L329
2017-01-01 10:57:39 +09:00
Kasper Timm Hansen
1e3d6482cc Match Thor's desc signature.
It can also take an options hash.
2016-12-31 19:25:18 +01:00
Kasper Timm Hansen
46da4b143f Prevent command name being printed twice.
Thor would inadvertantly duplicate the command usage because
of the help method in a command class.

Fixes #26664.

[ Yuji Yaginuma & Kasper Timm Hansen ]
2016-12-31 19:25:18 +01:00
yuuji.yaginuma
9b72fcc3c2 remove skip_bundle option from plugin generator
Because `bundle install` is not executed regardless of whether the option
is specified or not.

Ref: fbd1e98cf983572ca9884f17f933ffe92833632a
2016-12-31 18:55:35 +09:00
Matthew Draper
6b126ffdcd Enforce middleware ordering with a test, instead of comments
We want the actual order to be very predictable, so it's rightly defined
in code -- not with an on-the-fly tsort.

But we can do the tsort here, and then verify that it matches the
implemented ordering. This way we don't leave future readers guessing
which parts of the ordering are deliberate and which are arbitrary.
2016-12-31 08:40:01 +10:30
Leonid Batizhevsky
6efdb7177b Allow log remote ip addres when config.action_dispatch.trusted_proxies passed 2016-12-30 15:57:32 -05:00
Ryuta Kamizono
90715d8e2f Remove needless ActiveSupport::Deprecation.silence 2016-12-31 03:54:37 +09:00
Rafael Mendonça França
e646bad5b7
Remove deprecated support to passing a column to #quote 2016-12-29 17:53:03 -05:00
Kasper Timm Hansen
ca3eb2c156 Merge branch 'master' into fix_26964 2016-12-29 20:09:43 +01:00
Rafael França
eb6a6141a6 Merge branch 'master' into clear_all_environments_log_by_default 2016-12-29 02:18:38 -05:00
Rafael Mendonça França
010e246756
Fix Rubocop violations and fix documentation visibility
Some methods were added to public API in
5b14129d8d4ad302b4e11df6bd5c7891b75f393c and they should be not part of
the public API.
2016-12-28 21:53:51 -05:00
Matthew Draper
f27edc84df Correct indent-accounting in controller route generation
Fixes #27447

[Matthew Draper & Yuuji Yaginuma]
2016-12-25 16:49:23 +10:30
Akira Matsuda
d1daf4c313 Privatize unneededly protected methods in Railties 2016-12-25 02:11:40 +09:00
Akira Matsuda
6b049057f0 Privatize some methods that were originally protected 2016-12-25 02:11:39 +09:00
Akira Matsuda
f9caa5a6dd Prefer class << self; def over def self. 2016-12-25 02:11:39 +09:00
Akira Matsuda
87ec7009bf protected here doesn't protect anything
there aren't any instance method defined in this class
2016-12-25 00:20:38 +09:00
yuuji.yaginuma
654704247e use Thor option parser in server commands parse
The `ServerCommand` inherits Thor, but currently does not use Thor
option parser.
Therefore, if leave the argument of Thor as it is, it becomes an error by
the argument checking of Thor.
To avoid it, to use the Thor option parser instead of reimplementing it.

Fixes #26964
2016-12-24 12:08:33 +09:00
Akira Matsuda
21e5fd4a2a Describe what we are protecting 2016-12-23 23:48:54 +09:00
Ryuta Kamizono
ecca3d6052 Active Record supports MySQL >= 5.1.10
Follow up to #25307 and #23458. Related with #27422.

We are using `information_schema.referential_constraints` since #25307.
The table was introduced in MySQL 5.1.10. MySQL 5.0 is too old. It is
enough to support >= 5.1.10 at least.

MySQL 5.0 GA was released in Dec 2005 and already EOL in Dec 2011.
MySQL 5.1 GA was released in Dec 2008 and already EOL in Dec 2013.
2016-12-22 18:46:22 +09:00
Jon Moss
fa69b2c035 ARGV.shift before calling Rails generators
Gems like rspec-rails depend on `ARGV` being shifted, and `scaffold`
(for example) not being the first item in `ARGV`. This should allow
rspec-rails to be passing on Rails master.
2016-12-17 14:01:25 -05:00
Fumiaki MATSUSHIMA
a0d4d78884 Remove unused method namespaced_file_path
```
$ git grep namespaced_file_path
railties/lib/rails/generators/named_base.rb:        def namespaced_file_path
railties/lib/rails/generators/named_base.rb:          @namespaced_file_path ||= namespaced_class_path.join("/")
```
2016-12-14 19:10:11 +09:00
yuuji.yaginuma
92dae5dfda use appropriate type for rc option
This fixes the following warning.

```
Expected boolean default value for '--rc'; got "~/.railsrc" (string)
```
2016-12-14 11:12:13 +09:00
Kasper Timm Hansen
1373f9bdcf Don't assign a default to webpack.
Unintentionally makes `--webpack` implied on `rails new apper`.

If passed `--webpack` Thor assigns `"webpack"` to `options[:webpack]`,
so we can check for that instead of `"base"`.
2016-12-12 21:10:50 +01:00
David Heinemeier Hansson
cfdf6e1368 Add option to trigger JS framework-specific installation as part of webpack setup 2016-12-12 11:07:28 -08:00
Akira Matsuda
edf4bff77c Oops!
namespace_ladder can be nil here
2016-12-12 21:34:22 +09:00
Akira Matsuda
f1878baad5 💅
Don't expect the caller of this method to know that the return value has an extra "  "
2016-12-12 20:49:25 +09:00
yuuji.yaginuma
c2c840fa6b run webpack command only when webpack option is specified 2016-12-10 10:46:24 +09:00
Yuji Yaginuma
c16296c795 gemfile entry method need to return an empty array rather than nil (#27318)
This fixes the following error when executing rails new command.

```
(erb):9:in `block in template': undefined method `comment' for nil:NilClass (NoMethodError)
```

Follow up to #27288
2016-12-09 16:21:28 -08:00
David Heinemeier Hansson
ecddc0468d Use GitHub webpacker until closer to release 2016-12-09 13:33:45 -08:00
David Heinemeier Hansson
8c947eb6e9 Basic --webpack delegation to new webpacker gem (#27288) 2016-12-09 12:19:43 -08:00
Guillermo Iguaran
872faa9583 Show message if Yarn is not installed (#27312) 2016-12-09 07:46:28 -08:00
David Heinemeier Hansson
c873746c50 Only have Yarn bundling commented out as we cant be sure Yarn is installed 2016-12-08 19:49:30 -08:00
Yuji Yaginuma
fbd33b911a specify skip_yarn option in API-only Application (#27309) 2016-12-08 19:07:40 -08:00
Sean Griffin
a0aad0381a Merge pull request #25051 from bf4/extract_notes_as_binary
Extract notes as binary
2016-12-08 13:51:02 -05:00
David Heinemeier Hansson
0d20530e5e Make Yarn the default, drop default vendor/asset directories (#27300) 2016-12-08 10:33:23 -08:00