Commit Graph

225 Commits

Author SHA1 Message Date
Rafael Mendonça França
1056589580 Add a generic --skip-gems options to generator
Also remove --skip-turbolinks.

This option is useful if users want to remove some gems like jbuilder,
turbolinks, coffee-rails, etc that don't have specific options on the
generator.

    rails new my_app --skip-gems turbolinks coffee-rails
2014-06-17 20:35:09 -03:00
schneems
72f45ba292 Emit suggested generator names when not found
When someone types in a generator command it currently outputs all generators. Instead we can attempt to find a subtle mis-spelling by running all generator names through a levenshtein_distance algorithm provided by rubygems. 

So now a failure looks like this:

```ruby
$ rails generate migratioooons
Could not find generator 'migratioooons'. Maybe you meant 'migration' or 'integration_test' or 'generator'
Run `rails generate --help` for more options.
```

If the suggestions are bad we leave the user with the hint to run `rails generate --help` to see all commands.
2014-06-04 16:28:43 -05:00
Yves Senn
7ba6b75910 bin/setup script to bootstrap applications. 2014-05-30 11:15:56 +02:00
Yves Senn
99873ca1ea Revert "Merge pull request #12778 from etehtsea/rake-default-fix"
This reverts commit ec0a2b57f67c9153cb5f7bbe2a3f66d13fe64bdd, reversing
changes made to a8bd7b16260c217290ef8fe3a166fcceac442c62.

This reverts commit 555ec36522011862c03b483c53be32410594a51e

This reverts commit 555ec36522011862c03b483c53be32410594a51e

By default, Rails uses the `default` Rake task to run all tests.
This commit changed the environment of the default task to `development`.
This clears the development database and has other negative consequences.
2014-05-28 17:43:45 +02:00
alexbel
6aaf4bff18 Replace double quotes with single quotes while adding an entry into Gemfile 2014-05-26 19:08:03 -04:00
Zachary Scott
1d7b3fa84c Future port c8ddb61 2014-05-23 14:45:21 -07:00
Dan Kang
f369bcf9a0 Default config.assets.digests to true in development 2014-05-17 23:01:22 -04:00
Pier-Olivier Thibault
d14fab04ff Use Rails::Paths::Path#existent in database_configuration
Database configuration was trying to load the first path that
config.paths['config/database'] was returning even if the path didn't
exist in the filesystem.

Because Rails::Paths::Path has the possibility to return more than 1
path (as an array), database_configuration should filter down the paths
to the existing one and then load the first one.

This would make it possible to move the database.yml file and add the
new path to paths['config/database'] and still load the configurations.
2014-05-07 18:18:00 -04:00
Arun Agrawal
c694c8e25c skip-git should not hit git commands plugin generators 2014-05-02 15:38:58 +02:00
Rafael Mendonça França
43f525031a Make console and generators blocks works at Application instance level
Like rake tasks and runner blocks these blocks should also being shared
between applications since they are stored at the classes.

Fixes #14748
2014-04-14 18:59:47 -03:00
Matthew Draper
f612c2b052 Move assets precompile (and version) to an initializer
sprockets-rails 2.1 needs the precompile list to be available in all
environments.
2014-04-11 22:47:54 +09:30
Rafael Mendonça França
555ec36522 Add CHANGELOG entry for #12778 [ci skip] 2014-03-28 12:28:28 -03:00
Dmitrii Golub
f42c7eee7e Remove sqlite3 lines from .gitignore if the application is not using sqlite3. 2014-03-24 14:53:38 +04:00
robertomiranda
8eac0a6b58 Add Changelog Entry ref #14379 2014-03-17 09:06:00 -05:00
Arun Agrawal
9e61a14d4b Removed unnecessary command "application" 2014-03-10 23:23:12 +01:00
Robin Dupret
9c53b8b89f Make the rails:template rake task load initializers
Templates could rely on irregular inflections or external libraries for
instance so we should load the application's initializers when running
the rails:template task.

The introducing commit of this feature is f7f11361 ; the initializers
have never been loaded invoking this task.

Fixes #12133.
2014-03-08 15:59:22 +01:00
Prem Sichanugrist
2dd2fcf896
Introduce Rails.gem_version
This method return `Gem::Version.new(Rails.version)`, suggesting a more
reliable way to perform version comparison.

Example:

    Rails.version #=> "4.1.2"
    Rails.gem_version #=> #<Gem::Version "4.1.2">

    Rails.version > "4.1.10" #=> false
    Rails.gem_version > Gem::Version.new("4.1.10") #=> true
    Gem::Requirement.new("~> 4.1.2") =~ Rails.gem_version #=> true

This was originally introduced as `.version` by @charliesome in #8501
but got reverted in #10002 since it was not backward compatible.

Also, updating template for `rake update_versions`.
2014-03-05 12:37:38 -05:00
Robin Dupret
fc61bca31d Avoid namespacing routes inside engines
Since #11544, invoking the controller generator, any generated route is
namespaced according to the class_path method. Since a mountable plugin
is namespaced, creating a controller inside would generate a namespaced
route based on the engine's name.

The controller generator now relies on regular_class_path which does not
contain the class hierarchy but the given path.

Fixes #14079.
2014-02-26 16:06:11 +01:00
Carlos Antonio da Silva
71b3910a7d Point master changelogs to 4-1-stable branch
Remove 4-1 related entries from master [ci skip]
2014-02-25 09:14:36 -03:00
Guillermo Iguaran
b1867c85fa Revert "Only lookup config.log_level for stdlib ::Logger. Closes #11665."
This reverts commit e0a521cfcd13e4d1f0ae8ab96004289e1c020f71.

