bundler 0.8.1 → 0.9.0.pre1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

Files changed (58) hide show
  1. data/README +7 -0
  2. data/bin/bundle +3 -0
  3. data/lib/bundler.rb +72 -37
  4. data/lib/bundler/cli.rb +64 -68
  5. data/lib/bundler/definition.rb +78 -0
  6. data/lib/bundler/dependency.rb +7 -57
  7. data/lib/bundler/dsl.rb +42 -142
  8. data/lib/bundler/environment.rb +94 -54
  9. data/lib/bundler/index.rb +98 -0
  10. data/lib/bundler/installer.rb +137 -0
  11. data/lib/bundler/remote_specification.rb +1 -1
  12. data/lib/bundler/resolver.rb +20 -50
  13. data/lib/bundler/rubygems.rb +22 -0
  14. data/lib/bundler/source.rb +185 -295
  15. data/lib/bundler/specification.rb +22 -0
  16. data/lib/bundler/templates/Gemfile +4 -0
  17. data/lib/bundler/templates/environment.erb +3 -153
  18. data/lib/bundler/ui.rb +51 -0
  19. data/lib/bundler/vendor/thor.rb +241 -0
  20. data/lib/bundler/vendor/thor/actions.rb +274 -0
  21. data/lib/bundler/vendor/thor/actions/create_file.rb +103 -0
  22. data/lib/bundler/vendor/thor/actions/directory.rb +91 -0
  23. data/lib/bundler/vendor/thor/actions/empty_directory.rb +134 -0
  24. data/lib/bundler/vendor/thor/actions/file_manipulation.rb +223 -0
  25. data/lib/bundler/vendor/thor/actions/inject_into_file.rb +101 -0
  26. data/lib/bundler/vendor/thor/base.rb +515 -0
  27. data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +9 -0
  28. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +75 -0
  29. data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +100 -0
  30. data/lib/bundler/vendor/thor/error.rb +27 -0
  31. data/lib/bundler/vendor/thor/group.rb +267 -0
  32. data/lib/bundler/vendor/thor/invocation.rb +178 -0
  33. data/lib/bundler/vendor/thor/parser.rb +4 -0
  34. data/lib/bundler/vendor/thor/parser/argument.rb +67 -0
  35. data/lib/bundler/vendor/thor/parser/arguments.rb +145 -0
  36. data/lib/bundler/vendor/thor/parser/option.rb +132 -0
  37. data/lib/bundler/vendor/thor/parser/options.rb +142 -0
  38. data/lib/bundler/vendor/thor/rake_compat.rb +66 -0
  39. data/lib/bundler/vendor/thor/runner.rb +303 -0
  40. data/lib/bundler/vendor/thor/shell.rb +78 -0
  41. data/lib/bundler/vendor/thor/shell/basic.rb +239 -0
  42. data/lib/bundler/vendor/thor/shell/color.rb +108 -0
  43. data/lib/bundler/vendor/thor/task.rb +111 -0
  44. data/lib/bundler/vendor/thor/util.rb +233 -0
  45. data/lib/bundler/vendor/thor/version.rb +3 -0
  46. metadata +48 -26
  47. data/README.markdown +0 -284
  48. data/Rakefile +0 -81
  49. data/lib/bundler/bundle.rb +0 -314
  50. data/lib/bundler/commands/bundle_command.rb +0 -72
  51. data/lib/bundler/commands/exec_command.rb +0 -36
  52. data/lib/bundler/finder.rb +0 -51
  53. data/lib/bundler/gem_bundle.rb +0 -11
  54. data/lib/bundler/gem_ext.rb +0 -34
  55. data/lib/bundler/runtime.rb +0 -2
  56. data/lib/bundler/templates/app_script.erb +0 -3
  57. data/lib/bundler/templates/environment_picker.erb +0 -4
  58. data/lib/rubygems_plugin.rb +0 -6
data/README ADDED
@@ -0,0 +1,7 @@
1
+ This is a rewrite of bundler to offer more bundling power
2
+
3
+ It currently lacks output and good exception handling for common cases. This is coming very soon. We wanted to open this so people could take a look at it.
4
+
5
+ More soon.
6
+
7
+ - carlhuda
@@ -0,0 +1,3 @@
1
+ require 'bundler/cli'
2
+
3
+ Bundler::CLI.start
@@ -1,49 +1,84 @@
1
+ require 'fileutils'
1
2
  require 'pathname'
