Commit Graph

2339 Commits

Author SHA1 Message Date
Hyonjee Joo
b181297ad7 Created rake restart task.
Fixes #18876. Rake restart touches `tmp/restart.txt` to restart
application on next request. Updated tests and documentation
accordingly.
2015-02-26 15:26:59 -05:00
brainopia
321db4aa2e Change filter on /rails/info/routes to use an actual path regexp from rails
Change filter on /rails/info/routes to use an actual path regexp from rails
and not approximate javascript version. Oniguruma supports much more
extensive list of features than javascript regexp engine.

Fixes #18402.
2015-02-23 19:57:01 +03:00
Josef Šimánek
6576f7354e Require belongs_to by default.
Deprecate `required` option in favor of `optional` for belongs_to.
2015-02-21 23:03:10 +01:00
Guillermo Iguaran
06d5d2c5e9 Merge pull request #18994 from tgxworld/run_delete_middleware_operations_last
Allow Rack::Runtime to be deleted from middleware stack.
2015-02-19 00:18:05 -05:00
Josef Šimánek
6447309817 Remove unused gsub_app_file method from Bukkit. 2015-02-19 02:44:49 +01:00
Guo Xiang Tan
a39498ae06 Allow Rack::Runtime to be deleted from middleware stack.
Fixes: https://github.com/rails/rails/issues/16433.
2015-02-19 08:44:24 +08:00
Rafael Mendonça França
39c936b760 Merge pull request #18393 from y-yagi/fix_mailer
follow up to #18074
2015-02-18 19:05:07 -02:00
Arthur Neves
2c5c0690cc Dont check bundler output on plugin generator test 2015-02-10 16:22:53 -05:00
Sean Griffin
7210a0371f Actually fix the build
Like for real this time. I checked.
2015-02-10 12:36:18 -07:00
Sean Griffin
84c20e27b6 Fix the build 2015-02-10 12:12:14 -07:00
Yves Senn
8ba7548877 tests, reset global to previous value.
The default of the global might change. It's better to reset it to
what it was than a hardcoded value.
2015-02-09 10:41:37 +01:00
Yuki Nishijima
f5c27446bf Remove warning from generator named base test
This removes the following warning:

  railties/test/generators/named_base_test.rb:9: warning: method redefined; discarding old pluralize_table_names
  activesupport/lib/active_support/core_ext/class/attribute.rb:86: warning: previous definition of pluralize_table_names was here
  railties/test/generators/named_base_test.rb:9: warning: method redefined; discarding old pluralize_table_names=
  activesupport/lib/active_support/core_ext/class/attribute.rb:83: warning: previous definition of pluralize_table_names= was here
2015-02-08 17:09:12 -08:00
Xavier Noria
89a12c931b README.rdoc -> README.md for newly generated applications
README.rdoc was generated to support the doc:app task. Now that
this task is gone we can switch to Markdown, which is nowadays
a better default.
2015-02-06 21:04:54 +01:00
Xavier Noria
cd7cc5254b Remove documentation tasks
This patch removes the tasks doc:app, doc:rails, and doc:guides.

In our experience applications do not generate APIs using doc:app.
Methods may be certainly documented for maintainers, annotated
with YARD tags, etc. but that is intended to be read with the
source code, not in a separate website. Then, teams also have
typically selected topics written down in Markdown files, or in
a GitHub wiki... that kind of thing.

If a team absolutely needs to generate application documentation
for internal purposes, they can still easily write their own task.

Regarding doc:rails and doc:guides, we live in 2015. We are used
to go to online docs all the time. If you really want access to the
API offline RubyGems generates it for every Rails component unless
you tell it not to, and you can checkout the Rails source code to
read the guides as Markdown, or download them for a Kindle reader.

All in all, maintaining this code does not seem to be worthwhile
anymore.

As a consequence of this, guides (+3 MB uncompressed) won't be
distributed with the rails gem anymore. Of course, guides and API
are going to be still part of releases, since documentation is
maintained alongside code and tests.

Also, time permitting, this will allow us to experiment with novel
ways to generate documentation in the Rails docs server, since
right now we were constrained by being able to generate them in
the user's environment.
2015-02-06 21:04:54 +01:00
Rafael Mendonça França
25bbe595f1 Merge pull request #18399 from kommen/unify-structure-file-envvar-names
Use SCHEMA instead of DB_STRUCTURE for specifiying structure file.

Conflicts:
	activerecord/CHANGELOG.md
2015-02-05 18:55:33 -02:00
Rafael Mendonça França
6953f16efa Merge pull request #18526 from vipulnsward/add-silence-stream
Extracted silence_stream method to new module in activesupport/testing
2015-02-05 18:28:51 -02:00
Andrew White
80838d9bd5 Force generated route to be inserted
Thor isn't very discerning over whether some content is present when passed
to `inject_into_file`, e.g. a commented out route is detected as being present.
So to prevent people scratching their heads as to why a route hasn't appeared
it's better to fall on the side of having duplicate routes.
2015-02-05 17:54:23 +00:00
Andrew White
1c59ffca5c Don't remove all line endings from routes.rb
When there is a single scaffold in the routes.rb with no other lines
then revoking/destroying it will create a routes.rb file with a syntax
error. This is because the sentinel for the Thor `route` action didn't
include the newline but the logged route code did.

The fix is to add the newline to the sentinel and remove it from the
the logged route code.

