-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGemfile
38 lines (38 loc) · 1.68 KB
/
Gemfile
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
# THIS FILE IS AUTOGENERATED, DO NOT EDIT
require 'yaml'
require 'pathname'
def source_gems(gem_source, *gems)
workspace_config_path = File.join(File.dirname(__FILE__), '..', 'Workspace.yaml')
workspace = File.file?(workspace_config_path) ? YAML.load_file(workspace_config_path) : {}
abort 'Workspace syntax error' unless workspace.is_a?(Hash)
gems.each do |gem_args|
found = false
gem_args = [gem_args] if gem_args.is_a?(String)
name = gem_args.first
begin gem *(gem_args << {:source => gem_source}); next end if workspace.nil?
env = (workspace['environment'] || 'production')
((workspace['common'] || []) + ((workspace['environments'] || {})[env] || [])).each do |source_info|
(source_info['gems'] || []).each do |gem_info|
next unless name == (gem_info.is_a?(String) ? gem_info : gem_info['name'])
if !source_info['url'].nil?
gem *(gem_args << {:source => source_info['url']})
elsif !source_info['path'].nil?
path = gem_info['path'] || name
gem *(gem_args << {:path => Pathname(path).absolute? ? path : File.join('..', path)})
elsif !source_info['git'].nil?
gem *(gem_args << {:git => (source_info['git'] + '/' + (gem_info['path'] || name)), :ref => gem_info['ref'],
:branch => gem_info['branch'], :tag => gem_info['tag']})
else
abort "Unknown source type #{source_info.to_s}"
end
found = true
break
end
break if found
end
gem *(gem_args << {:source => gem_source}) unless found
end
end
source "http://rubygems.org"
source_gems("http://rubygems.org", "rgen", "filelock")
gemspec :name => "rtext", :path => File.dirname(__FILE__)