2
- require 'logger'
3
- require 'set'
4
- require 'erb'
5
- # Required elements of rubygems
6
- require "rubygems/remote_fetcher"
7
- require "rubygems/installer"
8
-
9
- require "bundler/gem_bundle"
10
- require "bundler/source"
11
- require "bundler/finder"
12
- require "bundler/gem_ext"
13
- require "bundler/resolver"
14
- require "bundler/environment"
15
- require "bundler/dsl"
16
- require "bundler/cli"
17
- require "bundler/bundle"
18
- require "bundler/dependency"
19
- require "bundler/remote_specification"
3
+ require 'yaml'
4
+ require 'bundler/rubygems'
20
5
 
21
6
  module Bundler
22
- VERSION = "0.8.1"
7
+ VERSION = "0.9.0.pre1"
23
8
 
24
- class << self
25
- attr_writer :logger, :mode
9
+ autoload :Definition, 'bundler/definition'
10
+ autoload :Dependency, 'bundler/dependency'
11
+ autoload :Dsl, 'bundler/dsl'
12
+ autoload :Environment, 'bundler/environment'
13
+ autoload :Index, 'bundler/index'
14
+ autoload :Installer, 'bundler/installer'
15
+ autoload :RemoteSpecification, 'bundler/remote_specification'
16
+ autoload :Resolver, 'bundler/resolver'
17
+ autoload :Source, 'bundler/source'
18
+ autoload :Specification, 'bundler/specification'
19
+ autoload :UI, 'bundler/ui'
26
20
 
27
- def logger
28
- @logger ||= begin
29
- logger = Logger.new(STDOUT, Logger::INFO)
30
- logger.formatter = proc {|_,_,_,msg| "#{msg}\n" }
31
- logger
32
- end
33
- end
21
+ class GemfileNotFound < StandardError; end
22
+ class GemNotFound < StandardError; end
23
+ class VersionConflict < StandardError; end
24
+ class GemfileError < StandardError; end
34
25
 
35
- def local?
36
- @mode == :local
37
- end
26
+ def self.ui
27
+ @ui ||= UI.new
28
+ end
38
29
 
39
- def writable?
40
- @mode != :readonly
30
+ def self.ui=(ui)
31
+ @ui = ui
32
+ end
33
+
34
+ def self.setup(*groups)
35
+ gemfile = default_gemfile
36
+ load(gemfile).setup(*groups)
37
+ end
38
+
39
+ def self.load(gemfile = default_gemfile)
40
+ root = Pathname.new(gemfile).dirname
41
+ Environment.new root, definition(gemfile)
42
+ end
43
+
44
+ def self.definition(gemfile = default_gemfile)
45
+ root = Pathname.new(gemfile).dirname
46
+ lockfile = root.join("vendor/lock.yml")
47
+ if lockfile.exist?
48
+ Definition.from_lock(lockfile)
49
+ else
50
+ Definition.from_gemfile(gemfile)
41
51
  end
52
+ end
42
53
 
43
- def remote?
44
- @mode == :readwrite
54
+ def self.home
55
+ Pathname.new(Gem.dir).join("bundler")
56
+ end
57
+
58
+ def self.install_path
59
+ home.join("gems")
60
+ end
61
+
62
+ def self.cache
63
+ home.join("cache")
64
+ end
65
+
66
+ def self.root
67
+ default_gemfile.dirname
68
+ end
69
+
70
+ private
71
+
72
+ def self.default_gemfile
73
+ current = Pathname.new(Dir.pwd)
74
+
75
+ until current.root?
76
+ filename = current.join("Gemfile")
77
+ return filename if filename.exist?
78
+ current = current.parent
45
79
  end
80
+
81
+ raise GemfileNotFound, "The default Gemfile was not found"
46
82
  end
47
83
 
48
- self.mode = :readonly
49
- end
84
+ end
@@ -1,89 +1,85 @@
1
- require "optparse"
1
+ $:.unshift File.expand_path('../vendor', __FILE__)
2
+ require 'thor'
3
+ require 'bundler'
4
+ require 'rubygems/config_file'
5
+
6
+ # Work around a RubyGems bug
7
+ Gem.configuration
2
8
 
3
9
  module Bundler
