summaryrefslogtreecommitdiff
path: root/lib/rubygems/request_set/gem_dependency_api.rb
blob: 178ed1b59d37573e52a20949ff0375e5a6ad8dce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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