diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-08-11 17:44:21 -0400 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-08-11 17:44:21 -0400 |
commit | 701ab978e5967d832a1688f0c7308e7987596cbc (patch) | |
tree | bbffcbcf83e6a4917ebc3ea96eee7a2d4eb1ffea /railties | |
parent | 3090f8f0975bfcc7d0aeba178818091e482423d9 (diff) | |
parent | 59f93bbce79407c64636280dc9dfe1170f8b5078 (diff) | |
download | rails-701ab978e5967d832a1688f0c7308e7987596cbc.tar.gz rails-701ab978e5967d832a1688f0c7308e7987596cbc.tar.bz2 rails-701ab978e5967d832a1688f0c7308e7987596cbc.zip |
Merge pull request #30110 from yhirano55/add_git_source
Add git_source to Gemfile for plugin generator
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG.md | 4 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/plugin/templates/Gemfile | 1 | ||||
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 5 |
3 files changed, 10 insertions, 0 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index f9d6258b22..509b8d20e3 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,3 +1,7 @@ +* Add git_source to `Gemfile` for plugin generator. + + *Yoshiyuki Hirano* + * Add `--skip-action-cable` option to the plugin generator. *bogdanvlviv* diff --git a/railties/lib/rails/generators/rails/plugin/templates/Gemfile b/railties/lib/rails/generators/rails/plugin/templates/Gemfile index 22a4548ff2..290259b4db 100644 --- a/railties/lib/rails/generators/rails/plugin/templates/Gemfile +++ b/railties/lib/rails/generators/rails/plugin/templates/Gemfile @@ -1,4 +1,5 @@ source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } <% if options[:skip_gemspec] -%> <%= '# ' if options.dev? || options.edge? -%>gem 'rails', '<%= Array(rails_version_specifier).join("', '") %>' diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index cf581ce891..6637c329c8 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -82,6 +82,11 @@ class PluginGeneratorTest < Rails::Generators::TestCase assert_file "test/integration/navigation_test.rb", /ActionDispatch::IntegrationTest/ end + def test_inclusion_of_git_source + run_generator [destination_root] + assert_file "Gemfile", /git_source/ + end + def test_inclusion_of_a_debugger run_generator [destination_root, "--full"] if defined?(JRUBY_VERSION) || RUBY_ENGINE == "rbx" |