4
- class CLI
5
- def self.run(command, options = {})
6
- new(options).run(command)
7
- rescue DefaultManifestNotFound => e
8
- Bundler.logger.error "Could not find a Gemfile to use"
9
- exit 3
10
- rescue InvalidEnvironmentName => e
11
- Bundler.logger.error "Gemfile error: #{e.message}"
12
- exit 4
13
- rescue InvalidRepository => e
14
- Bundler.logger.error e.message
15
- exit 5
16
- rescue VersionConflict => e
17
- Bundler.logger.error e.message
18
- exit 6
19
- rescue GemNotFound => e
20
- Bundler.logger.error e.message
21
- exit 7
22
- rescue InvalidCacheArgument => e
23
- Bundler.logger.error e.message
24
- exit 8
25
- rescue SourceNotCached => e
26
- Bundler.logger.error e.message
27
- exit 9
28
- rescue ManifestFileNotFound => e
29
- Bundler.logger.error e.message
30
- exit 10
10
+ class CLI < Thor
11
+ def self.banner(task)
12
+ task.formatted_usage(self, false)
31
13
  end
32
14
 
33
- def initialize(options)
34
- Bundler.mode = options[:cached] ? :local : :readwrite
35
- @options = options
36
- @bundle = Bundle.load(@options[:manifest])
15
+ desc "init", "Generates a Gemfile into the current working directory"
16
+ def init
17
+ if File.exist?("Gemfile")
18
+ puts "Gemfile already exists at `#{Dir.pwd}/Gemfile`"
19
+ else
20
+ puts "Writing new Gemfile to `#{Dir.pwd}/Gemfile`"
21
+ FileUtils.cp(File.expand_path('../templates/Gemfile', __FILE__), 'Gemfile')
22
+ end
37
23
  end
38
24
 
39
- def bundle
40
- @bundle.install(@options)
25
+ def initialize(*)
26
+ super
27
+ Bundler.ui = UI::Shell.new(shell)
28
+ Gem::DefaultUserInteraction.ui = UI::RGProxy.new(Bundler.ui)
41
29
  end
42
30
 
43
- def cache
44
- gemfile = @options[:cache]
45
-
46
- if File.extname(gemfile) == ".gem"
47
- if !File.exist?(gemfile)
48
- raise InvalidCacheArgument, "'#{gemfile}' does not exist."
49
- end
50
- @bundle.cache(gemfile)
51
- elsif File.directory?(gemfile) || gemfile.include?('/')
52
- if !File.directory?(gemfile)
53
- raise InvalidCacheArgument, "'#{gemfile}' does not exist."
31
+ desc "check", "Checks if the dependencies listed in Gemfile are satisfied by currently installed gems"
32
+ def check
33
+ with_rescue do
34
+ env = Bundler.load
35
+ # Check top level dependencies
36
+ missing = env.dependencies.select { |d| env.index.search(d).empty? }
37
+ if missing.any?
38
+ puts "The following dependencies are missing"
39
+ missing.each do |d|
40
+ puts " * #{d}"
41
+ end
42
+ else
43
+ env.specs
44
+ puts "The Gemfile's dependencies are satisfied"
54
45
  end
55
- gemfiles = Dir["#{gemfile}/*.gem"]
56
- if gemfiles.empty?
57
- raise InvalidCacheArgument, "'#{gemfile}' contains no gemfiles"
58
- end
59
- @bundle.cache(*gemfiles)
60
- else
61
- raise InvalidCacheArgument, "w0t? '#{gemfile}' means nothing to me."
62
46
  end
47
+ rescue VersionConflict => e
48
+ puts e.message
63
49
  end
64
50
 
65
- def prune
66
- Bundler.mode = :local
67
- @bundle.prune(@options)
68
- end
51
+ desc "install", "Install the current environment to the system"
52
+ method_option :without, :type => :array, :banner => "Exclude gems thar are part of the specified named group"
53
+ def install
54
+ opts = options.dup
55
+ opts[:without] ||= []
56
+ opts[:without].map! { |g| g.to_sym }
69
57
 
70
- def list
71
- @bundle.list(@options)
58
+ Installer.install(Bundler.root, Bundler.definition, opts)
59
+ rescue Bundler::GemNotFound => e
60
+ puts e.message
61
+ exit 1
72
62
  end
73
63
 
