Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix incorrect specification path in GemDependency#from_directory_name

Signed-off-by: Michael Koziarski <michael@koziarski.com>
  • Loading branch information...
commit d7e0cb05cc8adad430d0e97efef1608eef58db80 1 parent 69bc204
@al2o3cr al2o3cr authored NZKoz committed
View
2  railties/lib/rails/gem_dependency.rb
@@ -34,7 +34,7 @@ def self.from_directory_name(directory_name, load_spec=true)
name = directory_name_parts[0..-2].join('-')
version = directory_name_parts.last
result = self.new(name, :version => version)
- spec_filename = File.join(unpacked_path, directory_name, '.specification')
+ spec_filename = File.join(directory_name, '.specification')
if load_spec
raise "Missing specification file in #{File.dirname(spec_filename)}. Perhaps you need to do a 'rake gems:refresh_specs'?" unless File.exists?(spec_filename)
spec = YAML::load_file(spec_filename)
View
7 railties/test/gem_dependency_test.rb
@@ -178,6 +178,13 @@ def test_gem_from_directory_name
assert_equal '= 1.1', dummy_gem.version_requirements.to_s
end
+ def test_gem_from_directory_name_loads_specification_successfully
+ assert_nothing_raised do
+ dummy_gem = Rails::GemDependency.from_directory_name(File.join(Rails::GemDependency.unpacked_path, 'dummy-gem-g-1.0.0'))
+ assert_not_nil dummy_gem.specification
+ end
+ end
+
def test_gem_from_invalid_directory_name
assert_raises RuntimeError do
dummy_gem = Rails::GemDependency.from_directory_name('dummy-gem')
Please sign in to comment.
Something went wrong with that request. Please try again.