diff options
author | Saverio Miroddi <saverio.pub2@gmail.com> | 2018-03-19 12:53:09 +0100 |
---|---|---|
committer | Saverio Miroddi <saverio.pub2@gmail.com> | 2018-03-19 12:53:09 +0100 |
commit | f5445525a6b142260209a3ee2b299a9c0c88e6a9 (patch) | |
tree | 740313d351b3a5be1ae1e88c5bca8f2845e4369e | |
parent | e0d65a54a51e04e6bdaece1dd99673ec194add13 (diff) | |
download | bundler-f5445525a6b142260209a3ee2b299a9c0c88e6a9.tar.gz |
Rename plugin install --file option to --local-git
-rw-r--r-- | lib/bundler/cli/plugin.rb | 4 | ||||
-rw-r--r-- | lib/bundler/plugin/installer.rb | 6 | ||||
-rw-r--r-- | spec/bundler/plugin/installer_spec.rb | 8 | ||||
-rw-r--r-- | spec/plugins/install_spec.rb | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/lib/bundler/cli/plugin.rb b/lib/bundler/cli/plugin.rb index ea50199843..3edbb68d8e 100644 --- a/lib/bundler/cli/plugin.rb +++ b/lib/bundler/cli/plugin.rb @@ -9,7 +9,7 @@ module Bundler - from rubygems (`--source` option) - from a remote git source (`--git` option) - - from a local git repo (`--file /path/to/repo` option) + - from a local git repo (`--local-git /path/to/repo` option) If no sources are provided, it uses Gem.sources. D @@ -19,7 +19,7 @@ module Bundler "The version of the plugin to fetch" method_option "git", :type => :string, :default => nil, :banner => "URL of the git repo to fetch from" - method_option "file", :type => :string, :default => nil, :banner => + method_option "local-git", :type => :string, :default => nil, :banner => "Path of the local git repo to fetch from" method_option "branch", :type => :string, :default => nil, :banner => "The git branch to checkout" diff --git a/lib/bundler/plugin/installer.rb b/lib/bundler/plugin/installer.rb index a22402f7a5..a112a0a0b0 100644 --- a/lib/bundler/plugin/installer.rb +++ b/lib/bundler/plugin/installer.rb @@ -19,7 +19,7 @@ module Bundler Bundler.settings.temporary(:lockfile_uses_separate_rubygems_sources => false, :disable_multisource => false) do if options[:git] install_git(names, version, options) - elsif options[:file] + elsif options[:'local-git'] install_local_git(names, version, options) else sources = options[:source] || Bundler.rubygems.sources @@ -44,7 +44,7 @@ module Bundler private def check_sources_consistency!(options) - if options[:git] && options[:file] + if options[:git] && options[:'local-git'] raise InvalidOption, "Remote and local plugin git sources can't be both specified" end end @@ -57,7 +57,7 @@ module Bundler end def install_local_git(names, version, options) - uri = options.delete(:file) + uri = options.delete(:'local-git') options["uri"] = uri install_all_sources(names, version, options, options[:source]) diff --git a/spec/bundler/plugin/installer_spec.rb b/spec/bundler/plugin/installer_spec.rb index 1dedc93209..cad3bc08db 100644 --- a/spec/bundler/plugin/installer_spec.rb +++ b/spec/bundler/plugin/installer_spec.rb @@ -29,11 +29,11 @@ RSpec.describe Bundler::Plugin::Installer do to eq("new-plugin" => spec) end - it "returns the installed spec after installing file plugins" do + it "returns the installed spec after installing local git plugins" do allow(installer).to receive(:install_local_git). and_return("new-plugin" => spec) - expect(installer.install(["new-plugin"], :file => "/phony/path/repo")). + expect(installer.install(["new-plugin"], :'local-git' => "/phony/path/repo")). to eq("new-plugin" => spec) end @@ -77,7 +77,7 @@ RSpec.describe Bundler::Plugin::Installer do end end - context "file plugins" do + context "local git plugins" do before do build_git "ga-plugin", :path => lib_path("ga-plugin") do |s| s.write "plugins.rb" @@ -85,7 +85,7 @@ RSpec.describe Bundler::Plugin::Installer do end let(:result) do - installer.install(["ga-plugin"], :file => lib_path("ga-plugin").to_s) + installer.install(["ga-plugin"], :'local-git' => lib_path("ga-plugin").to_s) end it "returns the installed spec after installing" do diff --git a/spec/plugins/install_spec.rb b/spec/plugins/install_spec.rb index 50d380ea8c..d77e9c99f1 100644 --- a/spec/plugins/install_spec.rb +++ b/spec/plugins/install_spec.rb @@ -128,14 +128,14 @@ RSpec.describe "bundler plugin install" do s.write "plugins.rb" end - bundle "plugin install foo --file #{lib_path("foo-1.0")}" + bundle "plugin install foo --local-git #{lib_path("foo-1.0")}" expect(out).to include("Installed plugin foo") plugin_should_be_installed("foo") end it "raises an error when both git and local git sources are specified" do - bundle "plugin install foo --file /phony/path/project --git git@gitphony.com:/repo/project" + bundle "plugin install foo --local-git /phony/path/project --git git@gitphony.com:/repo/project" expect(exitstatus).not_to eq(0) if exitstatus expect(out).to eq("Remote and local plugin git sources can't be both specified") |