Skip to content
Browse files

Moved GemDependencyAPI to its own file

  • Loading branch information...
1 parent d9a5ad4 commit ef9dce471cdb0d0e09c0b01252a07c33a8ea3985 @drbrain drbrain committed Apr 3, 2013
Showing with 42 additions and 36 deletions.
  1. +1 −0 Manifest.txt
  2. +2 −36 lib/rubygems/request_set.rb
  3. +39 −0 lib/rubygems/request_set/gem_dependency_api.rb
View
1 Manifest.txt
@@ -102,6 +102,7 @@ lib/rubygems/psych_tree.rb
lib/rubygems/rdoc.rb
lib/rubygems/remote_fetcher.rb
lib/rubygems/request_set.rb
+lib/rubygems/request_set/gem_dependency_api.rb
lib/rubygems/requirement.rb
lib/rubygems/security.rb
lib/rubygems/security/policies.rb
View
38 lib/rubygems/request_set.rb
@@ -170,41 +170,7 @@ def install options, &block
specs
end
-
- # A semi-compatible DSL for Bundler's Gemfile format
- #
- class GemDepedencyAPI
- def initialize(set, path)
- @set = set
- @path = path
- end
-
- def load
- instance_eval File.read(@path).untaint, @path, 1
- end
-
- # DSL
-
- def source(url)
- end
-
- def gem(name, *reqs)
- # Ignore the opts for now.
- reqs.pop if reqs.last.kind_of?(Hash)
-
- @set.gem name, *reqs
- end
-
- def platform(what)
- if what == :ruby
- yield
- end
- end
-
- alias_method :platforms, :platform
-
- def group(*what)
- end
- end
end
end
+
+require 'rubygems/request_set/gem_dependency_api'
View
39 lib/rubygems/request_set/gem_dependency_api.rb
@@ -0,0 +1,39 @@
+##
+# A semi-compatible DSL for Bundler's Gemfile format
+
+class Gem::RequestSet::GemDepedencyAPI
+
+ def initialize set, path
+ @set = set
+ @path = path
+ end
+
+ def load
+ instance_eval File.read(@path).untaint, @path, 1
+ end
+
+ # :category: Bundler Gemfile DSL
+
+ def gem name, *reqs
+ # Ignore the opts for now.
+ reqs.pop if reqs.last.kind_of?(Hash)
+
+ @set.gem name, *reqs
+ end
+
+ def group *what
+ end
+
+ def platform what
+ if what == :ruby
+ yield
+ end
+ end
+
+ alias :platforms :platform
+
+ def source url
+ end
+
+end
+

0 comments on commit ef9dce4

Please sign in to comment.
Something went wrong with that request. Please try again.