Ruby 2.6 (and remove backports) gems
This commit is contained in:
parent
e9aba2efb6
commit
a36f00ae8b
82
.gitignore
vendored
82
.gitignore
vendored
@ -35,52 +35,23 @@
|
||||
!**/vendor/bundle/ruby/*/gems/rubocop-rspec-*/config
|
||||
|
||||
# Ignore partially included gems where we don't need all files
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support.rb
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/all.rb
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/cache.rb
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/cache/
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/concurrency/
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/dependencies.rb
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/dependencies/
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/duration/
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/json.rb
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/json/
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/log_subscriber.rb
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/log_subscriber/
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/messages/
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/multibyte/
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/number_helper.rb
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/number_helper/
|
||||
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/testing/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/latest.rb
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/rails.rb
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/version.rb
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/1.*
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/2.0*
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/2.1*
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/2.2*
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/2.3*
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/2.6*
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/2.*.rb
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/force/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/rails/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/random/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/array/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/comparable/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/dir/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/enumerable/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/false_class/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/fixnum/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/float/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/hash/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/integer/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/kernel/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/module/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/nil_class/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/regexp/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/struct/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/struct/
|
||||
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/true_class/
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support.rb
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/all.rb
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/cache.rb
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/cache/
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/concurrency/
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/dependencies.rb
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/dependencies/
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/duration/
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/json.rb
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/json/
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/log_subscriber.rb
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/log_subscriber/
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/messages/
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/multibyte/
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/number_helper.rb
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/number_helper/
|
||||
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/testing/
|
||||
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/atomic/
|
||||
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/atomic_reference/
|
||||
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/collection/
|
||||
@ -91,6 +62,20 @@
|
||||
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/utility/
|
||||
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/*/*.jar
|
||||
**/vendor/bundle/ruby/*/gems/i18n-*/lib/i18n/tests*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/*.rb
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/http/agent.rb
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/http/*auth*.rb
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/c*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/d*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/e*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/f*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/h*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/i*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/p*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/r*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/t*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/u*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/x*
|
||||
**/vendor/bundle/ruby/*/gems/thread_safe-*/lib/thread_safe/util
|
||||
|
||||
# Ignore dependencies we don't wish to vendor
|
||||
@ -147,11 +132,6 @@
|
||||
**/vendor/bundle/ruby/*/gems/unicode-display_width-*/
|
||||
**/vendor/bundle/ruby/*/gems/webrobots-*/
|
||||
|
||||
# Only include the `Mechanize::HTTP::ContentDispositionParser`.
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib
|
||||
!**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/http/content_disposition_parser.rb
|
||||
!**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/version.rb
|
||||
|
||||
# Ignore `bin` contents (again).
|
||||
/bin
|
||||
|
||||
|
@ -15,7 +15,6 @@ gem "simplecov", require: false
|
||||
|
||||
# vendored gems
|
||||
gem "activesupport"
|
||||
gem "backports"
|
||||
gem "concurrent-ruby"
|
||||
gem "mechanize"
|
||||
gem "plist"
|
||||
|
@ -7,7 +7,6 @@ GEM
|
||||
minitest (~> 5.1)
|
||||
tzinfo (~> 1.1)
|
||||
ast (2.4.0)
|
||||
backports (3.15.0)
|
||||
concurrent-ruby (1.1.5)
|
||||
connection_pool (2.2.2)
|
||||
coveralls (0.8.23)
|
||||
@ -116,7 +115,6 @@ PLATFORMS
|
||||
|
||||
DEPENDENCIES
|
||||
activesupport
|
||||
backports
|
||||
concurrent-ruby
|
||||
coveralls (~> 0.8)
|
||||
mechanize
|
||||
|
@ -1,8 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Contains backports from newer versions of Ruby
|
||||
require "backports/2.4.0/string/match"
|
||||
require "backports/2.5.0/string/delete_prefix"
|
||||
require "active_support/core_ext/object/blank"
|
||||
|
||||
class String
|
||||
|
121
Library/Homebrew/vendor/bundle/bundler/setup.rb
vendored
121
Library/Homebrew/vendor/bundle/bundler/setup.rb
vendored
@ -3,65 +3,64 @@ require 'rbconfig'
|
||||
ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
|
||||
ruby_version = RbConfig::CONFIG["ruby_version"]
|
||||
path = File.expand_path('..', __FILE__)
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/concurrent-ruby-1.1.5/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/i18n-1.7.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/minitest-5.12.2/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/thread_safe-0.3.6/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/tzinfo-1.2.5/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/activesupport-5.2.3/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/ast-2.4.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/backports-3.15.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/concurrent-ruby-1.1.5/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/i18n-1.7.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/minitest-5.12.2/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/thread_safe-0.3.6/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tzinfo-1.2.5/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/activesupport-5.2.3/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ast-2.4.0/lib"
|
||||
$:.unshift "#{path}/"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/connection_pool-2.2.2/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/extensions/universal-darwin-19/2.6.0/json-2.2.0"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/json-2.2.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/docile-1.3.2/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/simplecov-html-0.10.2/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/simplecov-0.16.1/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/tins-1.21.1/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/term-ansicolor-1.7.1/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/thor-0.20.3/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/coveralls-0.8.23/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/diff-lcs-1.3/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/extensions/universal-darwin-19/2.6.0/unf_ext-0.0.7.6"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/unf_ext-0.0.7.6/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/unf-0.1.4/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/domain_name-0.5.20190701/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/extensions/universal-darwin-19/2.6.0/hpricot-0.8.6"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/hpricot-0.8.6/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/http-cookie-1.0.3/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/extensions/universal-darwin-19/2.6.0/jaro_winkler-1.5.3"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/jaro_winkler-1.5.3/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/mime-types-data-3.2019.0904/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/mime-types-3.3/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/net-http-digest_auth-1.4.1/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/net-http-persistent-3.1.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/mini_portile2-2.4.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/extensions/universal-darwin-19/2.6.0/nokogiri-1.10.4"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/nokogiri-1.10.4/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/ntlm-http-0.1.1/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/webrobots-0.1.2/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/mechanize-2.7.6/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/mustache-1.1.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/parallel-1.17.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/parallel_tests-2.29.2/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/parser-2.6.5.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/plist-3.5.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/rainbow-3.0.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/extensions/universal-darwin-19/2.6.0/rdiscount-2.2.0.1"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/rdiscount-2.2.0.1/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/ronn-0.7.3/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/rspec-support-3.8.3/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/rspec-core-3.8.2/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/rspec-expectations-3.8.5/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/rspec-mocks-3.8.2/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/rspec-3.8.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/rspec-its-1.3.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/rspec-retry-0.6.1/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/rspec-wait-0.0.9/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/ruby-progressbar-1.10.1/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/unicode-display_width-1.6.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/rubocop-0.75.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/rubocop-performance-1.5.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/rubocop-rspec-1.36.0/lib"
|
||||
$:.unshift "#{path}/../ruby/2.3.0/gems/ruby-macho-2.2.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/connection_pool-2.2.2/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-13/2.6.0-static/json-2.2.0"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/json-2.2.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/docile-1.3.2/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-html-0.10.2/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-0.16.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tins-1.21.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/term-ansicolor-1.7.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/thor-0.20.3/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/coveralls-0.8.23/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/diff-lcs-1.3/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-13/2.6.0-static/unf_ext-0.0.7.6"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unf_ext-0.0.7.6/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unf-0.1.4/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/domain_name-0.5.20190701/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-13/2.6.0-static/hpricot-0.8.6"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/hpricot-0.8.6/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/http-cookie-1.0.3/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-13/2.6.0-static/jaro_winkler-1.5.3"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/jaro_winkler-1.5.3/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mime-types-data-3.2019.1009/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mime-types-3.3/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/net-http-digest_auth-1.4.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/net-http-persistent-3.1.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mini_portile2-2.4.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-13/2.6.0-static/nokogiri-1.10.4"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/nokogiri-1.10.4/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ntlm-http-0.1.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/webrobots-0.1.2/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mechanize-2.7.6/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mustache-1.1.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parallel-1.18.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parallel_tests-2.29.2/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parser-2.6.5.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/plist-3.5.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rainbow-3.0.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-13/2.6.0-static/rdiscount-2.2.0.1"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rdiscount-2.2.0.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ronn-0.7.3/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-support-3.9.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-core-3.9.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-expectations-3.9.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-mocks-3.9.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-3.9.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-its-1.3.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-retry-0.6.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-wait-0.0.9/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.10.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-1.6.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-0.75.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.5.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-1.36.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.2.0/lib"
|
||||
|
@ -1,3 +0,0 @@
|
||||
require "backports/version"
|
||||
require "backports/2.4"
|
||||
require "backports/rails"
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,7 +0,0 @@
|
||||
unless String.method_defined? :match?
|
||||
class String
|
||||
def match?(*args)
|
||||
!match(*args).nil?
|
||||
end
|
||||
end
|
||||
end
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,32 +0,0 @@
|
||||
unless String.method_defined? :delete_prefix
|
||||
require 'backports/tools/arguments'
|
||||
|
||||
class String
|
||||
def delete_prefix(prefix)
|
||||
prefix = Backports.coerce_to_str(prefix)
|
||||
if rindex(prefix, 0)
|
||||
self[prefix.length..-1]
|
||||
else
|
||||
dup
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
unless String.method_defined? :delete_prefix!
|
||||
require 'backports/tools/arguments'
|
||||
|
||||
class String
|
||||
def delete_prefix!(prefix)
|
||||
prefix = Backports.coerce_to_str(prefix)
|
||||
chomp! if frozen?
|
||||
len = prefix.length
|
||||
if len > 0 && rindex(prefix, 0)
|
||||
self[0...prefix.length] = ''
|
||||
self
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,33 +0,0 @@
|
||||
unless String.method_defined? :delete_suffix
|
||||
require 'backports/tools/arguments'
|
||||
|
||||
class String
|
||||
def delete_suffix(suffix)
|
||||
suffix = Backports.coerce_to_str(suffix)
|
||||
len = suffix.length
|
||||
if len > 0 && index(suffix, -len)
|
||||
self[0...-len]
|
||||
else
|
||||
dup
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
unless String.method_defined? :delete_suffix!
|
||||
require 'backports/tools/arguments'
|
||||
|
||||
class String
|
||||
def delete_suffix!(suffix)
|
||||
suffix = Backports.coerce_to_str(suffix)
|
||||
chomp! if frozen?
|
||||
len = suffix.length
|
||||
if len > 0 && index(suffix, -len)
|
||||
self[-len..-1] = ''
|
||||
self
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,65 +0,0 @@
|
||||
unless String.method_defined? :undump
|
||||
class String
|
||||
def undump
|
||||
# Making sure to return a String and not a subclass
|
||||
string = to_s
|
||||
raise 'string contains null byte' if string["\0"]
|
||||
raise 'non-ASCII character detected' unless string.ascii_only?
|
||||
|
||||
#raise '.force_encoding("...") format is not supported by backports' if string.match(/\A".*"\.force_encoding\("[^"]*"\)\z/)
|
||||
match = string.match(/\A(".*?"?)(?:\.force_encoding\("([^"]*)"\))?\z/)
|
||||
if match
|
||||
string = match[1]
|
||||
encoding = match[2]
|
||||
else
|
||||
raise %(invalid dumped string; not wrapped with '"' nor '"...".force_encoding("...")' form)
|
||||
end
|
||||
|
||||
# Ruby 1.9.3 does weird things to encoding during gsub
|
||||
encoding ||= string.encoding.to_s
|
||||
|
||||
# Unescaped have an even number of backslashes in front of them
|
||||
# because the double-quote is included, the unescaped quotes are where the size is odd
|
||||
nb_unescaped_quote = string.scan(/\\*"/).select { |s| s.size.odd? }.size
|
||||
|
||||
raise 'unterminated dumped string' if nb_unescaped_quote == 1
|
||||
|
||||
if string[-1] != '"' || nb_unescaped_quote > 2
|
||||
raise %(invalid dumped string; not wrapped with '"' nor '"...".force_encoding("...")' form)
|
||||
end
|
||||
|
||||
string = string[1...-1]
|
||||
|
||||
if RUBY_VERSION >= '1.9'
|
||||
# Look-arounds are not supported in ruby 1.8. Using a string with Regexp avoids the SyntaxError in 1.8.7
|
||||
# \xY, \x3Y and finishing with \x
|
||||
regex = Regexp.new("(?<!\\)(?:\\\\)*\\x(?![0-9a-f]{2})".gsub('\\', '\\\\\\\\'), Regexp::IGNORECASE)
|
||||
raise 'invalid hex escape' if string[regex]
|
||||
end
|
||||
|
||||
# The real #undump ignores the \C, \c and \M escapes
|
||||
# Code injection is avoided by:
|
||||
# * only allowing \u to have {}, so \\\\#{injection} will not eval the injection
|
||||
# * only allowing the first character after the \\ to not be alpha/num/space, so \\\\#@inst_var_access is ignored
|
||||
# To reduce the number of calls to eval a little, we wrap everything in a (...)+ so that consecutive escapes are
|
||||
# handled at the same time.
|
||||
result = string.gsub(/(\\+(u\{[\w ]+\}|[^cCM][\w]*))+/) do |s|
|
||||
begin
|
||||
eval("\"#{s}\"")
|
||||
rescue SyntaxError => e
|
||||
raise RuntimeError, e.message, e.backtrace
|
||||
end
|
||||
end
|
||||
|
||||
if encoding
|
||||
begin
|
||||
Encoding.find(encoding)
|
||||
rescue ArgumentError
|
||||
raise "dumped string has unknown encoding name"
|
||||
end
|
||||
result = result.force_encoding(encoding)
|
||||
end
|
||||
result
|
||||
end
|
||||
end
|
||||
end
|
@ -1,3 +0,0 @@
|
||||
require 'backports/tools/require_relative_dir'
|
||||
|
||||
Backports.require_relative_dir
|
@ -1,53 +0,0 @@
|
||||
# Note: Must be required explicitely!
|
||||
# This is a best attempt to fake BasicObject in Ruby 1.8.x
|
||||
# What you do get:
|
||||
# * as few methods as the real BasicObject (at the moment the library is required...)
|
||||
# * BasicObject === <anything> # ==> returns true
|
||||
# What you don't get:
|
||||
# * BasicObject is not in the ancestor list of all classes and thus
|
||||
# * Comparisons between classes won't work, e.g.
|
||||
# Object < BasicObject # ==> returns true instead of false
|
||||
# * Instance methods added to Object or Kernel after you require 'backports/basic_object'
|
||||
# might also be available in instances of BasicObject and subclasses
|
||||
# (they will only be undefined whenever a subclass of BasicObject is created)
|
||||
# Because of all the fineprint, BasicObject must be required explicitely
|
||||
|
||||
unless Object.const_defined? :BasicObject
|
||||
|
||||
class BasicObject
|
||||
KEEP = %w[== equal? ! != instance_eval instance_exec __send__]
|
||||
KEEP.concat KEEP.map { |e| e.to_sym }
|
||||
|
||||
# undefine almost all instance methods
|
||||
begin
|
||||
old_verbose, $VERBOSE = $VERBOSE, nil # silence the warning for undefining __id__
|
||||
(instance_methods - KEEP).each do |method|
|
||||
undef_method method
|
||||
end
|
||||
ensure
|
||||
$VERBOSE = old_verbose
|
||||
end
|
||||
|
||||
class << self
|
||||
def === (cmp)
|
||||
true
|
||||
end
|
||||
|
||||
# Let's try to keep things clean, in case methods have been added to Object
|
||||
# either directly or through an included module.
|
||||
# We'll do this whenever a class is derived from BasicObject
|
||||
# Ideally, we'd do this by trapping Object.method_added
|
||||
# and M.method_added for any module M included in Object or a submodule
|
||||
# Seems really though to get right, but pull requests welcome ;-)
|
||||
def inherited(sub)
|
||||
BasicObject.class_eval do
|
||||
(instance_methods - KEEP).each do |method|
|
||||
if Object.method_defined?(method) && instance_method(method).owner == Object.instance_method(method).owner
|
||||
undef_method method
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,24 +0,0 @@
|
||||
# Will intercept future and past 'require' calls of std_lib
|
||||
# and load additionally the updated libraries.
|
||||
require 'backports/tools/std_lib'
|
||||
require 'backports/tools/alias_method_chain'
|
||||
|
||||
module Kernel
|
||||
def require_with_backports(lib)
|
||||
begin
|
||||
return false unless require_without_backports(lib)
|
||||
paths = Backports::StdLib.extended_lib.fetch(lib, nil)
|
||||
rescue LoadError
|
||||
return false if Backports::StdLib::LoadedFeatures.new.include?(lib)
|
||||
raise unless paths = Backports::StdLib.extended_lib.fetch(lib, nil)
|
||||
Backports::StdLib::LoadedFeatures.mark_as_loaded(lib)
|
||||
end
|
||||
if paths
|
||||
paths.each do |path|
|
||||
require_without_backports(path)
|
||||
end
|
||||
end
|
||||
true
|
||||
end
|
||||
Backports.alias_method_chain self, :require, :backports
|
||||
end
|
@ -1,3 +0,0 @@
|
||||
# Methods used internally by the backports.
|
||||
require 'backports/tools/require_relative_dir'
|
||||
Backports.require_relative_dir
|
@ -1,8 +0,0 @@
|
||||
module Backports
|
||||
# Safe alias_method that will only alias if the source exists and destination doesn't
|
||||
def self.alias_method(mod, new_name, old_name)
|
||||
mod.instance_eval do
|
||||
alias_method new_name, old_name
|
||||
end if mod.method_defined?(old_name) && !mod.method_defined?(new_name)
|
||||
end
|
||||
end
|
@ -1,26 +0,0 @@
|
||||
module Backports
|
||||
# Modified to avoid polluting Module if so desired
|
||||
# (from Rails)
|
||||
def self.alias_method_chain(mod, target, feature)
|
||||
mod.class_eval do
|
||||
# Strip out punctuation on predicates or bang methods since
|
||||
# e.g. target?_without_feature is not a valid method name.
|
||||
aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1
|
||||
yield(aliased_target, punctuation) if block_given?
|
||||
|
||||
with_method, without_method = "#{aliased_target}_with_#{feature}#{punctuation}", "#{aliased_target}_without_#{feature}#{punctuation}"
|
||||
|
||||
alias_method without_method, target
|
||||
alias_method target, with_method
|
||||
|
||||
case
|
||||
when public_method_defined?(without_method)
|
||||
public target
|
||||
when protected_method_defined?(without_method)
|
||||
protected target
|
||||
when private_method_defined?(without_method)
|
||||
private target
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,69 +0,0 @@
|
||||
module Backports
|
||||
# Helper method to coerce a value into a specific class.
|
||||
# Raises a TypeError if the coercion fails or the returned value
|
||||
# is not of the right class.
|
||||
# (from Rubinius)
|
||||
def self.coerce_to(obj, cls, meth)
|
||||
return obj if obj.kind_of?(cls)
|
||||
|
||||
begin
|
||||
ret = obj.__send__(meth)
|
||||
rescue Exception => e
|
||||
raise TypeError, "Coercion error: #{obj.inspect}.#{meth} => #{cls} failed:\n" \
|
||||
"(#{e.message})"
|
||||
end
|
||||
raise TypeError, "Coercion error: obj.#{meth} did NOT return a #{cls} (was #{ret.class})" unless ret.kind_of? cls
|
||||
ret
|
||||
end
|
||||
|
||||
def self.coerce_to_int(obj)
|
||||
coerce_to(obj, Integer, :to_int)
|
||||
end
|
||||
|
||||
def self.coerce_to_ary(obj)
|
||||
coerce_to(obj, Array, :to_ary)
|
||||
end
|
||||
|
||||
def self.coerce_to_str(obj)
|
||||
coerce_to(obj, String, :to_str)
|
||||
end
|
||||
|
||||
def self.coerce_to_hash(obj)
|
||||
coerce_to(obj, Hash, :to_hash)
|
||||
end
|
||||
|
||||
def self.coerce_to_options(obj, *options)
|
||||
hash = coerce_to_hash(obj)
|
||||
hash.values_at(*options)
|
||||
end
|
||||
|
||||
def self.coerce_to_option(obj, option)
|
||||
coerce_to_options(obj, option)[0]
|
||||
end
|
||||
|
||||
def self.is_array?(obj)
|
||||
coerce_to(obj, Array, :to_ary) if obj.respond_to? :to_ary
|
||||
end
|
||||
|
||||
def self.try_convert(obj, cls, meth)
|
||||
return obj if obj.kind_of?(cls)
|
||||
return nil unless obj.respond_to?(meth)
|
||||
ret = obj.__send__(meth)
|
||||
raise TypeError, "Coercion error: obj.#{meth} did NOT return a #{cls} (was #{ret.class})" unless ret.nil? || ret.kind_of?(cls)
|
||||
ret
|
||||
end
|
||||
|
||||
# Checks for a failed comparison (in which case it throws an ArgumentError)
|
||||
# Additionally, it maps any negative value to -1 and any positive value to +1
|
||||
# (from Rubinius)
|
||||
def self.coerce_to_comparison(a, b, cmp = (a <=> b))
|
||||
raise ArgumentError, "comparison of #{a} with #{b} failed" if cmp.nil?
|
||||
return 1 if cmp > 0
|
||||
return -1 if cmp < 0
|
||||
0
|
||||
end
|
||||
|
||||
# Used internally to make it easy to deal with optional arguments
|
||||
# (from Rubinius)
|
||||
Undefined = Object.new
|
||||
end
|
@ -1,12 +0,0 @@
|
||||
module Backports
|
||||
MOST_EXTREME_OBJECT_EVER = Object.new # :nodoc:
|
||||
class << MOST_EXTREME_OBJECT_EVER
|
||||
def <(whatever)
|
||||
true
|
||||
end
|
||||
|
||||
def >(whatever)
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
@ -1,17 +0,0 @@
|
||||
module Backports
|
||||
class << self
|
||||
def float_to_integer(float)
|
||||
map_via_packing(float, 'D', 'q')
|
||||
end
|
||||
|
||||
def integer_to_float(int)
|
||||
map_via_packing(int, 'q', 'D')
|
||||
end
|
||||
|
||||
private
|
||||
def map_via_packing(nb, pack, unpack)
|
||||
result, = [nb.abs].pack(pack).unpack(unpack)
|
||||
nb < 0 ? -result : result
|
||||
end
|
||||
end
|
||||
end
|
@ -1,57 +0,0 @@
|
||||
require 'backports/tools/arguments'
|
||||
module Backports
|
||||
# Used internally to combine {IO|File} options hash into mode (String or Integer)
|
||||
def self.combine_mode_and_option(mode = nil, options = Backports::Undefined)
|
||||
# Can't backport autoclose, {internal|external|}encoding
|
||||
mode, options = nil, mode if mode.respond_to?(:to_hash) && options == Backports::Undefined
|
||||
options = {} if options == nil || options == Backports::Undefined
|
||||
options = coerce_to_hash(options)
|
||||
if mode && options[:mode]
|
||||
raise ArgumentError, "mode specified twice"
|
||||
end
|
||||
mode ||= options[:mode] || "r"
|
||||
mode = try_convert(mode, String, :to_str) || try_convert(mode, Integer, :to_int) || mode
|
||||
if options[:textmode] || options[:binmode]
|
||||
text = options[:textmode] || (mode.is_a?(String) && mode =~ /t/)
|
||||
bin = options[:binmode] || (mode.is_a?(String) ? mode =~ /b/ : mode & File::Constants::BINARY != 0)
|
||||
if text && bin
|
||||
raise ArgumentError, "both textmode and binmode specified"
|
||||
end
|
||||
case
|
||||
when !options[:binmode]
|
||||
when mode.is_a?(String)
|
||||
mode.insert(1, "b")
|
||||
else
|
||||
mode |= File::Constants::BINARY
|
||||
end
|
||||
end
|
||||
mode
|
||||
end
|
||||
|
||||
# Used internally to combine {IO|File} options hash into mode (String or Integer) and perm
|
||||
def self.combine_mode_perm_and_option(mode = nil, perm = Backports::Undefined, options = Backports::Undefined)
|
||||
mode, options = nil, mode if mode.respond_to?(:to_hash) && perm == Backports::Undefined
|
||||
perm, options = nil, perm if perm.respond_to?(:to_hash) && options == Backports::Undefined
|
||||
perm = nil if perm == Backports::Undefined
|
||||
options = {} if options == Backports::Undefined
|
||||
options = coerce_to_hash(options)
|
||||
if perm && options[:perm]
|
||||
raise ArgumentError, "perm specified twice"
|
||||
end
|
||||
[combine_mode_and_option(mode, options), perm || options[:perm]]
|
||||
end
|
||||
|
||||
def self.write(binary, filename, string, offset, options)
|
||||
offset, options = nil, offset if offset.respond_to?(:to_hash) && options == Backports::Undefined
|
||||
options = {} if options == Backports::Undefined
|
||||
options = coerce_to_hash(options)
|
||||
File.open(filename, 'a+'){} if offset # insure existence
|
||||
options = {:mode => offset.nil? ? "w" : "r+"}.merge(options)
|
||||
args = options[:open_args] || [options]
|
||||
File.open(filename, *Backports.combine_mode_perm_and_option(*args)) do |f|
|
||||
f.binmode if binary && f.respond_to?(:binmode)
|
||||
f.seek(offset) unless offset.nil?
|
||||
f.write(string)
|
||||
end
|
||||
end
|
||||
end
|
@ -1,43 +0,0 @@
|
||||
require 'backports/tools/alias_method_chain'
|
||||
|
||||
module Backports
|
||||
# Metaprogramming utility to make block optional.
|
||||
# Tests first if block is already optional when given options
|
||||
def self.make_block_optional(mod, *methods)
|
||||
mod = class << mod; self; end unless mod.is_a? Module
|
||||
options = methods.last.is_a?(Hash) ? methods.pop : {}
|
||||
methods.each do |selector|
|
||||
unless mod.method_defined? selector
|
||||
warn "#{mod}##{selector} is not defined, so block can't be made optional"
|
||||
next
|
||||
end
|
||||
unless options[:force]
|
||||
# Check if needed
|
||||
test_on = options.fetch(:test_on)
|
||||
result = begin
|
||||
test_on.send(selector, *options.fetch(:arg, []))
|
||||
rescue LocalJumpError
|
||||
false
|
||||
end
|
||||
next if result.class.name =~ /Enumerator/
|
||||
end
|
||||
require 'enumerator'
|
||||
arity = mod.instance_method(selector).arity
|
||||
last_arg = []
|
||||
if arity < 0
|
||||
last_arg = ["*rest"]
|
||||
arity = -1-arity
|
||||
end
|
||||
arg_sequence = ((0...arity).map{|i| "arg_#{i}"} + last_arg + ["&block"]).join(", ")
|
||||
|
||||
alias_method_chain(mod, selector, :optional_block) do |aliased_target, punctuation|
|
||||
mod.module_eval <<-end_eval, __FILE__, __LINE__ + 1
|
||||
def #{aliased_target}_with_optional_block#{punctuation}(#{arg_sequence})
|
||||
return to_enum(:#{aliased_target}_without_optional_block#{punctuation}, #{arg_sequence}) unless block_given?
|
||||
#{aliased_target}_without_optional_block#{punctuation}(#{arg_sequence})
|
||||
end
|
||||
end_eval
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
File diff suppressed because it is too large
Load Diff
@ -1,55 +0,0 @@
|
||||
require 'backports/tools/alias_method_chain'
|
||||
require 'backports/tools/arguments'
|
||||
|
||||
module Backports
|
||||
# Metaprogramming utility to convert the first file argument to path
|
||||
def self.convert_first_argument_to_path(klass, selector)
|
||||
mod = class << klass; self; end
|
||||
unless mod.method_defined? selector
|
||||
warn "#{mod}##{selector} is not defined, so argument can't converted to path"
|
||||
return
|
||||
end
|
||||
arity = mod.instance_method(selector).arity
|
||||
last_arg = []
|
||||
if arity < 0
|
||||
last_arg = ["*rest"]
|
||||
arity = -1-arity
|
||||
end
|
||||
arg_sequence = (["file"] + (1...arity).map{|i| "arg_#{i}"} + last_arg + ["&block"]).join(", ")
|
||||
|
||||
alias_method_chain(mod, selector, :potential_path_argument) do |aliased_target, punctuation|
|
||||
mod.module_eval <<-end_eval, __FILE__, __LINE__ + 1
|
||||
def #{aliased_target}_with_potential_path_argument#{punctuation}(#{arg_sequence})
|
||||
file = Backports.convert_path(file)
|
||||
#{aliased_target}_without_potential_path_argument#{punctuation}(#{arg_sequence})
|
||||
end
|
||||
end_eval
|
||||
end
|
||||
end
|
||||
|
||||
# Metaprogramming utility to convert all file arguments to paths
|
||||
def self.convert_all_arguments_to_path(klass, selector, skip)
|
||||
mod = class << klass; self; end
|
||||
unless mod.method_defined? selector
|
||||
warn "#{mod}##{selector} is not defined, so arguments can't converted to path"
|
||||
return
|
||||
end
|
||||
first_args = (1..skip).map{|i| "arg_#{i}"}.join(",") + (skip > 0 ? "," : "")
|
||||
alias_method_chain(mod, selector, :potential_path_arguments) do |aliased_target, punctuation|
|
||||
mod.module_eval <<-end_eval, __FILE__, __LINE__ + 1
|
||||
def #{aliased_target}_with_potential_path_arguments#{punctuation}(#{first_args}*files, &block)
|
||||
files = files.map{|f| Backports.convert_path(f) }
|
||||
#{aliased_target}_without_potential_path_arguments#{punctuation}(#{first_args}*files, &block)
|
||||
end
|
||||
end_eval
|
||||
end
|
||||
end
|
||||
|
||||
def self.convert_path(path)
|
||||
try_convert(path, IO, :to_io) ||
|
||||
begin
|
||||
path = path.to_path if path.respond_to?(:to_path)
|
||||
try_convert(path, String, :to_str) || path
|
||||
end
|
||||
end
|
||||
end
|
@ -1,13 +0,0 @@
|
||||
module Backports
|
||||
def self.require_relative_dir
|
||||
dir = caller.first.split(/\.rb:\d/,2).first
|
||||
short_path = dir[/.*(backports\/.*)/, 1] << '/'
|
||||
Dir.entries(dir).
|
||||
map{|f| Regexp.last_match(1) if /^(.*)\.rb$/ =~ f}.
|
||||
compact.
|
||||
sort.
|
||||
each do |f|
|
||||
require short_path + f
|
||||
end
|
||||
end
|
||||
end
|
@ -1,59 +0,0 @@
|
||||
module Backports
|
||||
module StdLib
|
||||
class LoadedFeatures
|
||||
if RUBY_VERSION >= "1.9"
|
||||
# Full paths are recorded in $LOADED_FEATURES.
|
||||
@@our_loads = {}
|
||||
# Check loaded features for one that matches "#{any of the load path}/#{feature}"
|
||||
def include?(feature)
|
||||
return true if @@our_loads[feature]
|
||||
# Assume backported features are Ruby libraries (i.e. not C)
|
||||
@loaded ||= $LOADED_FEATURES.group_by{|p| File.basename(p, ".rb")}
|
||||
if fullpaths = @loaded[File.basename(feature, ".rb")]
|
||||
fullpaths.any?{|fullpath|
|
||||
base_dir, = fullpath.partition("/#{feature}")
|
||||
$LOAD_PATH.include?(base_dir)
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def self.mark_as_loaded(feature)
|
||||
@@our_loads[feature] = true
|
||||
# Nothing to do, the full path will be OK
|
||||
end
|
||||
|
||||
else
|
||||
# Requested features are recorded in $LOADED_FEATURES
|
||||
def include?(feature)
|
||||
# Assume backported features are Ruby libraries (i.e. not C)
|
||||
$LOADED_FEATURES.include?("#{File.basename(feature, '.rb')}.rb")
|
||||
end
|
||||
|
||||
def self.mark_as_loaded(feature)
|
||||
$LOADED_FEATURES << "#{File.basename(feature, '.rb')}.rb"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class << self
|
||||
attr_accessor :extended_lib
|
||||
|
||||
def extend_relative relative_dir="stdlib"
|
||||
loaded = Backports::StdLib::LoadedFeatures.new
|
||||
dir = File.expand_path(relative_dir, File.dirname(caller.first.split(/:\d/,2).first))
|
||||
Dir.entries(dir).
|
||||
map{|f| Regexp.last_match(1) if /^(.*)\.rb$/ =~ f}.
|
||||
compact.
|
||||
each do |f|
|
||||
path = File.expand_path(f, dir)
|
||||
if loaded.include?(f)
|
||||
require path
|
||||
else
|
||||
@extended_lib[f] << path
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
self.extended_lib ||= Hash.new{|h, k| h[k] = []}
|
||||
end
|
||||
end
|
@ -1,9 +0,0 @@
|
||||
module Backports
|
||||
def self.suppress_verbose_warnings
|
||||
before = $VERBOSE
|
||||
$VERBOSE = false if $VERBOSE # Set to false (default warning) but not nil (no warnings)
|
||||
yield
|
||||
ensure
|
||||
$VERBOSE = before
|
||||
end
|
||||
end
|
1
Library/Homebrew/vendor/bundle/ruby/2.4.0
vendored
1
Library/Homebrew/vendor/bundle/ruby/2.4.0
vendored
@ -1 +0,0 @@
|
||||
2.3.0
|
1
Library/Homebrew/vendor/bundle/ruby/2.5.0
vendored
1
Library/Homebrew/vendor/bundle/ruby/2.5.0
vendored
@ -1 +0,0 @@
|
||||
2.3.0
|
1
Library/Homebrew/vendor/bundle/ruby/2.6.0
vendored
1
Library/Homebrew/vendor/bundle/ruby/2.6.0
vendored
@ -1 +0,0 @@
|
||||
2.3.0
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user