aboutsummaryrefslogtreecommitdiffstats
path: root/spec/bundler/support/builders.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-01 23:29:38 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-01 23:29:38 +0000
commitbe7b5929126cb3e696ef222339237faba9b8fe5a (patch)
tree51eae376f93c09bc82dde5a657a91df2c89062e4 /spec/bundler/support/builders.rb
parentae49dbd392083f69026f2a0fff4a1d5f42d172a7 (diff)
downloadruby-be7b5929126cb3e696ef222339237faba9b8fe5a.tar.gz
Update bundled bundler to 1.16.0.
* lib/bundler, spec/bundler: Merge bundler-1.16.0. * common.mk: rspec examples of bundler-1.16.0 needs require option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/bundler/support/builders.rb')
-rw-r--r--spec/bundler/support/builders.rb30
1 files changed, 17 insertions, 13 deletions
diff --git a/spec/bundler/support/builders.rb b/spec/bundler/support/builders.rb
index db128d497b..e8208eacd9 100644
--- a/spec/bundler/support/builders.rb
+++ b/spec/bundler/support/builders.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/shared_helpers"
require "shellwords"
@@ -18,7 +19,7 @@ module Spec
def build_repo1
build_repo gem_repo1 do
- build_gem "rack", %w(0.9.1 1.0.0) do |s|
+ build_gem "rack", %w[0.9.1 1.0.0] do |s|
s.executables = "rackup"
s.post_install_message = "Rack's post install message"
end
@@ -57,7 +58,7 @@ module Spec
build_gem "activeresource", "2.3.2" do |s|
s.add_dependency "activesupport", "2.3.2"
end
- build_gem "activesupport", %w(1.2.3 2.3.2 2.3.5)
+ build_gem "activesupport", %w[1.2.3 2.3.2 2.3.5]
build_gem "activemerchant" do |s|
s.add_dependency "activesupport", ">= 2.0.0"
@@ -256,7 +257,7 @@ module Spec
end
# Capistrano did this (at least until version 2.5.10)
- # Rubygems 2.2 doesn't allow the specifying of a dependency twice
+ # RubyGems 2.2 doesn't allow the specifying of a dependency twice
# See https://github.com/rubygems/rubygems/commit/03dbac93a3396a80db258d9bc63500333c25bd2f
build_gem "double_deps", "1.0", :skip_validation => true do |s|
s.add_dependency "net-ssh", ">= 1.0.0"
@@ -565,7 +566,7 @@ module Spec
# exit 1 unless with_config("simple")
- extension_name = "very_simple_binary_c"
+ extension_name = "#{name}_c"
if extra_lib_dir = with_config("ext-lib")
# add extra libpath if --with-ext-lib is
# passed in as a build_arg
@@ -575,11 +576,11 @@ module Spec
end
create_makefile extension_name
RUBY
- write "ext/very_simple_binary.c", <<-C
+ write "ext/#{name}.c", <<-C
#include "ruby.h"
- void Init_very_simple_binary_c() {
- rb_define_module("VerySimpleBinaryInC");
+ void Init_#{name}_c() {
+ rb_define_module("#{Builders.constantize(name)}_IN_C");
}
C
end
@@ -724,18 +725,21 @@ module Spec
class GemBuilder < LibBuilder
def _build(opts)
lib_path = super(opts.merge(:path => @context.tmp(".tmp/#{@spec.full_name}"), :no_default => opts[:no_default]))
+ destination = opts[:path] || _default_path
Dir.chdir(lib_path) do
- destination = opts[:path] || _default_path
FileUtils.mkdir_p(destination)
@spec.authors = ["that guy"] if !@spec.authors || @spec.authors.empty?
Bundler.rubygems.build(@spec, opts[:skip_validation])
- if opts[:to_system]
- `gem install --ignore-dependencies --no-ri --no-rdoc #{@spec.full_name}.gem`
- else
- FileUtils.mv("#{@spec.full_name}.gem", opts[:path] || _default_path)
- end
+ end
+ gem_path = File.expand_path("#{@spec.full_name}.gem", lib_path)
+ if opts[:to_system]
+ @context.system_gems gem_path, :keep_path => true
+ elsif opts[:to_bundle]
+ @context.system_gems gem_path, :path => :bundle_path, :keep_path => true
+ else
+ FileUtils.mv(gem_path, destination)
end
end