diff options
author | Terence Lee <hone02@gmail.com> | 2011-08-06 01:00:30 -0500 |
---|---|---|
committer | Terence Lee <hone02@gmail.com> | 2011-08-06 01:00:30 -0500 |
commit | 8e6bc165fa579a41461721c8f2df1bef6281c27a (patch) | |
tree | c78154d9965b0811cdd7b618004d269b63651242 /lib/bundler/spec_set.rb | |
parent | b213de2fd640d3062ea16165a55d5590facc6a99 (diff) | |
parent | ba23f523c690fdd6d0f8ad37962f3a1f6d2a86c7 (diff) | |
download | bundler-8e6bc165fa579a41461721c8f2df1bef6281c27a.tar.gz |
Merge branch '1-0-stable'
Conflicts:
CHANGELOG.md
lib/bundler/templates/newgem/Rakefile.tt
lib/bundler/templates/newgem/newgem.gemspec.tt
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 48ec7245e5..136ec702f6 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 |