74
- def list_outdated
75
- @bundle.list_outdated(@options)
64
+ desc "lock", "Locks a resolve"
65
+ def lock
66
+ environment = Bundler.load
67
+ environment.lock
76
68
  end
77
69
 
78
- def exec
79
- @bundle.setup_environment
80
- # w0t?
81
- super(*$command)
70
+ desc "pack", "Packs all the gems to vendor/cache"
71
+ def pack
72
+ environment = Bundler.load
73
+ environment.pack
82
74
  end
83
75
 
84
- def run(command)
85
- send(command)
86
- end
76
+ private
87
77
 
78
+ def with_rescue
79
+ yield
80
+ rescue GemfileNotFound => e
81
+ puts e.message
82
+ exit 1
83
+ end
88
84
  end
89
- end
85
+ end
@@ -0,0 +1,78 @@
1
+ module Bundler
2
+ class Definition
3
+ def self.from_gemfile(gemfile)
4
+ gemfile = Pathname.new(gemfile).expand_path
5
+
6
+ unless gemfile.file?
7
+ raise GemfileNotFound, "`#{gemfile}` not found"
8
+ end
9
+
10
+ Dsl.evaluate(gemfile)
11
+ end
12
+
13
+ def self.from_lock(lockfile)
14
+ # gemfile_definition = from_gemfile(nil)
15
+ locked_definition = Locked.new(YAML.load_file(lockfile))
16
+ # raise GemfileError unless gemfile_definition.equivalent?(locked_definition)
17
+ locked_definition
18
+ end
19
+
20
+ attr_reader :dependencies, :sources
21
+
22
+ alias actual_dependencies dependencies
23
+
24
+ def initialize(dependencies, sources)
25
+ @dependencies = dependencies
26
+ @sources = sources
27
+ end
28
+
29
+ def local_index
30
+ @local_index ||= begin
31
+ index = Index.from_installed_gems
32
+
33
+ sources.each do |source|
34
+ next unless source.respond_to?(:local_specs)
35
+ index = source.local_specs.merge(index)
36
+ end
37
+
38
+ index
39
+ end
40
+ end
41
+
42
+ # def equivalent?(other)
43
+ # self.matches?(other) && other.matches?(self)
44
+ # # other.matches?(self)
45
+ # end
46
+
47
+ # def matches?(other)
48
+ # dependencies.all? do |dep|
49
+ # dep =~ other.specs.find {|spec| spec.name == dep.name }
50
+ # end
51
+ # end
52
+
53
+ class Locked < Definition
54
+ def initialize(details)
55
+ @details = details
56
+ end
57
+
58
+ def sources
59
+ @sources ||= @details["sources"].map do |args|
60
+ name, options = args.to_a.flatten
61
+ Bundler::Source.const_get(name).new(options)
62
+ end
63
+ end
64
+
65
+ def actual_dependencies
66
+ @actual_dependencies ||= @details["specs"].map do |args|
67
+ Gem::Dependency.new(*args.to_a.flatten)
68
+ end
69
+ end
70
+
71
+ def dependencies
72
+ @dependencies ||= @details["dependencies"].map do |args|
73
+ Gem::Dependency.new(*args.to_a.flatten)
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -1,62 +1,12 @@
1
- module Bundler
2
- class InvalidEnvironmentName < StandardError; end
1
+ require 'rubygems/dependency'
3
2
 
3
+ module Bundler
4
4
  class Dependency < Gem::Dependency
5
- attr_reader :name, :version, :require_as, :only, :except
6
- attr_accessor :source
7
-
8
- def initialize(name, options = {}, &block)
9
- options.each do |k, v|
10
- options[k.to_s] = v
11
- end
12
-
13
- super(name, options["version"] || ">= 0")
14
-
15
- @require_as = options["require_as"]
16
- @only = options["only"]
17
- @except = options["except"]
18
- @source = options["source"]
19
- @block = block
20
-
21
- if (@only && @only.include?("rubygems")) || (@except && @except.include?("rubygems"))
22
- raise InvalidEnvironmentName, "'rubygems' is not a valid environment name"
23
- end
24
- end
25
-
26
- def in?(environment)
27
- environment = environment.to_s
28
-
29
- return false unless !@only || @only.include?(environment)
30
- return false if @except && @except.include?(environment)
31
- true
32
- end
33
-
34
- def require_env(environment)
35
- return unless in?(environment)
36
-
37
- if @require_as
38
- Array(@require_as).each { |file| require file }
39
- else
40
- begin
41
- require name
42
- rescue LoadError
43
- # Do nothing
44
- end
45
- end
46
-
47
- @block.call if @block
48
- end
5
+ def initialize(name, version, options = {}, &blk)
6
+ super(name, version)
49
7
 
