Module: RubyGems::Runtime::GemExtensions
- Included in:
- Gem
- Defined in:
- lib/rubygems/runtime/gem_extensions.rb
Constant Summary collapse
- WIN_PATTERNS =
[/bccwin/i, /cygwin/i, /djgpp/i, /mingw/i, /mswin/i, /wince/i]
- @@win_platform =
nil
Instance Method Summary collapse
-
#default_dir ⇒ Object
Copied from RubyGems v3.6.9 lib/rubygems/defaults/operating_system.rb:10.
-
#extension_api_version ⇒ Object
Copied from RubyGems v3.6.9 lib/rubygems.rb:479.
-
#freebsd_platform? ⇒ Boolean
Copied from RubyGems v3.6.9 lib/rubygems.rb:1061.
-
#java_platform? ⇒ Boolean
Copied from RubyGems v3.6.9 lib/rubygems.rb:1047.
-
#location_of_caller(depth = 1) ⇒ Object
Copied from RubyGems v3.6.9 lib/rubygems.rb:653.
- #path ⇒ Object
- #ruby ⇒ Object
-
#ruby_api_version ⇒ Object
Copied from RubyGems v3.6.9 lib/rubygems.rb:855.
-
#solaris_platform? ⇒ Boolean
Copied from RubyGems v3.6.9 lib/rubygems.rb:1054.
- #target_rbconfig ⇒ Object
-
#win_platform? ⇒ Boolean
Copied from RubyGems v3.6.9 lib/rubygems.rb:1035.
Instance Method Details
#default_dir ⇒ Object
Copied from RubyGems v3.6.9 lib/rubygems/defaults/operating_system.rb:10
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rubygems/runtime/gem_extensions.rb', line 36 def default_dir path = [ "/opt/homebrew", "lib", "ruby", "gems", RbConfig::CONFIG['ruby_version'] ] @homebrew_path ||= File.join(*path) end |
#extension_api_version ⇒ Object
Copied from RubyGems v3.6.9 lib/rubygems.rb:479
27 28 29 30 31 32 33 |
# File 'lib/rubygems/runtime/gem_extensions.rb', line 27 def extension_api_version # :nodoc: if target_rbconfig["ENABLE_SHARED"] == "no" "#{ruby_api_version}-static" else ruby_api_version end end |
#freebsd_platform? ⇒ Boolean
Copied from RubyGems v3.6.9 lib/rubygems.rb:1061
78 79 80 |
# File 'lib/rubygems/runtime/gem_extensions.rb', line 78 def freebsd_platform? RbConfig::CONFIG["host_os"].to_s.include?("bsd") end |
#java_platform? ⇒ Boolean
Copied from RubyGems v3.6.9 lib/rubygems.rb:1047
68 69 70 |
# File 'lib/rubygems/runtime/gem_extensions.rb', line 68 def java_platform? RUBY_PLATFORM == "java" end |
#location_of_caller(depth = 1) ⇒ Object
Copied from RubyGems v3.6.9 lib/rubygems.rb:653
49 50 51 52 53 54 55 |
# File 'lib/rubygems/runtime/gem_extensions.rb', line 49 def location_of_caller(depth = 1) caller[depth] =~ /(.*?):(\d+).*?$/i file = $1 lineno = $2.to_i [file, lineno] end |
#path ⇒ Object
17 18 19 |
# File 'lib/rubygems/runtime/gem_extensions.rb', line 17 def path [default_dir] end |
#ruby ⇒ Object
9 10 11 |
# File 'lib/rubygems/runtime/gem_extensions.rb', line 9 def ruby ::RbConfig.ruby end |
#ruby_api_version ⇒ Object
Copied from RubyGems v3.6.9 lib/rubygems.rb:855
22 23 24 |
# File 'lib/rubygems/runtime/gem_extensions.rb', line 22 def ruby_api_version @ruby_api_version ||= target_rbconfig["ruby_version"].dup end |
#solaris_platform? ⇒ Boolean
Copied from RubyGems v3.6.9 lib/rubygems.rb:1054
73 74 75 |
# File 'lib/rubygems/runtime/gem_extensions.rb', line 73 def solaris_platform? RUBY_PLATFORM.include?("solaris") end |
#target_rbconfig ⇒ Object
13 14 15 |
# File 'lib/rubygems/runtime/gem_extensions.rb', line 13 def target_rbconfig ::RbConfig::CONFIG end |
#win_platform? ⇒ Boolean
Copied from RubyGems v3.6.9 lib/rubygems.rb:1035
58 59 60 61 62 63 64 65 |
# File 'lib/rubygems/runtime/gem_extensions.rb', line 58 def win_platform? if @@win_platform.nil? ruby_platform = RbConfig::CONFIG["host_os"] @@win_platform = !WIN_PATTERNS.find {|r| ruby_platform =~ r }.nil? end @@win_platform end |