Skip to content
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 from
Closed
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
c455877
Import rubygems/rubygems@3841d147b25531a68f3eb2fa943a5ad736ec98d8
hsbt Jul 10, 2017
7b6792a
Import bundler-1.14.3 for rubygems integration
hsbt Jul 10, 2017
3c2fa2b
Enable to invoke bundler's spec files on ruby core
hsbt Jul 11, 2017
9e4c75c
Fixed nil references for bundler gemspec.
hsbt Jul 19, 2017
389331c
Run bundler examples with ruby trunk
hsbt Jul 19, 2017
1729052
Removed bundler's examples on ruby source tree.
hsbt Jul 19, 2017
ed9ace5
To use XRUBY for git clone of bundler repository
hsbt Jul 19, 2017
1775207
WIP
hsbt Jul 19, 2017
5786c5c
Enabled to work bundler specs with ruby binary on trunk
hsbt Jul 20, 2017
312f4d2
Exclude documentation examples with groff command
hsbt Jul 20, 2017
9129125
Update bundler workaround
hsbt Jul 21, 2017
3949114
Update bundler-1.15.2
hsbt Jul 21, 2017
7458ae8
bump up v1.15.2
hsbt Jul 21, 2017
342ec1c
Update a patch for bundler-1.15.2
hsbt Jul 21, 2017
80d8b41
Ignored native extension builds
hsbt Jul 24, 2017
385e8b7
Ignored only native build specs
hsbt Jul 24, 2017
188cc8d
Workaround for ruby interpriter location for sys_exec
hsbt Jul 24, 2017
f31e7ed
Workaround for non-installed ruby interpriter.
hsbt Jul 25, 2017
fd03825
Added tests of bundler to travis
hsbt Jul 26, 2017
4fdf95d
Revert "Import rubygems/rubygems@3841d147b25531a68f3eb2fa943a5ad736ec…
hsbt Sep 1, 2017
e4560ae
Reverted wrong changes
hsbt Sep 1, 2017
74b22f3
Bump version to bundler-1.15.4
hsbt Sep 1, 2017
f1bad94
support bundler sync task
hsbt Sep 1, 2017
f70194b
Merge bundler-1.15.4
hsbt Sep 1, 2017
dcd785b
Merge bundler's examples
hsbt Sep 2, 2017
b12fca4
Do not use git clone for bundler mirror
hsbt Sep 2, 2017
52fcbf6
Applied to patch for bundler's examples. It containns workaround for …
hsbt Sep 2, 2017
7807528
Change working direcotry for bundler
hsbt Sep 2, 2017
6b7b08c
Modified support library path for bundler
hsbt Sep 2, 2017
6c4a4e3
ignonred .rspec_status
hsbt Sep 2, 2017
8c9e16d
Workaround for bundle bin path
hsbt Sep 2, 2017
9b2e85b
Workaround for bundle lib and spec paths
hsbt Sep 2, 2017
c367a4d
To use root directory of ruby source tree for bundler spec
hsbt Sep 2, 2017
7418dbe
Workaround for ruby core structure
hsbt Sep 2, 2017
9f22ee3
Adjust exe path
hsbt Sep 2, 2017
b2473ea
Shared temporary directory
hsbt Sep 3, 2017
fb15f44
Support ruby core testing suite
hsbt Sep 3, 2017
86d81d7
Support to ruby core test paths
hsbt Sep 3, 2017
23571e5
Ignored default gems examples
hsbt Sep 3, 2017
5602ac0
Workaround for ruby core structure
hsbt Sep 3, 2017
f1ecb79
Fixed broken specs for exec paths.
hsbt Sep 3, 2017
5c61b08
Exclude built examples and git depends examples
hsbt Sep 3, 2017
1b75f1e
Do not cleanup after hook on Ruby core suite
hsbt Sep 3, 2017
d6436a9
Exclude nested bundle command, because it used differenct directory s…
hsbt Sep 3, 2017
79e11b1
Restore rubygems's certificates for budler's example
hsbt Sep 3, 2017
e924f2a
To use Spec::Path.root for Ruby core workaround
hsbt Sep 4, 2017
57d8f02
Integrate exec file path to support file on rspec
hsbt Sep 4, 2017
df6e02d
To use Spec::Path.tmp instead of hard coding
hsbt Sep 4, 2017
72c868c
rename
hsbt Sep 4, 2017
ff8948f
Added Spec::Path.spec and use it on bundler specs
hsbt Sep 4, 2017
11db401
To use Spec::Path.gemspec
hsbt Sep 4, 2017
838bca4
Change condition for detecting ruby core environment
hsbt Sep 5, 2017
0b1923f
To use Spec::Path.bin
hsbt Sep 5, 2017
312ab62
Rename ruby_trunk to ruby_repo
hsbt Sep 5, 2017
24cdd43
Extract git ls-files results for ruby core
hsbt Sep 5, 2017
0fc5f5c
oops...
hsbt Sep 5, 2017
81c59aa
Removed test-bundler task from Travis. Because Travis couldn't instal…
hsbt Sep 5, 2017
884465c
To use Spec::Path.root
hsbt Sep 6, 2017
2f8d36a
Applied to bundler team feedbacks
hsbt Sep 7, 2017
File filter
Filter file types
Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.

Always

Just for now

@@ -179,6 +179,10 @@ lcov*.info
/gems/*.gem
/gems/*-*

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

# /tool/
/tool/config.guess
/tool/config.sub
@@ -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)

@@ -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
@@ -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
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

load File.expand_path("../bundle", __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