sq_mini_racer 0.2.3.sqreen3 → 0.2.3.sqreen4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f6e44e34841da6851dbd4097b031de215003ef27b152cf6dd922f60eba73375
4
- data.tar.gz: 52a0aa6a719f92572b5a97e70f671c8b36ed35a87c7c2afc77ce8b154b31a9a8
3
+ metadata.gz: 679f35609f5d2a94e34c3457bc820af674e0aeca42c53a7c8ed321d82a8a9b20
4
+ data.tar.gz: 062413bdebc8a6f787d125ebb819243f34f2f2cfe9341d9bf127cf35533bec07
5
5
  SHA512:
6
- metadata.gz: '079694eacfad40bfa86d328071ca29d34266379dd67b9e6a04e86632837693b3f244d2dc9954e6c8a36742ef328f1496ba8822e008889a3ba15c51ff04699064'
7
- data.tar.gz: d7ea69e4391ffaf42b446026a24405a526692a6f68ba67dcdf422a2c16941e148e25f5b097272918ed18392bdf7d01f0661665f60334a07260ed7db46bb55598
6
+ metadata.gz: 30f1eee24877e7672b1c916a0b99c296ec017dab890cb8b197a5d4189edf4e3b52765a946d9774cc2b618e2fb946e4a8517bd8e5ab839d4d2fafc78ee2c01b2a
7
+ data.tar.gz: 65e140b8d96aa420ff53b0e44ef6958158315778a6de39870139f551888c3a2cf031126ceafa34e17c725ac5c0d493099b03f261216a2bba40d2da13bc9c115c
@@ -77,13 +77,44 @@ def libv8_gem_name
77
77
  is_musl ? 'libv8-alpine' : 'libv8'
78
78
  end
79
79
 
80
+ # old rubygem versions prefer source gems to binary ones
81
+ # ... and their --platform switch is broken too, as it leaves the 'ruby'
82
+ # platform in Gem.platforms.
83
+ def force_platform_gem
84
+ gem_version = `gem --version`
85
+ return 'gem' unless $?.success?
86
+
87
+ return 'gem' if gem_version.to_f.zero? || gem_version.to_f >= 2.3
88
+ return 'gem' if RUBY_PLATFORM != 'x86_64-linux'
89
+
90
+ gem_binary = `which gem`
91
+ return 'gem' unless $?.success?
92
+
93
+ ruby = File.foreach(gem_binary.strip).first.sub(/^#!/, '').strip
94
+ unless File.file? ruby
95
+ warn "No valid ruby: #{ruby}"
96
+ return 'gem'
97
+ end
98
+
99
+ require 'tempfile'
100
+ file = Tempfile.new('sq_mini_racer')
101
+ file << <<EOS
102
+ require 'rubygems'
103
+ Gem.platforms.reject! { |it| it == 'ruby' }
104
+ #{IO.read(gem_binary.strip)}
105
+ EOS
106
+ file.close
107
+ "#{ruby} '#{file.path}'"
108
+ end
109
+
80
110
  LIBV8_VERSION = '6.7.288.46.1'
81
111
  libv8_rb = Dir.glob('**/libv8.rb').first
82
112
  FileUtils.mkdir_p('gemdir')
83
113
  unless libv8_rb
84
114
  gem_name = libv8_gem_name
85
- puts "Will try downloading #{gem_name} gem, version #{LIBV8_VERSION}"
86
- `#{fixup_libtinfo} gem install --version '= #{LIBV8_VERSION}' --install-dir gemdir #{gem_name}`
115
+ cmd = "#{fixup_libtinfo} #{force_platform_gem} install --version '= #{LIBV8_VERSION}' --install-dir gemdir #{gem_name}"
116
+ puts "Will try downloading #{gem_name} gem: #{cmd}"
117
+ `#{cmd}`
87
118
  unless $?.success?
88
119
  warn <<EOS
89
120
 
@@ -2,6 +2,6 @@ module Sqreen
2
2
  module MiniRacer
3
3
  # part before qualifier is the number of the last upstream release
4
4
  # since we synced with it
5
- VERSION = "0.2.3.sqreen3"
5
+ VERSION = "0.2.3.sqreen4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sq_mini_racer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3.sqreen3
4
+ version: 0.2.3.sqreen4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron