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
@@ -1,36 +0,0 @@
1
- if exec = ARGV.index("exec")
2
- $command = ARGV[(exec + 1)..-1]
3
- ARGV.replace ARGV[0..exec]
4
- end
5
-
6
- class Gem::Commands::ExecCommand < Gem::Command
7
-
8
- def initialize
9
- super('exec', 'Run a command in context of a gem bundle', {:manifest => nil})
10
-
11
- add_option('-m', '--manifest MANIFEST', "Specify the path to the manifest file") do |manifest, options|
12
- options[:manifest] = manifest
13
- end
14
- end
15
-
16
- def usage
17
- "#{program_name} COMMAND"
18
- end
19
-
20
- def arguments # :nodoc:
21
- "COMMAND command to run in context of the gem bundle"
22
- end
23
-
24
- def description # :nodoc:
25
- <<-EOF.gsub(' ', '')
26
- Run in context of a bundle
27
- EOF
28
- end
29
-
30
- def execute
31
- # Prevent the bundler from getting required unless it is actually being used
32
- require 'bundler'
33
- Bundler::CLI.run(:exec, options)
34
- end
35
-
36
- end
@@ -1,51 +0,0 @@
1
- module Bundler
2
- # Finder behaves like a rubygems source index in that it responds
3
- # to #search. It also resolves a list of dependencies finding the
4
- # best possible configuration of gems that satisifes all requirements
5
- # without causing any gem activation errors.
6
- class Finder
7
-
8
- # Takes an array of gem sources and fetches the full index of
9
- # gems from each one. It then combines the indexes together keeping
10
- # track of the original source so that any resolved gem can be
11
- # fetched from the correct source.
12
- #
13
- # ==== Parameters
14
- # *sources<String>:: URI pointing to the gem repository
15
- def initialize(*sources)
16
- @cache = {}
17
- @index = {}
18
- @sources = sources
19
- end
20
-
21
- # Searches for a gem that matches the dependency
22
- #
23
- # ==== Parameters
24
- # dependency<Gem::Dependency>:: The gem dependency to search for
25
- #
26
- # ==== Returns
27
- # [Gem::Specification]:: A collection of gem specifications
28
- # matching the search
29
- def search(dependency)
30
- @cache[dependency.hash] ||= begin
31
- find_by_name(dependency.name).select do |spec|
32
- dependency =~ spec
33
- end.sort_by {|s| s.version }
34
- end
35
- end
36
-
37
- private
38
-
39
- def find_by_name(name)
40
- matches = @index[name] ||= begin
41
- versions = {}
42
- @sources.reverse_each do |source|
43
- versions.merge! source.specs[name] || {}
44
- end
45
- versions
46
- end
47
- matches.values
48
- end
49
-
50
- end
51
- end
@@ -1,11 +0,0 @@
1
- module Bundler
2
- class GemBundle < Array
3
- def download
4
- sort_by {|s| s.full_name.downcase }.each do |spec|
5
- spec.source.download(spec)
6
- end
7
-
8
- self
9
- end
10
- end
11
- end
@@ -1,34 +0,0 @@
1
- module Gem
2
- class Installer
3
- remove_method(:app_script_text) if method_defined?(:app_script_text)
4
-
5
- def app_script_text(bin_file_name)
6
- path = @gem_home
7
- template = File.read(File.join(File.dirname(__FILE__), "templates", "app_script.erb"))
8
- erb = ERB.new(template, nil, '-')
9
- erb.result(binding)
10
- end
11
- end
12
-
13
- class Specification
14
- attr_accessor :source, :location, :no_bundle
15
-
16
- alias no_bundle? no_bundle
17
-
18
- remove_method(:specification_version) if method_defined?(:specification_version)
19
-
20
- # Hack to fix github's strange marshal file
21
- def specification_version
22
- @specification_version && @specification_version.to_i
23
- end
24
-
25
- alias full_gem_path_without_location full_gem_path
26
- def full_gem_path
27
- if defined?(@location) && @location
28
- @location
29
- else
30
- full_gem_path_without_location
31
- end
32
- end
33
- end
34
- end
@@ -1,2 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "runtime", "dsl")
2
- require File.join(File.dirname(__FILE__), "runtime", "dependency")
@@ -1,3 +0,0 @@
1
- <%= shebang bin_file_name %>
2
- require File.expand_path(File.join(File.dirname(__FILE__), "<%= path.join("environment").relative_path_from(Pathname.new(bin_dir)) %>"))
3
- load File.expand_path(File.join(File.dirname(__FILE__), "<%= path.join("gems", @spec.full_name, @spec.bindir, bin_file_name).relative_path_from(Pathname.new(bin_dir)) %>"))
@@ -1,4 +0,0 @@
1
- require 'rbconfig'
2
- engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
3
- version = Config::CONFIG['ruby_version']
4
- require File.expand_path("../#{engine}/#{version}/environment", __FILE__)
@@ -1,6 +0,0 @@
1
- require 'rubygems/command_manager'
2
- require 'bundler/commands/bundle_command'
3
- require 'bundler/commands/exec_command'
4
-
5
- Gem::CommandManager.instance.register_command :bundle
6
- Gem::CommandManager.instance.register_command :exec