Permalink
Browse files

Fix careless "undefined local variable or method `maven_sources' for …

…#<Gem::RemoteFetcher>"
  • Loading branch information...
nicksieger authored and yokolet committed Jan 7, 2011
1 parent 08d0f17 commit d0221d92979d6de7d38c41875e7b12edd5619835
Showing with 10 additions and 4 deletions.
  1. +10 −4 lib/ruby/site_ruby/1.8/rubygems/maven_gemify.rb
@@ -12,7 +12,15 @@ def self.maven_name?(name)
end
end
+ module MavenSources
+ def maven_sources
+ Gem.sources.select {|x| x =~ /^mvn:/}
+ end
+ end
+
class RemoteFetcher
+ include MavenSources
+
def download_maven(spec, local_gem_path)
FileUtils.cp Gem::Maven::Gemify.new(maven_sources).generate_gem(spec.name, spec.version), local_gem_path
local_gem_path
@@ -21,6 +29,8 @@ def download_maven(spec, local_gem_path)
end
class SpecFetcher
+ include MavenSources
+
def gemify_generate_spec(spec)
specfile = Gem::Maven::Gemify.new(maven_sources).generate_spec(spec[0], spec[1])
Marshal.dump(Gem::Specification.from_yaml(File.read(specfile)))
@@ -48,10 +58,6 @@ def find_matching_using_maven(dependency)
end
private :find_matching_using_maven
- def maven_sources
- Gem.sources.select {|x| x =~ /^mvn:/}
- end
-
alias orig_find_matching_with_errors find_matching_with_errors
def find_matching_with_errors(dependency, all = false, matching_platform = true, prerelease = false)
if Gem::Specification.maven_name? dependency.name

0 comments on commit d0221d9

Please sign in to comment.