Commit Graph

327 Commits

Author SHA1 Message Date
Roque Pinel
e2b3ccd1aa Refactor AS::Callbacks halt config and fix the documentation
Move from `AS::Callbacks::CallbackChain.halt_and_display_warning_on_return_false`
to `AS::Callbacks.halt_and_display_warning_on_return_false` base on
[this
discussion](https://github.com/rails/rails/pull/21218#discussion_r39354580)

Fix the documentation broken by 0a120a818d413c64ff9867125f0b03788fc306f8
2015-10-01 13:04:20 -04:00
Kasper Timm Hansen
2310fb9d81 Add fail fast to test runner.
Passing `--fail-fast` to the test runner will now abort the test run
on the first failure. The run continues on any unexpected errors.
2015-09-29 08:37:33 +02:00
Kasper Timm Hansen
64a3b09b40 Add inline failure reporting to test runner.
Any failures or errors will be reported inline during the run by default.
Skipped tests will be reported if run in verbose mode.

Any result is output with failure messages and a rerun snippet for that test.

Rerun snippets won't be output after a run, unless `--defer-output` is passed.
2015-09-28 20:30:03 +02:00
Wojciech Wnętrzak
472358d030 Fix displaying mailer previews on non local requests.
When config `action_mailer.show_previews` is set, previews are displayed
regardless of local request check.
2015-09-17 15:57:09 +02:00
David Cornu
306c14c411 Use the PORT environment variable for rails server 2015-08-18 08:43:11 -04:00
Daniel Morris
c3a9e97f84 Plugins are generated with the version 0.1.0
The semantic versioning specification uses MAJOR.MINOR.PATCH – it would
make more sense to set the version to 0.1.0 for initial development
since a patch release cannot be created before a minor feature release.
2015-08-16 23:22:15 +01:00
Robin Dupret
cbca29a959 Add a changelog entry for #21124 [ci skip]
[Kir Shatrov & Robin Dupret]
2015-08-16 14:42:09 +02:00
Mehmet Emin İNAÇ
c7375fd162 Added bin/update script to update application automatically
use system!

fix changelog

use bundle check first and use rake

use system instead system! for bundle check
2015-08-07 04:01:34 +03:00
Ersin Akinci
38f28f7704 Only load statistics.rake once from inside engine
When running rake stats from inside an engine,
the engine's Rakefile attempts to reload
statistics.rake after the test app loads it, which
results in STATS_DIRECTORIES being redefined and
an annoying warning. This patch skips loading
statistics.rake from tasks.rb if rake's current
scope isn't empty, i.e. if we are running from
inside an engine and not the test app dir or a
normal app.

Fixes #20510.
2015-08-06 17:34:29 -03:00
Chuck Callebs
a01e58afd9 Add rake dev:cache task to enable dev mode caching.
Taken from @Sonopa's commits on PR #19091.

Add support for dev caching via "rails s" flags.

Implement suggestions from @kaspth.

Remove temporary cache file if server does not have flags.

Break at 80 characters in railties/CHANGELOG.md

Remove ability to disable cache based on server options.

Add more comprehensive options: --dev-caching / --no-dev-caching
2015-08-04 23:41:23 -04:00
Robin Dupret
9a7f011da1 Add the --api option for the plugin generator 2015-07-23 18:13:00 +02:00
Yves Senn
3cd0530df6 Merge pull request #20724 from y-yagi/fix_scaffold_in_full_engine
fix NoMethodError that occurs when generating scaffold inside full mode engine
2015-06-29 14:23:26 +02:00
yuuji.yaginuma
b1738e1a02 fix NoMethodError that occurs when generating scaffold inside full mode engine 2015-06-28 18:16:01 +09:00
Hirofumi Wakasugi
e6be33f1dd cherry-pick test and source doc from #20050 2015-06-25 15:25:49 +09:00
Yves Senn
e97b8cb15f Merge pull request #20605 from dcrec1/assert_file
assert_file understands paths with special characters
2015-06-19 11:25:03 +02:00
Aaron Patterson
56903585a0 Remove ContentLength middleware from the defaults.
ContentLength is not part of the rack SPEC since rack/rack@86ddc7a6ec
If you want it, just add it as a middleware in your config.
2015-06-17 16:18:43 -07:00
Yves Senn
2e59604909 make it possible to customize the executable inside rereun snippets.
In the Rails repository we use a `bin/test` executable to run our tests.
However the rerun snippets still included `bin/rails test`:

BEFORE:
```
Failed tests:

bin/rails test test/cases/adapters/postgresql/schema_test.rb:91
```

AFTER:
```
Failed tests:

bin/test test/cases/adapters/postgresql/schema_test.rb:91
```
2015-06-13 11:58:43 +02:00
Santiago Pastorino
f3df21649a Add CHANGELOG entries for API apps functionality 2015-06-11 16:54:15 -03:00
Yves Senn
939d5a4932 Merge pull request #20387 from y-yagi/fix_engine_generated_controller_test
set engine's route in the functional test is generated in the engine
2015-06-02 16:20:40 +02:00
Yoong Kang Lim
f06ce4c12a Generate a .keep file in tmp folder
A lot of scripts assumes the existence of this folder and most would fail if it
is absent.

One example of this is `rake restart` (before the previous commit) – it tries to
`touch tmp/restart.txt`, which would fail if `tmp` does not exist, which was the
case for a freshly-cloned project as `tmp` is `.gitignored` by default.

See #20299.

[Yoong Kang Lim, Sunny Juneja]
2015-05-30 00:44:12 -07:00
Eliot Sykes
3ff39494cd config.static_index configures directory index "index.html" filename
Set `config.static_index` to serve a static directory index file not
named `index`. For example, to serve `main.html` instead of `index.html`
for directory requests, set `config.static_index` to `"main"`.
2015-05-28 09:41:00 +01:00
Yves Senn
a64d47ff04 Merge pull request #20023 from mohnish/patch-1
Use the built-in rake tasks
2015-05-06 10:00:01 +02:00
Andrew White
350d272d6c Fix mailer previews with attachments
Use the mail gem's own API to locate the correct part.

Fixes #14435.
2015-05-04 10:54:50 +01:00
Yves Senn
4e6f0053db Merge pull request #19949 from thiagoaugusto/create-thiago-punctuation-fix
CHANGELOG punctuation fix
2015-04-29 09:01:44 +02:00
Thiago Augusto
88f429c83f CHANGELOG punctuation fix
Punctuation fix
2015-04-29 00:42:47 -03:00
Andrew White
688c0ec264 Remove sqlite support from rails dbconsole
Support for versions of SQLite less than 3 was removed in #6011 as part
of the Rails 4.0 release. Therefore there is no need to have support for
it in the `rails dbconsole` command anymore.
2015-04-22 14:47:13 -04:00
Yves Senn
cdbf685994 pass over CHANGELOGs. [ci skip] 2015-04-22 14:44:30 +02:00
Jon Atack
6345f31fbf Fix typos and improve the documentation
This is a squash of the following commits, from first to last:

-

Fix minor, random things I’ve come across lately that individually
did not seem worth making a PR for, so I saved them for one commit.

One common error is using “it’s” (which is an abbreviation of “it is”)
when the possessive “its” should be used for indicating possession.

-

Changes include the name of a test, so remove the `[skip ci]` (thanks @senny).

-

Line wrap the changes at 80 chars and add one more doc fix.

-

Add a missing line wrap in the Contributing to Ruby on Rails Guide.

-

Line wrap the `TIP` section in the Contributing to Ruby on Rails Guide as well.

Rendering the guide locally with `bundle exec rake guides:generate` did
not show any change in on-screen formatting after adding the line wrap.

The HTML generated is (extra line added to illustrate where the line
wrap takes place):

    <div class="info"><p>Please squash your commits into a single commit
when appropriate. This

    simplifies future cherry picks and also keeps the git log
clean.</p></div>

-

Squash commits.
2015-04-15 16:25:24 +05:30
Zachary Scott
08a3baa380 ✂️ 2015-04-12 13:20:34 -07:00
Islam Wazery
4521aadae0 Rename railties/bin to railties/exe
That will match the new Bundler executables convention.
Bundler Blog Post: http://bundler.io/blog/2015/03/20/moving-bins-to-exe.html
Also updated the necessary tests.
2015-04-11 19:26:34 +02:00
Matthew Draper
faa37c7652 Merge pull request #19429 from mxhold/print_bundle_install_output_line_by_line
Print `bundle install` output in `rails new` as soon as it's available
2015-04-03 23:07:55 +10:30
Max Holder
2a5bb9d56e Print bundle install output in rails new as soon as it's available
Previously, running `rails new` would not print any of the output from
`bundle install` until all the gems had finished installing. This made
it look like the generator was hanging at the `bundle install` step.

This commit switches to using `system` so that the bundle command can
output as it needs to.

This has the added benefit of including output bundler produces on
standard error, which the previous code ignored since backticks only
capture standard out. This is not a big deal right now since bundler
does not currently print errors to standard error, but that may change
in the future (see: bundler/bundler/issues/3353).
2015-03-28 09:16:13 -04:00
Prathamesh Sonpatki
b2a70e33e3 Improve CHANGELOG for fix for respecting pluralize_table_names [ci skip] 2015-03-27 22:12:52 +05:30
yuuji.yaginuma
71c7c68e2d respect pluralize_table_names when generate fixture file. fixes #19519 2015-03-27 17:30:43 +09:00
Prathamesh Sonpatki
d16fa517e1 Fix typo in belongs_to_required_by_default config's CHANGELOG entry [ci skip] 2015-03-22 11:48:18 +05:30
Godfrey Chan
9e80c29cd5 rake initializer -> rake initializers
Also edited the copy to be more consistent with `rake routes`.

See #19323.
2015-03-20 15:51:01 -07:00
Jeremy Kemper
a4e7a6f9d6 Revert "Merge pull request #19411 from dmathieu/rack_env_changelog"
Preserving RACK_ENV behavior.

This reverts commit b19990c82c6a9beff0cd058dc2ff67894a2f9ea7, reversing
changes made to ac291b76ea770b5795c767f2f74a8d0b33744809.
2015-03-20 08:13:48 -07:00
Damien Mathieu
cbadeeb969 add changelog entry for removing the fallback to rack_env
[ci skip]
2015-03-19 16:04:49 +01:00
Arthur Neves
2f23f97b2e Add a new-line to the end of route method generated code.
Fix regression on route method that was added by
bac812a7ef2660a2fe2ab00822e5e66228379822. The regression was that when
calling the `route` method, we were not appending a \n anymore.

[fixes #19316]
2015-03-18 10:33:59 -04:00
Naoto Kaneko
baa9ffb822 Add rake initializer
This task prints out initializers for an application. It is useful to
develop a rubygem which involves the initialization process.
2015-03-14 01:41:21 +09:00
Jeremy Kemper
d31c941413 Revert "Merge pull request #15476 from JacobEvelyn/master"
This introduces undesirable `Rails.logger` formatters (such as the syslog
formatter) onto a `Logger.new(STDERR)` for the console. The production
logger may be going elsewhere than standard io, so we can't presume to
reuse its formatter.

With syslog, this causes missing newlines in the console, so irb prompts
start at the end of the last log message.

We can work to expose the console formatter in another way to address
the original issue.

This reverts commit 026ce5ddf11c4cda0aae7f33a9266e54117db318, reversing
changes made to 6f0a69c5899ebdc892e2aa23e68e2604fa70fb73.
2015-03-11 15:06:42 -07:00
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
Rafael Mendonça França
026ce5ddf1 Merge pull request #15476 from JacobEvelyn/master
Use logger environment settings in Rails console.
2015-02-25 19:52:19 -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
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
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
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
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