diff options
author | Dennis Suratna <dennis.suratna@gmail.com> | 2017-03-17 15:19:57 -0700 |
---|---|---|
committer | Dennis Suratna <dennis.suratna@gmail.com> | 2017-04-11 18:33:29 +0700 |
commit | c7cadc35d14a433716c11a4508331923e906b78d (patch) | |
tree | a5f257f0ac5b2098f96b7d43695885f2a929e559 | |
parent | 520f477c364a61a27069bece9169ed362cb6ae8b (diff) | |
download | bundler-c7cadc35d14a433716c11a4508331923e906b78d.tar.gz |
Fix rubocop errors
-rw-r--r-- | lib/bundler/cli/pristine.rb | 29 | ||||
-rw-r--r-- | spec/commands/pristine_spec.rb | 6 |
2 files changed, 17 insertions, 18 deletions
diff --git a/lib/bundler/cli/pristine.rb b/lib/bundler/cli/pristine.rb index 388b28a86c..6055bac985 100644 --- a/lib/bundler/cli/pristine.rb +++ b/lib/bundler/cli/pristine.rb @@ -12,23 +12,22 @@ module Bundler end case spec.source - when Source::Rubygems - cached_gem = spec.cache_file - unless File.exist?(cached_gem) - # TODO: Refetch from ruby gem? - ::Bundler.ui.error("Failed to pristine #{gem_name}. Cached gem #{cached_gem} does not exist.") - next - end + when Source::Rubygems + cached_gem = spec.cache_file + unless File.exist?(cached_gem) + # TODO: Refetch from ruby gem? + ::Bundler.ui.error("Failed to pristine #{gem_name}. Cached gem #{cached_gem} does not exist.") + next + end - spec.source.install(spec, :force => true) - when Source::Git - git_source = spec.source - git_source.remote! - git_source.install(spec, :force => true) - else - ::Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.") + spec.source.install(spec, :force => true) + when Source::Git + git_source = spec.source + git_source.remote! + git_source.install(spec, :force => true) + else + ::Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.") end - end end end diff --git a/spec/commands/pristine_spec.rb b/spec/commands/pristine_spec.rb index 5b63ec257c..ff327e190b 100644 --- a/spec/commands/pristine_spec.rb +++ b/spec/commands/pristine_spec.rb @@ -47,7 +47,7 @@ RSpec.describe "bundle pristine" do changed_file = Pathname.new(spec.full_gem_path).join("lib/foo.rb") diff = "#Pristine spec changes" - File.open(changed_file, 'a') { |f| f.puts '#Pristine spec changes' } + File.open(changed_file, "a") {|f| f.puts "#Pristine spec changes" } expect(File.read(changed_file)).to include(diff) bundle "pristine" @@ -61,7 +61,7 @@ RSpec.describe "bundle pristine" do changed_file = Pathname.new(spec.full_gem_path).join("lib/baz.rb") diff = "#Pristine spec changes" - File.open(changed_file, 'a') { |f| f.puts '#Pristine spec changes' } + File.open(changed_file, "a") {|f| f.puts "#Pristine spec changes" } expect(File.read(changed_file)).to include(diff) bundle "pristine" @@ -74,7 +74,7 @@ RSpec.describe "bundle pristine" do changed_file = Pathname.new(spec.full_gem_path).join("lib/baz-dev.rb") diff = "#Pristine spec changes" - File.open(changed_file, 'a') { |f| f.puts '#Pristine spec changes' } + File.open(changed_file, "a") {|f| f.puts "#Pristine spec changes" } expect(File.read(changed_file)).to include(diff) bundle "pristine" |