Fixes #15913.
2015-02-03 22:53:23 +00:00
Vipul A M
6eced6a1fe Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 onwards. 2015-02-03 20:51:40 +05:30
robertomiranda
ce8efcf296 Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846
ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
2015-01-31 23:12:41 -05:00
Godfrey Chan
33030ea7cb Fixed a few things from ee9e4c3
Mostly cosmetics, except that `isolate_namespace` should be applied to the last
module in the chain.
2015-01-30 15:42:51 -08:00
Robin Böning
ee9e4c340e Allow hyphenated names for rails plugin new generator.
It was not possible to create a new gem with a hyphenated name via the `rails plugin new` generator.

The naming guide of rubygems clearly says dashes should be used for gems that extend other gems. http://guides.rubygems.org/name-your-gem/
2015-01-30 16:40:45 +01:00
Yves Senn
570ead9bed build fix II, adjust broken tests as a consequence of 670ac73126. 2015-01-30 13:52:18 +01:00
Yves Senn
f332ed0b9a build fix. 2015-01-30 13:35:35 +01:00
Yves Senn
1fa7861bc9 tests, use capture instead of custom redirect_stderr helper. 2015-01-30 12:04:57 +01:00
Rafael Mendonça França
4816449898 Merge pull request #18705 from mrgilman/skip-test
Update option to skip test in generators
2015-01-29 19:04:47 -02:00
Melanie Gilman
ec0f8ff23b Change option description and update test names 2015-01-29 15:44:26 -05:00
Yves Senn
d28e5b94a7 introduce ActiveSupport::Testing::FileFixtures.
It's a thin layer to provide easy access to sample files throughout
test-cases. This adds the directory `test/fixtures/files` to newly
generated applications.
2015-01-28 12:29:34 +01:00
Melanie Gilman
26b275030b Update option to skip test in generators
Rails no longer generates Test::Unit files by default.
2015-01-27 19:29:52 -05:00
Vipul A M
166ce95f65 - Extracted silence_stream method to new module in activesupport/testing.
- Added include for the same in ActiveSupport::Test.
- Removed occurrences of silence_stream being used elsewhere.
- Reordered activesupport testcase requires alphabetically.

- Removed require of silence stream from test_case

- Moved quietly method to stream helper

- Moved capture output to stream helper module and setup requires for the same elsewhere
2015-01-20 22:28:48 +05:30
Prathamesh Sonpatki
88ff9fd2a3 Fixed test for assert_welcome
- Test was wrongly using assert with assignment statement.
2015-01-17 22:15:15 +05:30
Sean Griffin
0b2e0528df Add the method_source gem to the default Gemfile
Fixes #18473
2015-01-13 10:24:10 -07:00
robertomiranda
5cca205114 Add Secure Token Generator 2015-01-11 14:42:54 -05:00
Nobuyoshi Nakada
69e365d2f4 Use IO::NULL always 2015-01-10 15:11:05 +01:00
David Heinemeier Hansson
6eb499f600 Merge pull request #18413 from brainopia/automatic_inverse_of_for_belongs_to
Correctly count methods when using declarative `#test` in minitest
2015-01-09 11:22:07 -05:00
brainopia
37704547d9 Update rake counts to count declarative tests in minitest 2015-01-09 12:52:23 +03:00
Carlos Souza
6870d48d19 Add _mailer suffix to i18n path
For mailers created via generators

Follow up to #18074
2015-01-08 22:24:22 -05:00
yuuji.yaginuma
af3eb5961e follow up to #18074
* ignore mailer suffix when generate test files
* add mailer suffix to view files
2015-01-08 22:21:54 +09:00
Dieter Komendera
99e57a8dcc Use SCHEMA instead of DB_STRUCTURE for specifiying structure file.
`rake test:load_structure` already uses `SCHEMA` and there's no
need to maintain two different env vars.
2015-01-08 10:02:58 +01:00
Carlos Souza
5697bdbb6d Add mailer suffix to generated files and classes
Following the same naming convention used in
controllers and jobs.
2015-01-06 10:46:22 -05:00
Rafael Mendonça França
93559da482 Remove debugger support
bebugger doesn't work with Ruby 2.2 so we don't need to support it
anymore
2015-01-04 15:54:22 -03:00
Rafael Mendonça França
463b5d7581 Remove deprecated serve_static_assets configuration 2015-01-04 12:11:02 -03:00
Rafael Mendonça França
c2e865849b Remove deprecation warning when log_level is not explicit set on production 2015-01-04 12:11:02 -03:00
Rafael Mendonça França
a939506f29 Change the default null value for timestamps to false 2015-01-04 11:58:43 -03:00
Rafael Mendonça França
d282125a18 Remove deprecate *_path helpers in email views 2015-01-04 11:58:42 -03:00
Rafael Mendonça França
481e49c64f Remove deprecated methods at Kernel.
`silence_stderr`, `silence_stream`, `capture` and `quietly`.
2015-01-04 11:58:40 -03:00
Carlos Antonio da Silva
217e5f6e4a Improve the matches on the scaffold generator tests
Related to #13434.
2015-01-03 20:30:31 -02:00
Carlos Antonio da Silva
1468a11f9b Merge pull request #13434 from tanraya/local_variables
Use local variables in _form.html.erb generated by scaffold.

Conflicts:
	railties/CHANGELOG.md
2015-01-03 20:20:05 -02:00
Rafael Mendonça França
4591b0fc04 Merge pull request #17227 from claudiob/explicitly-abort-callbacks
Introduce explicit way of halting callback chains by throwing :abort. Deprecate current implicit behavior of halting callback chains by returning `false` in apps ported to Rails 5.0. Completely remove that behavior in brand new Rails 5.0 apps.

Conflicts:
	railties/CHANGELOG.md
2015-01-03 17:22:20 -03:00
Rafael Mendonça França
900758145d Remove some warnings 2015-01-03 17:17:47 -03:00