diff options
author | Christopher Meiklejohn <christopher.meiklejohn@gmail.com> | 2011-07-01 12:44:28 -0400 |
---|---|---|
committer | Christopher Meiklejohn <christopher.meiklejohn@gmail.com> | 2011-07-01 15:48:56 -0400 |
commit | 56b12067e5def52d21032391d7dde061183038dc (patch) | |
tree | d5d0dd4275b8582d38062f0535f9c1cfbf35f065 /lib/bundler/spec_set.rb | |
parent | 6cab7e9f74a0f4979af9cc5502d35f245e5bb5d5 (diff) | |
download | bundler-56b12067e5def52d21032391d7dde061183038dc.tar.gz |
Rubygems 1.8.5 expects SpecSet to act like an array.
Diffstat (limited to 'lib/bundler/spec_set.rb')
-rw-r--r-- | lib/bundler/spec_set.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 901888a1..3149c752 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -1,21 +1,18 @@ require 'tsort' +require 'forwardable' module Bundler class SpecSet + extend Forwardable include TSort, Enumerable + def_delegators :@specs, :<<, :length, :add, :remove + def_delegators :sorted, :each + def initialize(specs) @specs = specs.sort_by { |s| s.name } end - def each - sorted.each { |s| yield s } - end - - def length - @specs.length - end - def for(dependencies, skip = [], check = false, match_current_platform = false) handled, deps, specs = {}, dependencies.dup, [] skip << 'bundler' @@ -68,6 +65,10 @@ module Bundler value end + def sort! + self + end + def to_a sorted.dup end |