Skip to content

Commit

Permalink
Showing 3 changed files with 29 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/pom.rb
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@
jar 'org.jruby.jcodings:jcodings:1.0.26'
jar 'org.jruby:dirgra:0.3'

jar 'com.headius:invokebinder:1.9'
jar 'com.headius:invokebinder:1.10'
jar 'com.headius:options:1.4'

jar 'bsf:bsf:2.4.0', :scope => 'provided'
@@ -262,6 +262,7 @@


plugin :shade do
version( '3.1.0' )
execute_goals( 'shade',
:id => 'create lib/jruby.jar',
:phase => 'package',
3 changes: 2 additions & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
@@ -193,7 +193,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.headius</groupId>
<artifactId>invokebinder</artifactId>
<version>1.9</version>
<version>1.10</version>
</dependency>
<dependency>
<groupId>com.headius</groupId>
@@ -599,6 +599,7 @@ DO NOT MODIFIY - GENERATED CODE
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>create lib/jruby.jar</id>
25 changes: 25 additions & 0 deletions lib/ruby/stdlib/yaml/store.rb
Original file line number Diff line number Diff line change
@@ -133,4 +133,29 @@ def open_and_lock_file(filename, read_only)
return file
end
end

# FIXME: These two constants and the method open_and_lock_file should not
# be in this file (taken from pstore). See #4779.
RDWR_ACCESS = {mode: IO::RDWR | IO::CREAT | IO::BINARY, encoding: Encoding::UTF_8}.freeze
RD_ACCESS = {mode: IO::RDONLY | IO::BINARY, encoding: Encoding::UTF_8}.freeze
def open_and_lock_file(filename, read_only)
if read_only
begin
file = File.new(filename, RD_ACCESS)
begin
file.flock(File::LOCK_SH)
return file
rescue
file.close
raise
end
rescue Errno::ENOENT
return nil
end
else
file = File.new(filename, RDWR_ACCESS)
file.flock(File::LOCK_EX)
return file
end
end
end

0 comments on commit b050c57

Please sign in to comment.