Conflicts:
	railties/CHANGELOG.md

We expect loggers to quack like stdlib logger. If log4r needs different
level= assignment, using a Logger-quacking wrapper is the way to do it.

Fixes #14114.
2014-02-21 09:50:19 -05:00
Yves Senn
37e30d2548 do not crash when config/secrets.yml is blank. 2014-02-12 17:17:00 +01:00
Xavier Noria
c0fb8d0b9c Merge branch 'dump-schema-after-migration-flag' of git://github.com/emilsoman/rails into emilsoman-dump-schema-after-migration-flag
Conflicts:
	activerecord/CHANGELOG.md
2014-02-06 15:03:20 +01:00
Emil Soman
8806768e9f Add config to disable schema dump after migration
* Add a config on Active Record named `dump_schema_after_migration`
* Schema dump doesn't happen if the config is set to false
* Set default value of the config to true
* Set config in generated production environment file to false
* Update configuration guide
* Update CHANGELOG
2014-02-06 17:38:31 +05:30
Yves Senn
580f0b61dc synchronize 4.1 release notes with CHANGELOGS. [ci skip]
/cc @chancancode
2014-02-06 11:43:16 +01:00
Gert Goet
3858a247bd Add CreateMigration action
This Thor-action isolates the logic whether to (over-)write migration and
what is shown to the user. It's modelled after Thor's CreateFile-action.

This solves the issue that removing a non-existing migration, tried to
remove the template-path (#13588).

Related issues: #12674
2014-01-28 00:01:19 +01:00
Robin Dupret
fe63933cee Add a missing changelog entry for #13825 [ci skip] 2014-01-25 22:12:28 +01:00
robertomiranda
7671590fe2 Update Changelog, Spring is under rails/spring [ci skip] 2014-01-19 08:50:15 -05:00
Carlos Antonio da Silva
1c88b363a3 Unify changelog entries about single quotes [ci skip] 2014-01-15 19:26:00 -02:00
Chulki Lee
1ab6c656d6 Use single quotes in generated files 2014-01-14 11:13:42 -08:00
Cristian Mircea Messel
9cdc7c0614 single quotes for controller generated routes
Write routes in route.rb with single quotes

    get 'welcome/index'

instead of

    get "welcome/index"
2014-01-14 09:31:51 +02:00
Yves Senn
e0a521cfcd Only lookup config.log_level for stdlib ::Logger. Closes #11665.
This prevents Rails from assigning meaningless log levels to third
party loggers like log4r. If `Rails.logger` is not `kind_of?(::Logger)`
we simply assign the `config.log_level` as is.

This bug was introduced by #11665.
2014-01-13 19:00:45 +01:00
Xavier Noria
db11682c2b fixes a typo in a CHANGELOG 2014-01-12 22:24:28 +01:00
Xavier Noria
6049249c6c upgrade SDoc
Kudos to @zzak for taking over SDoc and make it work with RDoc 4.
2014-01-12 22:18:44 +01:00
Jon Leighton
ff7ab3bc78 Automatically maintain test database schema
* Move check from generated helper to test_help.rb, so that all
  applications can benefit
* Rather than just raising when the test schema has pending migrations,
  try to load in the schema and only raise if there are pending
  migrations afterwards
* Opt out of the check by setting
  config.active_record.maintain_test_schema = false
* Deprecate db:test:* tasks. The test helper is now fully responsible
  for maintaining the test schema, so we don't need rake tasks for this.
  This is also a speed improvement since we're no longer reloading the
  test database on every call to "rake test".
2014-01-02 13:49:00 +00:00
José Valim
2d4cfb2840 Update CHANGELOG [ci skip] 2013-12-23 20:34:11 +01:00
Robin Dupret
d39db9da1a Add a changelog entry for #13326 [ci skip] 2013-12-21 14:49:16 +01:00
Kassio Borges
02c814c992 html and text templates for mailers by default 2013-12-20 18:34:57 -02:00
Rafael Mendonça França
bfdae1775a Make possible to use symbol as the verifier name 2013-12-19 17:06:40 -02:00
Rafael Mendonça França
61f6b47204 Change the message verifier argument to verifier_name 2013-12-19 17:05:22 -02:00
Guillermo Iguaran
83e4dde41a Add changelog entries about secrets.yml and secrets.secret_key_base 2013-12-17 12:40:13 -05:00
Huiming Teo
971d5107cd fixed rails dbconsole to support ENV['DATABASE_URL']. 2013-12-16 18:31:49 +08:00
Yves Senn
64c784f553 end sentences with a .. [ci skip] 2013-12-05 11:33:12 +01:00
Rafael Mendonça França
48c703b055 Make salt argument required for message verifier 2013-12-04 23:11:42 -02:00
Rafael Mendonça França
d3d8498867 Fix typos 2013-12-04 22:56:48 -02:00
Rafael Mendonça França
f98bd42854 No need to configure salts 2013-12-04 22:56:48 -02:00
Rafael Mendonça França
2be4916e8e Make possibile to get different message verifiers 2013-12-04 22:56:47 -02:00
Rafael Mendonça França
609c217628 Rename verifier to message_verifier 2013-12-04 22:56:47 -02:00
Rafael Mendonça França
69ac53cfec Add documentation and CHANGELOG entry to Application#verifier 2013-12-04 22:56:47 -02:00
Jon Leighton
df50e3064a Install Spring preloader when generating new applications 2013-12-03 23:07:40 +00:00
Prathamesh Sonpatki
4816fdd385 Use .railsrc while creating new plugin if available
- Fixes #10700
2013-12-01 20:47:15 +05:30