50
- def no_bundle?
51
- source == SystemGemSource.instance
8
+ @group = options["group"] || :default
9
+ @source = options["source"]
52
10
  end
53
-
54
- def ==(o)
55
- [name, version, require_as, only, except] ==
56
- [o.name, o.version, o.require_as, o.only, o.except]
57
- end
58
-
59
- alias version version_requirements
60
-
61
11
  end
62
- end
12
+ end
@@ -1,110 +1,56 @@
1
1
  module Bundler
2
- class ManifestFileNotFound < StandardError; end
3
- class InvalidKey < StandardError; end
4
- class DefaultManifestNotFound < StandardError; end
2
+ class DslError < StandardError; end
5
3
 
6
4
  class Dsl
7
- def self.evaluate(file, bundle, environment)
8
- builder = new(bundle, environment)
9
- builder.instance_eval(File.read(file.to_s), file.to_s, 1)
10
- environment
5
+ def self.evaluate(gemfile)
6
+ builder = new
7
+ builder.instance_eval(File.read(gemfile.to_s), gemfile.to_s, 1)
8
+ builder.to_definition
11
9
  end
12
10
 
13
- def initialize(bundle, environment)
14
- @bundle = bundle
15
- @environment = environment
16
- @directory_sources = []
17
- @git_sources = {}
18
- @only, @except, @directory, @git = nil, nil, nil, nil
11
+ def initialize
12
+ @sources = [] # Gem.sources.map { |s| Source::Rubygems.new(:uri => s) }
13
+ @dependencies = []
14
+ @group = nil
19
15
  end
20
16
 
21
- def bundle_path(path)
22
- @bundle.path = Pathname.new(path)
23
- end
24
-
25
- def bin_path(path)
26
- @bundle.bindir = Pathname.new(path)
27
- end
17
+ def gem(name, *args)
18
+ options = Hash === args.last ? args.pop : {}
19
+ version = args.last || ">= 0"
28
20
 
29
- def disable_rubygems
30
- @environment.rubygems = false
31
- end
21
+ _normalize_options(name, version, options)
32
22
 
33
- def disable_system_gems
34
- @environment.system_gems = false
23
+ @dependencies << Dependency.new(name, version, options)
35
24
  end
36
25
 
37
26
  def source(source)
38
- source = GemSource.new(@bundle, :uri => source)
39
- unless @environment.sources.include?(source)
40
- @environment.add_source(source)
27
+ source = case source
28
+ when :gemcutter, :rubygems, :rubyforge then Source::Rubygems.new(:uri => "http://gemcutter.org")
29
+ when String then Source::Rubygems.new(:uri => source)
30
+ else source
41
31
  end
42
- end
43
32
 
44
- def only(*env)
45
- old, @only = @only, _combine_only(env)
46
- yield
47
- @only = old
33
+ @sources << source
34
+ source
48
35
  end
49
36
 
50
- def except(*env)
51
- old, @except = @except, _combine_except(env)
52
- yield
53
- @except = old
54
- end
55
-
56
- def directory(path, options = {})
57
- raise DirectorySourceError, "cannot nest calls to directory or git" if @directory || @git
58
- @directory = DirectorySource.new(@bundle, options.merge(:location => path))
59
- @directory_sources << @directory
60
- @environment.add_priority_source(@directory)
61
- retval = yield if block_given?
62
- @directory = nil
63
- retval
37
+ def path(path, options = {})
38
+ source Source::Path.new(options.merge(:path => path))
64
39
  end
65
40
 
66
41
  def git(uri, options = {})
67
- raise DirectorySourceError, "cannot nest calls to directory or git" if @directory || @git
68
- @git = GitSource.new(@bundle, options.merge(:uri => uri))
69
- @git_sources[uri] = @git
70
- @environment.add_priority_source(@git)
71
- retval = yield if block_given?
72
- @git = nil
73
- retval
42
+ source Source::Git.new(options.merge(:uri => uri))
74
43
  end
75
44
 
