Module: Gem
- Defined in:
- lib/bundler/rubygems_ext.rb
Defined Under Namespace
Modules: BetterPermissionError, FixFullNameEncoding, UnfreezeCompactIndexParsedResponse
Classes: BasicSpecification, Dependency, NameTuple, Package, Platform, Specification, SpecificationPolicy, StubSpecification
Constant Summary
collapse
- VALIDATES_FOR_RESOLUTION =
Can be removed once RubyGems 3.5.14 support is dropped
Specification.new.respond_to?(:validate_for_resolution).freeze
Class Method Summary
collapse
Class Method Details
19
20
21
|
# File 'lib/bundler/rubygems_ext.rb', line 19
def self.freebsd_platform?
RbConfig::CONFIG["host_os"].to_s.include?("bsd")
end
|
.open_file_with_flock(path, &block) ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/bundler/rubygems_ext.rb', line 29
def open_file_with_flock(path, &block)
mode = IO::RDWR | IO::APPEND | IO::CREAT | IO::BINARY
mode |= IO::SHARE_DELETE if IO.const_defined?(:SHARE_DELETE)
File.open(path, mode) do |io|
begin
io.flock(File::LOCK_EX)
rescue Errno::ENOSYS, Errno::ENOTSUP
end
yield io
end
end
|
.open_file_with_lock(path, &block) ⇒ Object
43
44
45
46
47
48
|
# File 'lib/bundler/rubygems_ext.rb', line 43
def open_file_with_lock(path, &block)
file_lock = "#{path}.lock"
open_file_with_flock(file_lock, &block)
ensure
FileUtils.rm_f file_lock
end
|