aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler
diff options
context:
space:
mode:
authorAsutosh Palai <asupalai@gmail.com>2016-06-08 20:29:25 +0530
committerAsutosh Palai <asupalai@gmail.com>2016-06-08 20:57:53 +0530
commitd90208f9d977cca6254458d402d2e2d975034495 (patch)
treea56372ad2db2f34e93ff26c024093521c2683c36 /lib/bundler
parentcf284c001657a428cc37b4721aed68df795dcfed (diff)
downloadbundler-d90208f9d977cca6254458d402d2e2d975034495.tar.gz
Fixes for failing specs for older ruby version
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/plugin.rb4
-rw-r--r--lib/bundler/plugin/dsl.rb3
-rw-r--r--lib/bundler/source/rubygems.rb4
3 files changed, 6 insertions, 5 deletions
diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb
index 00b4d9e9..f97de2b2 100644
--- a/lib/bundler/plugin.rb
+++ b/lib/bundler/plugin.rb
@@ -8,8 +8,8 @@ module Bundler
autoload :Installer, "bundler/plugin/installer"
autoload :SourceList, "bundler/plugin/source_list"
- MalformattedPlugin = Class.new(PluginError)
- UndefinedCommandError = Class.new(PluginError)
+ class MalformattedPlugin < PluginError; end
+ class UndefinedCommandError < PluginError; end
PLUGIN_FILE_NAME = "plugins.rb".freeze
diff --git a/lib/bundler/plugin/dsl.rb b/lib/bundler/plugin/dsl.rb
index 4a3663fd..f65054f0 100644
--- a/lib/bundler/plugin/dsl.rb
+++ b/lib/bundler/plugin/dsl.rb
@@ -4,6 +4,7 @@ module Bundler
# Dsl to parse the Gemfile looking for plugins to install
module Plugin
class DSL < Bundler::Dsl
+ class PluginGemfileError < PluginError; end
alias_method :_gem, :gem # To use for plugin installation as gem
# So that we don't have to override all there methods to dummy ones
@@ -21,7 +22,7 @@ module Bundler
end
def method_missing(name, *args)
- super unless Bundler::Dsl.instance_methods.include? name
+ raise PluginGemfileError, "Undefined local variable or method `#{name}' for Gemfile" unless Bundler::Dsl.method_defined? name
end
end
end
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index a7721de8..d9606e70 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -149,7 +149,7 @@ module Bundler
if requires_sudo?
Bundler.rubygems.repository_subdirectories.each do |name|
src = File.join(install_path, name, "*")
- dst = File.join(Bundler.rubygems.gem_dir, name)
+ dst = File.join(rubygems_dir, name)
if name == "extensions" && Dir.glob(src).any?
src = File.join(src, "*/*")
ext_src = Dir.glob(src).first
@@ -249,7 +249,7 @@ module Bundler
end
def loaded_from(spec)
- "#{Bundler.rubygems.gem_dir}/specifications/#{spec.full_name}.gemspec"
+ "#{rubygems_dir}/specifications/#{spec.full_name}.gemspec"
end
def cached_gem(spec)