76
- def clear_sources
77
- @environment.clear_sources
45
+ def to_definition
46
+ Definition.new(@dependencies, @sources)
78
47
  end
79
48
 
80
- def gem(name, *args)
81
- options = args.last.is_a?(Hash) ? args.pop : {}
82
- version = args.last
83
-
84
- keys = :vendored_at, :path, :only, :except, :git, :path, :bundle, :require_as, :tag, :branch, :ref
85
- unless (invalid = options.keys - keys).empty?
86
- raise InvalidKey, "Only #{keys.join(", ")} are valid options to #gem. You used #{invalid.join(", ")}"
87
- end
88
-
89
- if path = options.delete(:vendored_at)
90
- options[:path] = path
91
- warn "The :vendored_at option is deprecated. Use :path instead.\nFrom #{caller[0]}"
92
- end
93
-
94
- options[:only] = _combine_only(options[:only] || options["only"])
95
- options[:except] = _combine_except(options[:except] || options["except"])
96
-
97
- dep = Dependency.new(name, options.merge(:version => version))
98
-
99
- if options.key?(:bundle) && !options[:bundle]
100
- dep.source = SystemGemSource.new(@bundle)
101
- elsif @git || options[:git]
102
- dep.source = _handle_git_option(name, version, options)
103
- elsif @directory || options[:path]
104
- dep.source = _handle_vendored_option(name, version, options)
105
- end
106
-
107
- @environment.dependencies << dep
49
+ def group(name, options = {}, &blk)
50
+ old, @group = @group, name
51
+ yield
52
+ ensure
53
+ @group = old
108
54
  end
109
55
 
110
56
  private
@@ -113,70 +59,24 @@ module Bundler
113
59
  version && Gem::Version.new(version) rescue false
114
60
  end
115
61
 
116
- def _handle_vendored_option(name, version, options)
117
- dir, path = _find_directory_source(options[:path])
118
-
119
- if dir
120
- dir.required_specs << name
121
- dir.add_spec(path, name, version) if _version?(version)
122
- dir
123
- else
124
- directory options[:path] do
125
- _handle_vendored_option(name, version, {})
126
- end
127
- end
128
- end
129
-
130
- def _find_directory_source(path)
131
- if @directory
132
- return @directory, Pathname.new(path || '')
62
+ def _normalize_options(name, version, opts)
63
+ opts.each do |k, v|
64
+ opts[k.to_s] = v
133
65
  end
134
66
 
135
- path = @bundle.gemfile.dirname.join(path)
136
-
137
- @directory_sources.each do |s|
138
- if s.location.expand_path.to_s < path.expand_path.to_s
139
- return s, path.relative_path_from(s.location)
140
- end
141
- end
67
+ opts["group"] ||= @group
142
68
 
143
- nil
69
+ _normalize_git_options(name, version, opts)
144
70
  end
145
71
 
146
- def _handle_git_option(name, version, options)
147
- git = options[:git].to_s
148
- ref = options[:ref] || options[:tag]
149
- branch = options[:branch]
150
-
151
- if source = @git || @git_sources[git]
152
- if ref && source.ref != ref
153
- raise GitSourceError, "'#{git}' already specified with ref: #{source.ref}"
154
- elsif branch && source.branch != branch
155
- raise GitSourceError, "'#{git}' already specified with branch: #{source.branch}"
156
- end
157
-
158
- source.required_specs << name
159
- source.add_spec(Pathname.new(options[:path] || '.'), name, version) if _version?(version)
160
- source
161
- else
162
- git(git, :ref => ref, :branch => branch) do
163
- _handle_git_option(name, version, options)
164
- end
72
+ def _normalize_git_options(name, version, opts)
73
+ # Normalize Git options
74
+ if opts["git"]
75
+ source = git(opts["git"], :ref => opts["ref"])
76
+ source.default_spec name, version if _version?(version)
77
+ opts["source"] = source
165
78
  end
166
79
  end
167
80
 
168
- def _combine_only(only)
169
- return @only unless only
170
- only = Array(only).compact.uniq.map { |o| o.to_s }
171
- only &= @only if @only
172
- only
173
- end
174
-
175
- def _combine_except(except)
176
- return @except unless except
177
- except = Array(except).compact.uniq.map { |o| o.to_s }
178
- except |= @except if @except
179
- except
180
- end
181
81
  end
182
- end
82
+ end