diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-03-10 00:33:32 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-03-10 00:33:32 +0000 |
commit | 1ab84247ca4b80afbd82afe7539b3449636344c4 (patch) | |
tree | 9ca5e3bee3a07b68c9d900ff129b69bc740405c2 /railties/lib/rails/gem_dependency.rb | |
parent | b6fb79c531a0079274f7b459302e6290c9183f28 (diff) | |
parent | 4458edc882b229ea44602da20a6440a6f233f1c8 (diff) | |
download | rails-1ab84247ca4b80afbd82afe7539b3449636344c4.tar.gz rails-1ab84247ca4b80afbd82afe7539b3449636344c4.tar.bz2 rails-1ab84247ca4b80afbd82afe7539b3449636344c4.zip |
Merge commit 'mainstream/master'
Conflicts:
railties/guides/files/stylesheets/main.css
railties/guides/rails_guides/generator.rb
railties/guides/source/index.erb.textile
Diffstat (limited to 'railties/lib/rails/gem_dependency.rb')
-rw-r--r-- | railties/lib/rails/gem_dependency.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/railties/lib/rails/gem_dependency.rb b/railties/lib/rails/gem_dependency.rb index 5a07841be8..2dd659032f 100644 --- a/railties/lib/rails/gem_dependency.rb +++ b/railties/lib/rails/gem_dependency.rb @@ -72,13 +72,14 @@ module Rails rescue Gem::LoadError end - def dependencies - return [] if framework_gem? - return [] if specification.nil? + def dependencies(options = {}) + return [] if framework_gem? || specification.nil? + all_dependencies = specification.dependencies.map do |dependency| GemDependency.new(dependency.name, :requirement => dependency.version_requirements) end - all_dependencies += all_dependencies.map(&:dependencies).flatten + + all_dependencies += all_dependencies.map { |d| d.dependencies(options) }.flatten if options[:flatten] all_dependencies.uniq end @@ -149,6 +150,8 @@ module Rails end def unpack_to(directory) + return if specification.nil? || File.directory?(gem_dir(directory)) || framework_gem? + FileUtils.mkdir_p directory Dir.chdir directory do Gem::GemRunner.new.run(unpack_command) |