aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators.rb
Commit message (Collapse)AuthorAgeFilesLines
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+1
|
* applies new string literal convention in railties/libXavier Noria2016-08-061-34/+34
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* generate mailer views in Rails APIyuuji.yaginuma2016-02-151-1/+5
| | | | | View files is necessary to send mail, it should be generated even Rails API. Fixes #23617
* do not show Active Job test generatoryuuji.yaginuma2015-11-141-0/+1
| | | | | Like the other generator, for also Active Job, I think that there is no need to display for test generator.
* Fix strange messages for `rails g foo`FUJI Goro (gfx)2015-09-071-1/+1
|
* Document Generators.api_only! methodSantiago Pastorino2015-06-111-0/+4
|
* Api apps scaffold does not generate assetsSantiago Pastorino2015-06-111-0/+1
|
* Api apps scaffold does not generate helpersSantiago Pastorino2015-06-111-0/+1
|
* Api apps scaffold does not generate viewsSantiago Pastorino2015-06-111-1/+2
|
* config.generators.api_only = true set rails api option on generatorsSantiago Pastorino2015-06-111-0/+4
|
* Hide assets, helper, css and js namespaces for api only appsSantiago Pastorino2015-06-111-0/+5
|
* rails new --api generates an api app skeletonSantiago Pastorino2015-06-111-0/+1
|
* add option to avoid generating scaffold.cssmasarakki2015-06-091-0/+2
|
* Speed up Levenshtein by 50% and reduce 97% of memory usageYuki Nishijima2015-04-111-2/+5
| | | | | | | | | | | | | | | | Calculating ------------------------------------- each_char 924.000 i/100ms each_codepoint 1.381k i/100ms ------------------------------------------------- each_char 9.320k (¡Þ 5.1%) i/s - 47.124k each_codepoint 13.857k (¡Þ 3.6%) i/s - 70.431k Comparison: each_codepoint: 13857.4 i/s each_char: 9319.5 i/s - 1.49x slower The full report can be found here: https://gist.github.com/yuki24/a80988f35aceac76f1d5
* Merge pull request #18395 from shunsukeaida/improve_generator_name_suggestionsRichard Schneeman2015-02-231-3/+1
|\ | | | | Improve generator name suggestions a bit.
| * Improve generator name suggestions a bit.ShunsukeAida2015-02-221-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the Levenshtein distances to most commands were wrongly calculated due to a big shortcut. This might be included in the original code for the performance sake, but I'm not sure that's something we should take over accuracy in Rails. Before 'foo' to 'assets' #=> 3 'foo' to 'controller' #=> 3 'foo' to 'generator' #=> 3 'foo' to 'helper' #=> 3 'foo' to 'integration_test' #=> 3 'foo' to 'jbuilder' #=> 3 'foo' to 'job' #=> 2 'foo' to 'mailer' #=> 3 'foo' to 'migration' #=> 3 'foo' to 'model' #=> 3 'foo' to 'resource' #=> 3 'foo' to 'resource_route' #=> 3 'foo' to 'scaffold' #=> 3 'foo' to 'scaffold_controller' #=> 3 'foo' to 'task' #=> 4 'foo' to 'active_record:migration' #=> 3 'foo' to 'active_record:model' #=> 3 'foo' to 'coffee:assets' #=> 3 'foo' to 'css:assets' #=> 3 'foo' to 'css:scaffold' #=> 3 'foo' to 'erb:controller' #=> 3 'foo' to 'erb:mailer' #=> 3 'foo' to 'erb:scaffold' #=> 3 'foo' to 'js:assets' #=> 3 'foo' to 'scss:assets' #=> 3 'foo' to 'scss:scaffold' #=> 3 'foo' to 'test_unit:controller' #=> 3 'foo' to 'test_unit:generator' #=> 3 'foo' to 'test_unit:helper' #=> 3 'foo' to 'test_unit:integration' #=> 3 'foo' to 'test_unit:job' #=> 3 'foo' to 'test_unit:mailer' #=> 3 'foo' to 'test_unit:model' #=> 3 'foo' to 'test_unit:plugin' #=> 3 'foo' to 'test_unit:scaffold' #=> 3 After 'foo' to 'assets' #=> 6 'foo' to 'controller' #=> 8 'foo' to 'generator' #=> 8 'foo' to 'helper' #=> 6 'foo' to 'integration_test' #=> 15 'foo' to 'jbuilder' #=> 8 'foo' to 'job' #=> 2 'foo' to 'mailer' #=> 6 'foo' to 'migration' #=> 8 'foo' to 'model' #=> 4 'foo' to 'resource' #=> 7 'foo' to 'resource_route' #=> 12 'foo' to 'scaffold' #=> 6 'foo' to 'scaffold_controller' #=> 16 'foo' to 'task' #=> 4 'foo' to 'active_record:migration' #=> 21 'foo' to 'active_record:model' #=> 17 'foo' to 'coffee:assets' #=> 12 'foo' to 'css:assets' #=> 10 'foo' to 'css:scaffold' #=> 10 'foo' to 'erb:controller' #=> 12 'foo' to 'erb:mailer' #=> 10 'foo' to 'erb:scaffold' #=> 10 'foo' to 'js:assets' #=> 9 'foo' to 'scss:assets' #=> 11 'foo' to 'scss:scaffold' #=> 11 'foo' to 'test_unit:controller' #=> 18 'foo' to 'test_unit:generator' #=> 18 'foo' to 'test_unit:helper' #=> 16 'foo' to 'test_unit:integration' #=> 20 'foo' to 'test_unit:job' #=> 12 'foo' to 'test_unit:mailer' #=> 16 'foo' to 'test_unit:model' #=> 14 'foo' to 'test_unit:plugin' #=> 16 'foo' to 'test_unit:scaffold' #=> 16 Besides that, the conjunction "or" of the message now appears only between the last two suggestions.
* | Small enhancement for generatorsHolger Frohloff2015-02-031-2/+2
|/ | | | | Changes a call to #map and a subsequent call to #flatten to the more idiomatic version of #flat_map. This commit also removes an unnessecary return statement.
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-2/+2
|
* Emit suggested generator names when not foundschneems2014-06-041-8/+52
| | | | | | | | | | | | | | | 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.
* Merge branch 'master' of github.com:rails/docrailsVijay Dev2014-06-011-0/+5
|\
| * document generators hidden_namespacesschneems2014-05-291-0/+5
| |
* | print generators on failed generateschneems2014-05-261-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's say we just ran: ``` $ rails g migrate add_click_to_issue_assignment ``` We will get an error that looks like: ``` Could not find generator migrate. ``` This patch adds all existing migrations to the output to make it easier for a developer to find a valid migration. ``` Could not find generator "migrate". Please select a valid generator: Rails: assets controller generator helper integration_test mailer migration model resource scaffold scaffold_controller task ``` It would be nice to do some spelling detection and suggest alternatives, but for now this should help.
* | Revert "Merge pull request #15293 from ↵Yves Senn2014-05-241-16/+12
| | | | | | | | | | | | | | | | | | | | | | schneems/schneems/generator-output-in-error" This reverts commit 7466d6a9f989a1a8f90899b79b34f1152e440b7c, reversing changes made to b850c4c540e8f0c15742f67c532f521a4a123655. This was an accidental merge. A new PR will follow. /cc @schneems
* | print generators on failed generateschneems2014-05-241-12/+16
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's say we just ran: ``` $ rails g migrate add_click_to_issue_assignment ``` We will get an error that looks like: ``` Could not find generator migrate. ``` This patch adds all existing migrations to the output to make it easier for a developer to find a valid migration. ``` Could not find generator "migrate". Please select a valid generator: Rails: assets controller generator helper integration_test mailer migration model resource scaffold scaffold_controller task ``` It would be nice to do some spelling detection and suggest alternatives, but for now this should help.
* Require the top file and autoload Base classRafael Mendonça França2013-11-091-0/+1
| | | | | | | The generators entry point file is rails/generators so we need to make sure uers will be able to use the generators when requiring that file. Fixes #12802
* Remove "circular require considered harmful" errorRobin Dupret2013-11-011-2/+2
| | | | | rails/generators should not load rails/generators/base since the latter is loading it.
* s/plugin_new/pluginschneems2013-06-301-1/+1
| | | | | There are historical reasons that the `plugin` command was `plugin_new`, now those are no longer applicable, we should remove the naming edge case from the project. This PR is based off of comments from #11176 ATP Railties
* remove performance tests from the default stackYves Senn2013-01-101-2/+0
|
* Remove observers and sweepersRafael Mendonça França2012-11-281-2/+0
| | | | | | | | They was extracted from a plugin. See https://github.com/rails/rails-observers [Rafael Mendonça França + Steve Klabnik]
* Use Ruby 1.9 Hash syntax in railtiesRobin Dupret2012-10-141-29/+29
|
* Extract ActiveRecord::SessionStore from RailsPrem Sichanugrist2012-08-241-1/+0
| | | | | This functionality will be available from gem `active_record-session_store` instead.
* Removing ==Examples and last blank lines of docs from railtiesFrancesco Rodriguez2012-05-141-4/+0
|
* Add hook for add_resource_routeSantiago Pastorino2012-04-181-0/+2
|
* Remove --http.José Valim2012-03-141-22/+1
|
* Generate special controller and functional test templates for http appsCarlos Antonio da Silva2012-03-141-0/+2
| | | | | | | | | | | | The main goal is to not generate the format.html block in scaffold controller, and to generate a different functional test as we don't rely on redirects anymore, we should test for http responses. In addition to that, the :edit action is removed from the http controller and the edit route is not generated by default, as they usually do not make sense in this scenario. [Carlos Antonio da Silva & Santiago Pastorino]
* Allow generator configs from http_only! to be overriden by appCarlos Antonio da Silva2012-03-141-1/+1
| | | | [Carlos Antonio da Silva & Santiago Pastorino]
* Disable template, helper and assets options when using http_only!Carlos Antonio da Silva2012-03-141-1/+14
| | | | [Carlos Antonio da Silva & Santiago Pastorino]
* Create generators http_only! setup and hide some common namespaces for nowCarlos Antonio da Silva2012-03-141-1/+7
| | | | [Carlos Antonio da Silva & Santiago Pastorino]
* Rails::Plugin has goneSantiago Pastorino2012-01-031-11/+0
|
* Revert the serializers API as other alternatives are now also under discussionJosé Valim2011-11-251-3/+1
|
* Add a hook for serializers in the scaffold generator (off for now).José Valim2011-11-251-1/+3
|
* fix ambiguous * and remove unused variableAaron Patterson2011-08-241-2/+2
|
* Move Coffee generators and templates to Coffee Railtie and create ↵Santiago Pastorino2011-06-291-1/+1
| | | | javascript_engine ("js") for apps that remove Coffee gem
* Removed rescue branch for Rails 2.x compatibilityAlexey Gaziev2011-06-201-3/+0
|
* Fix regexp in generators for right catching error messageAlexey Gaziev2011-06-201-1/+1
|
* Use mattr_accessor :namespaceStefan Sprenger2011-06-071-10/+2
|
* Use namespace if it's a mountable engineStefan Sprenger2011-06-071-0/+10
|
* Streamline generators initialization flow.José Valim2011-05-251-11/+1
|
* Hide css:* and the default stylesheet from rails gwycats2011-05-241-1/+6
|
* Update generator config to support hiding namespaces and pass the app into ↵wycats2011-05-241-0/+1
| | | | generator blocks