aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/plugin_generator_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use canonical name for block localyuuji.yaginuma2018-09-071-3/+3
| | | | | | | | `spec` is the same variable name as gemspec generated by bundler, and its intention is easier to understand than a one-letter variable. https://github.com/bundler/bundler/blob/00fd58eaa69015092ee272c4cb5aa92a5e7ee45c/lib/bundler/templates/newgem/newgem.gemspec.tt#L11 This is follow up on 1c59b4840c58097186022f68427c46e0046c5d0d. `spec` is already in use there.
* Improve generated file `app/assets/javascripts/application.js` of pluginbogdanvlviv2018-02-231-1/+5
| | | | | | Add `//= require rails-ujs` Closes #32094
* Improve generated file `app/views/application.html.erb` of pluginbogdanvlviv2018-02-231-0/+9
| | | | | - Do not generate `javascript_include_tag` if `--skip-javascript` - Generate `<%= csp_meta_tag %>`. Related to #32018.
* Comment `require "active_storage/engine"` in `bin/rails` of plugin if ↵bogdanvlviv2018-02-231-1/+2
| | | | `--skip-active-storage`
* Deprecate an `after_bundle` callback in Rails plugin templatesyuuji.yaginuma2017-11-181-0/+32
| | | | | | | | | Since fbd1e98cf983572ca9884f17f933ffe92833632a, Rails plugin does not run `bundle install` when generating. Therefore, `after_bundle` callback is not actually executed after `bundle`. Since there is a difference between the name and the actual behavior, I think that should be remove.
* Merge pull request #30004 from npenzin/patch-1Yuji Yaginuma2017-11-151-1/+2
|\ | | | | Update plugin_generator.rb
| * Ensure plugin_generator adds to new line in GemfileNikita Penzin2017-11-141-1/+2
| | | | | | | | | | | | | | Ensure plugin_generator adds to new line in Gemfile, even if the Gemfile does not end with an empty line. [Lisa Ugray, Nikita Penzin]
* | Merge pull request #30770 from ↵Kasper Timm Hansen2017-11-121-0/+2
|\ \ | | | | | | | | | | | | y-yagi/do_not_create_credential_in_dummy_application Do not create credentials in dummy application
| * | Do not create credentials in dummy applicationyuuji.yaginuma2017-10-021-0/+2
| | | | | | | | | | | | | | | Because dummy application is only for use test, so credentials is unnecessary.
* | | Remove redundant passing --skip-active-storage in test casesbogdanvlviv2017-11-081-1/+1
| | | | | | | | | | | | These were added in #30101, after #31084 it became redundant.
* | | Add --skip-active-storage and do so automatically when --skip-active-record ↵bogdanvlviv2017-11-061-3/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | is used Closes #30102 Revert part 787fe90dc0a7c5b91bb5af51f2858ea8c4676268 --skip-active-storage pass throughs `rails plugin new` Add changelog entry about default initialization of Active Storage
* | Move common tests from `AppGeneratorTest` and `PluginGeneratorTest` to ↵bogdanvlviv2017-08-171-81/+0
| | | | | | | | `SharedGeneratorTests`
* | Add --skip-yarn option to the plugin generatorbogdanvlviv2017-08-151-0/+4
| | | | | | | | | | Add SharedGeneratorTests#application_path This method will help to DRY in files app_generator_test.rb, plugin_generator_test.rb
* | Adding frozen_string_literal pragma to Railties.Pat Allan2017-08-141-0/+2
| |
* | Merge pull request #30116 from ↵Rafael Mendonça França2017-08-111-1/+13
|\ \ | | | | | | | | | | | | | | | yhirano55/skip_unused_components_when_running_rails_command_in_plugin Skip unused components when running `bin/rails` in Rails plugin
| * | Skip unused components when running in Rails pluginYoshiyuki Hirano2017-08-091-1/+13
| | |
* | | Merge pull request #30110 from yhirano55/add_git_sourceRafael Mendonça França2017-08-111-0/+5
|\ \ \ | | | | | | | | | | | | Add git_source to Gemfile for plugin generator
| * | | Add git_source to Gemfile for plugin generatorYoshiyuki Hirano2017-08-091-0/+5
| |/ /
* | | `--skip-action-cable` pass throughs `rails plugin new`bogdanvlviv2017-08-101-0/+6
| | |
* | | Improve plugin generator tests. Related to #30123.bogdanvlviv2017-08-101-12/+44
| | | | | | | | | | | | | | | | | | | | | | | | Improve app generator tests. Ensure that generation `config/application.rb` is correct. Ensure that generation `config/application.rb` is correct.
* | | Merge pull request #30091 from yhirano55/fix_engine_commandRafael França2017-08-081-0/+4
|\ \ \ | | | | | | | | Fix engine command
| * | | Fix engine commandYoshiyuki Hirano2017-08-061-0/+4
| |/ /
* / / Fix escaped characterYoshiyuki Hirano2017-08-061-1/+1
|/ /
* | Include active_storage in all generated application.rb filesDavid Heinemeier Hansson2017-08-041-1/+2
| | | | | | | | And deal with a temporary test fix until we allow you to skip active storage.
* | Remove unnecessary `doc` directory deletionyuuji.yaginuma2017-08-011-1/+0
|/ | | | Since 553b695, `doc` directory is not created in application.
* Stop creating ApplicationRecord on model generationLisa Ugray2017-07-241-14/+0
| | | | | | | | | | | | | | When generating models, we created ApplicationRecord in the default location if no file existed there. That was annoying for people who moved it to somewhere else in the autoload path. At this point, the vast majority of apps should have either run the upgrade script or generated a model since upgrading. For those that haven't the error message after generating a new model should be helpful: NameError: uninitialized constant ApplicationRecord To ease friction in that case, this also adds a generator for ApplicationRecord.
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Add `railtie.rb` to the plugin generatorTsukuru Tanimichi2017-06-261-0/+2
|
* Use `require_relative` instead of `require` with full pathbogdanvlviv2017-06-141-3/+3
|
* Define path with __dir__bogdanvlviv2017-05-231-6/+6
| | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
* Should escape meta characters in regexpRyuta Kamizono2017-05-071-23/+23
|
* Add `app:update` task to enginesyuuji.yaginuma2017-03-201-0/+16
| | | | | | Occasionally we update the file generated by engine. Therefore, I think that there is a task for updating as well as application in the engine, it is convenient for updating.
* Merge pull request #28062 from ↵Rafael França2017-02-241-0/+15
|\ | | | | | | | | y-yagi/make_adding_gemfile_entry_work_even_if_specify_only_the_plugin_name Make adding gemfile entry work even if specify only the plugin name
| * Make adding gemfile entry work even if specify only the plugin nameyuuji.yaginuma2017-02-241-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Whether the command was executed within the rails application is checked by whether or not the application's path matches `app_path`. https://github.com/rails/rails/blob/5-0-stable/railties/lib/rails/generators/rails/plugin/plugin_generator.rb#L439..L441 Therefore, if only plugin name is specified in `app_path`, addition to Gemfile is not done. However, in the rails guide an example of specifying only plugin name is given, and it is considered that there are many cases where only plugin name is specified. For that reason, made it work even if only plugin name was specified.
* | Do not run `git init` in dummy applicationyuuji.yaginuma2017-02-181-0/+1
|/
* make all rails commands work in engineyuuji.yaginuma2017-01-091-0/+1
| | | | | | | | Currently, all rails commands can be executed in engine, but `server`, `console`, `dbconsole` and `runner` do not work. This make all rails commands work in engine. Related to #22588
* Privatize unneededly protected methods in Railties testsAkira Matsuda2016-12-241-1/+1
|
* Don't add jQuery by default in new apps and use rails-ujs as UJS adapter insteadGuillermo Iguaran2016-11-211-1/+0
|
* Add `:skip_sprockets` to `Rails::PluginBuilder::PASSTHROUGH_OPTIONS`Tsukuru Tanimichi2016-11-141-0/+8
| | | | | | | | | | | | `rails plugin new` with `--full` and `--skip-sprockets` options generates a dummy application that throws `NoMethodError`. ``` % rails plugin new my_engine -S --full --skip-gemspec % cd my_engine % bin/rails test rails aborted! NoMethodError: undefined method `assets' for #<Rails::Application::Configuration:0x007f83aa1e6100> ```
* fix broken generators testyuuji.yaginuma2016-09-141-1/+1
| | | | Follow up to 92703a9ea5d8b96f30e0b706b801c9185ef14f0e
* Add three new rubocop rulesRafael Mendonça França2016-08-161-6/+6
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* Add `Style/EmptyLines` in `.rubocop.yml` and remove extra empty linesRyuta Kamizono2016-08-071-1/+0
|
* applies new string literal convention in railties/testXavier Noria2016-08-061-46/+46
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Do not run `bundle install` when generating a new plugin.Rafael Mendonça França2016-07-011-40/+41
| | | | | | Since bundler 1.12.0, the gemspec is validated so the `bundle install` command will fail just after the gem is created causing confusion to the users. This change was a bug fix to correctly validate gemspecs.
* generate mailer layout files if it does not already existyuuji.yaginuma2016-05-151-0/+15
| | | | | | | | | Currently, if `ApplicationMailer` does not exist, it is generated when run the mailer generator, but layouts files does not generate. However, because it uses the layouts in `ApplicationMailer`, layouts are required. Follow up to #24161
* generate ApplicationJob if it does not already existyuuji.yaginuma2016-03-251-0/+13
| | | | | | ActiveJob jobs now inherit from ApplicationJob by default. However, when updating to Rails 5 from the old Rails, since there is a possibility that ApplicationJob does not exist.
* Correctly generate application_mailer.rb in mountable enginesPrathamesh Sonpatki2016-03-121-0/+13
| | | | - Followup of https://github.com/rails/rails/pull/24161.
* correctly check `ApplicationRecord` is exist in moutable engineyuuji.yaginuma2016-02-251-0/+14
| | | | Follow up to 1813b29fc7632959800252f36e4b2e6ed4ac7266
* set `skip_listen` option to dummy appplicationyuuji.yaginuma2016-02-181-0/+8
| | | | | | If you want to use `EventedFileUpdateChecker`, need to specify `listen` to plugin's gemspec. However, the default is not specified `listen` to plugin's gemspec, `EventedFileUpdateChecker` should be disabled.