New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EXPERIMENTAL] Bundler integration #1536

Closed
wants to merge 59 commits into
base: trunk
from
Commits
File filter...
Filter file types
The table of contents is too big for display.
+60,685 −0
Diff settings

Always

Just for now

Copy path View file
@@ -179,6 +179,10 @@ lcov*.info
/gems/*.gem
/gems/*-*

# /spec/bundler
/.rspec_status
/spec/rspec

# /tool/
/tool/config.guess
/tool/config.sub
Copy path View file
@@ -474,6 +474,20 @@ ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)

enc/encinit.$(OBJEXT): enc/encinit.c $(SETUP)

test-bundler-precheck: $(arch)-fake.rb programs

test-bundler-prepare:
GEM_HOME=$(srcdir)/spec/rspec GEM_PATH=$(srcdir)/spec/rspec \
$(XRUBY) "$(srcdir)/bin/gem" install --no-ri --no-rdoc --conservative 'rspec:~> 3.5'
test-bundler: $(TEST_RUNNABLE)-test-bundler
yes-test-bundler: test-bundler-precheck test-bundler-prepare
$(gnumake_recursive)$(Q) \
GEM_HOME=spec/rspec GEM_PATH=spec/rspec \
BUNDLE_RUBY="$(abspath ./ruby) -I$(abspath $(srcdir)/lib) -I$(abspath .) -I$(abspath $(EXTOUT)/common) -I$(abspath $(EXTOUT)/$(arch))" \
BUNDLE_GEM="$(abspath ./ruby) -I$(abspath $(srcdir)/lib) -I$(abspath .) -I$(abspath $(EXTOUT)/common) -I$(abspath $(EXTOUT)/$(arch)) -rubygems $(abspath $(srcdir)/bin/gem) --backtrace" \
$(XRUBY) -C $(srcdir) -Ispec/bundler "spec/rspec/bin/rspec" --format progress spec/bundler
no-test-bundler:

update-src::
@$(CHDIR) "$(srcdir)" && LC_TIME=C exec $(VCSUP)

Copy path View file
@@ -0,0 +1,31 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Exit cleanly from an early interrupt
Signal.trap("INT") do
Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler)
exit 1
end

require "bundler"
# Check if an older version of bundler is installed
$LOAD_PATH.each do |path|
next unless path =~ %r{/bundler-0\.(\d+)} && $1.to_i < 9
err = String.new
err << "Looks like you have a version of bundler that's older than 0.9.\n"
err << "Please remove your old versions.\n"
err << "An easy way to do this is by running `gem cleanup bundler`."
abort(err)
end

require "bundler/friendly_errors"
Bundler.with_friendly_errors do
require "bundler/cli"

# Allow any command to use --help flag to show help for that command
help_flags = %w(--help -h)
help_flag_used = ARGV.any? {|a| help_flags.include? a }
args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV

Bundler::CLI.start(args, :debug => true)
end
Copy path View file
@@ -0,0 +1,59 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

Signal.trap("INT") { exit 1 }

require "bundler/errors"
require "bundler/ruby_version"
require "bundler/ruby_dsl"
require "bundler/shared_helpers"

module Bundler
class Dsl
include RubyDsl

attr_accessor :ruby_version

def initialize
@ruby_version = nil
end

def eval_gemfile(gemfile, contents = nil)
contents ||= File.open(gemfile, "rb", &:read)
instance_eval(contents, gemfile.to_s, 1)
rescue SyntaxError => e
bt = e.message.split("\n")[1..-1]
raise GemfileError, ["Gemfile syntax error:", *bt].join("\n")
rescue ScriptError, RegexpError, NameError, ArgumentError => e
e.backtrace[0] = "#{e.backtrace[0]}: #{e.message} (#{e.class})"
STDERR.puts e.backtrace.join("\n ")
raise GemfileError, "There was an error in your Gemfile," \
" and Bundler cannot continue."
end

def source(source, options = {})
end

def gem(name, *args)
end

def group(*args)
end
end
end

Bundler::SharedHelpers.major_deprecation("the bundle_ruby executable has been removed in favor of `bundle platform --ruby`")

dsl = Bundler::Dsl.new
begin
dsl.eval_gemfile(Bundler::SharedHelpers.default_gemfile)
ruby_version = dsl.ruby_version
if ruby_version
puts ruby_version
else
puts "No ruby version specified"
end
rescue Bundler::GemfileError => e
puts e.message
exit(-1)
end
Copy path View file
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

load File.expand_path("../bundle", __FILE__)
Copy path View file
@@ -0,0 +1,251 @@
# coding: utf-8
# frozen_string_literal: true
lib = File.expand_path("../lib/", __FILE__)
$:.unshift lib unless $:.include?(lib)
require "bundler/version"

Gem::Specification.new do |s|
s.name = "bundler"
s.version = Bundler::VERSION
s.license = "MIT"
s.authors = [
"André Arko", "Samuel Giddins", "Chris Morris", "James Wen", "Tim Moore",
"André Medeiros", "Jessica Lynn Suttles", "Terence Lee", "Carl Lerche",
"Yehuda Katz"
]
s.email = ["team@bundler.io"]
s.homepage = "http://bundler.io"
s.summary = "The best way to manage your application's dependencies"
s.description = "Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably"

if s.respond_to?(:metadata=)
s.metadata = {
"bug_tracker_uri" => "http://github.com/bundler/bundler/issues",
"changelog_uri" => "https://github.com/bundler/bundler/blob/master/CHANGELOG.md",
"homepage_uri" => "https://bundler.io/",
"source_code_uri" => "http://github.com/bundler/bundler/",
}
end

s.required_ruby_version = ">= 1.8.7"
s.required_rubygems_version = ">= 1.3.6"

s.add_development_dependency "automatiek", "~> 0.1.0"
s.add_development_dependency "mustache", "0.99.6"
s.add_development_dependency "rake", "~> 10.0"
s.add_development_dependency "rdiscount", "~> 2.2"
s.add_development_dependency "ronn", "~> 0.7.3"
s.add_development_dependency "rspec", "~> 3.5"

s.files = [
"lib/bundler.gemspec",
"bin/bundle",
"bin/bundle_ruby",
"bin/bundler",
"lib/bundler.rb",
"lib/bundler/capistrano.rb",
"lib/bundler/cli.rb",
"lib/bundler/cli/add.rb",
"lib/bundler/cli/binstubs.rb",
"lib/bundler/cli/cache.rb",
"lib/bundler/cli/check.rb",
"lib/bundler/cli/clean.rb",
"lib/bundler/cli/common.rb",
"lib/bundler/cli/config.rb",
"lib/bundler/cli/console.rb",
"lib/bundler/cli/doctor.rb",
"lib/bundler/cli/exec.rb",
"lib/bundler/cli/gem.rb",
"lib/bundler/cli/info.rb",
"lib/bundler/cli/init.rb",
"lib/bundler/cli/inject.rb",
"lib/bundler/cli/install.rb",
"lib/bundler/cli/issue.rb",
"lib/bundler/cli/lock.rb",
"lib/bundler/cli/open.rb",
"lib/bundler/cli/outdated.rb",
"lib/bundler/cli/package.rb",
"lib/bundler/cli/platform.rb",
"lib/bundler/cli/plugin.rb",
"lib/bundler/cli/pristine.rb",
"lib/bundler/cli/show.rb",
"lib/bundler/cli/update.rb",
"lib/bundler/cli/viz.rb",
"lib/bundler/compact_index_client.rb",
"lib/bundler/compact_index_client/cache.rb",
"lib/bundler/compact_index_client/updater.rb",
"lib/bundler/constants.rb",
"lib/bundler/current_ruby.rb",
"lib/bundler/definition.rb",
"lib/bundler/dep_proxy.rb",
"lib/bundler/dependency.rb",
"lib/bundler/deployment.rb",
"lib/bundler/deprecate.rb",
"lib/bundler/dsl.rb",
"lib/bundler/endpoint_specification.rb",
"lib/bundler/env.rb",
"lib/bundler/environment_preserver.rb",
"lib/bundler/errors.rb",
"lib/bundler/feature_flag.rb",
"lib/bundler/fetcher.rb",
"lib/bundler/fetcher/base.rb",
"lib/bundler/fetcher/compact_index.rb",
"lib/bundler/fetcher/dependency.rb",
"lib/bundler/fetcher/downloader.rb",
"lib/bundler/fetcher/index.rb",
"lib/bundler/friendly_errors.rb",
"lib/bundler/gem_helper.rb",
"lib/bundler/gem_helpers.rb",
"lib/bundler/gem_remote_fetcher.rb",
"lib/bundler/gem_tasks.rb",
"lib/bundler/gem_version_promoter.rb",
"lib/bundler/gemdeps.rb",
"lib/bundler/graph.rb",
"lib/bundler/index.rb",
"lib/bundler/injector.rb",
"lib/bundler/inline.rb",
"lib/bundler/installer.rb",
"lib/bundler/installer/gem_installer.rb",
"lib/bundler/installer/parallel_installer.rb",
"lib/bundler/installer/standalone.rb",
"lib/bundler/lazy_specification.rb",
"lib/bundler/lockfile_parser.rb",
"lib/bundler/match_platform.rb",
"lib/bundler/mirror.rb",
"lib/bundler/plugin.rb",
"lib/bundler/plugin/api.rb",
"lib/bundler/plugin/api/source.rb",
"lib/bundler/plugin/dsl.rb",
"lib/bundler/plugin/index.rb",
"lib/bundler/plugin/installer.rb",
"lib/bundler/plugin/installer/git.rb",
"lib/bundler/plugin/installer/rubygems.rb",
"lib/bundler/plugin/source_list.rb",
"lib/bundler/psyched_yaml.rb",
"lib/bundler/remote_specification.rb",
"lib/bundler/resolver.rb",
"lib/bundler/retry.rb",
"lib/bundler/ruby_dsl.rb",
"lib/bundler/ruby_version.rb",
"lib/bundler/rubygems_ext.rb",
"lib/bundler/rubygems_gem_installer.rb",
"lib/bundler/rubygems_integration.rb",
"lib/bundler/runtime.rb",
"lib/bundler/settings.rb",
"lib/bundler/setup.rb",
"lib/bundler/shared_helpers.rb",
"lib/bundler/similarity_detector.rb",
"lib/bundler/source.rb",
"lib/bundler/source/gemspec.rb",
"lib/bundler/source/git.rb",
"lib/bundler/source/git/git_proxy.rb",
"lib/bundler/source/path.rb",
"lib/bundler/source/path/installer.rb",
"lib/bundler/source/rubygems.rb",
"lib/bundler/source/rubygems/remote.rb",
"lib/bundler/source_list.rb",
"lib/bundler/spec_set.rb",
"lib/bundler/ssl_certs/.document",
"lib/bundler/ssl_certs/certificate_manager.rb",
"lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem",
"lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem",
"lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem",
"lib/bundler/stub_specification.rb",
"lib/bundler/templates/Executable",
"lib/bundler/templates/Executable.standalone",
"lib/bundler/templates/Gemfile",
"lib/bundler/templates/newgem/.travis.yml.tt",
"lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt",
"lib/bundler/templates/newgem/Gemfile.tt",
"lib/bundler/templates/newgem/LICENSE.txt.tt",
"lib/bundler/templates/newgem/README.md.tt",
"lib/bundler/templates/newgem/Rakefile.tt",
"lib/bundler/templates/newgem/bin/console.tt",
"lib/bundler/templates/newgem/bin/setup.tt",
"lib/bundler/templates/newgem/exe/newgem.tt",
"lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt",
"lib/bundler/templates/newgem/ext/newgem/newgem.c.tt",
"lib/bundler/templates/newgem/ext/newgem/newgem.h.tt",
"lib/bundler/templates/newgem/gitignore.tt",
"lib/bundler/templates/newgem/lib/newgem.rb.tt",
"lib/bundler/templates/newgem/lib/newgem/version.rb.tt",
"lib/bundler/templates/newgem/newgem.gemspec.tt",
"lib/bundler/templates/newgem/rspec.tt",
"lib/bundler/templates/newgem/spec/newgem_spec.rb.tt",
"lib/bundler/templates/newgem/spec/spec_helper.rb.tt",
"lib/bundler/templates/newgem/test/newgem_test.rb.tt",
"lib/bundler/templates/newgem/test/test_helper.rb.tt",
"lib/bundler/ui.rb",
"lib/bundler/ui/rg_proxy.rb",
"lib/bundler/ui/shell.rb",
"lib/bundler/ui/silent.rb",
"lib/bundler/uri_credentials_filter.rb",
"lib/bundler/vendor/molinillo/lib/molinillo.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/errors.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb",
"lib/bundler/vendor/molinillo/lib/molinillo/state.rb",
"lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb",
"lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb",
"lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb",
"lib/bundler/vendor/thor/lib/thor.rb",
"lib/bundler/vendor/thor/lib/thor/actions.rb",
"lib/bundler/vendor/thor/lib/thor/actions/create_file.rb",
"lib/bundler/vendor/thor/lib/thor/actions/create_link.rb",
"lib/bundler/vendor/thor/lib/thor/actions/directory.rb",
"lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb",
"lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb",
"lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb",
"lib/bundler/vendor/thor/lib/thor/base.rb",
"lib/bundler/vendor/thor/lib/thor/command.rb",
"lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb",
"lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb",
"lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb",
"lib/bundler/vendor/thor/lib/thor/error.rb",
"lib/bundler/vendor/thor/lib/thor/group.rb",
"lib/bundler/vendor/thor/lib/thor/invocation.rb",
"lib/bundler/vendor/thor/lib/thor/line_editor.rb",
"lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb",
"lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb",
"lib/bundler/vendor/thor/lib/thor/parser.rb",
"lib/bundler/vendor/thor/lib/thor/parser/argument.rb",
"lib/bundler/vendor/thor/lib/thor/parser/arguments.rb",
"lib/bundler/vendor/thor/lib/thor/parser/option.rb",
"lib/bundler/vendor/thor/lib/thor/parser/options.rb",
"lib/bundler/vendor/thor/lib/thor/rake_compat.rb",
"lib/bundler/vendor/thor/lib/thor/runner.rb",
"lib/bundler/vendor/thor/lib/thor/shell.rb",
"lib/bundler/vendor/thor/lib/thor/shell/basic.rb",
"lib/bundler/vendor/thor/lib/thor/shell/color.rb",
"lib/bundler/vendor/thor/lib/thor/shell/html.rb",
"lib/bundler/vendor/thor/lib/thor/util.rb",
"lib/bundler/vendor/thor/lib/thor/version.rb",
"lib/bundler/vendored_molinillo.rb",
"lib/bundler/vendored_persistent.rb",
"lib/bundler/vendored_thor.rb",
"lib/bundler/version.rb",
"lib/bundler/version_ranges.rb",
"lib/bundler/vlad.rb",
"lib/bundler/worker.rb",
"lib/bundler/yaml_serializer.rb"
]

s.bindir = "exe"
s.executables = %w(bundle bundler)
s.require_paths = ["lib"]
end
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.