Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0878ef089df7
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7edda4828667
Choose a head ref
  • 10 commits
  • 9 files changed
  • 3 contributors

Commits on Dec 2, 2014

  1. fix File.readable? when native is disabled

    this readable? method now follows the same pattern as writable?, file?,
    directory? and exists? and uses the respective FileResource directly.
    
    fixes #2040 and #1983
    
    Sponsored by Lookout Inc.
    mkristian committed Dec 2, 2014
    Copy the full SHA
    8a5ea5c View commit details
  2. get better pattern matching for uri-like path for jirb

    if the path to jruby-complete.jar contains a space the various
    uri-like path strings do not match (file: or no protocol, ' ' or '%20')
    should be treated equaly.
    
    Sponsored by Lookout Inc.
    mkristian committed Dec 2, 2014
    Copy the full SHA
    329bad2 View commit details
  3. Copy the full SHA
    f0aaf44 View commit details
  4. Add a spec:ruby:fast target that avoids subprocess-spawning specs.

    Conflicts:
    	rakelib/rubyspec.rake
    headius committed Dec 2, 2014
    Copy the full SHA
    179811e View commit details
  5. Update list of slow language specs.

    eregon authored and headius committed Dec 2, 2014
    Copy the full SHA
    74f8381 View commit details
  6. Copy the full SHA
    0167f3f View commit details
  7. Peel off options hash passed to Open3.popen3.

    Fixes #1290.
    Fixes #1547.
    headius committed Dec 2, 2014
    Copy the full SHA
    66b2905 View commit details
  8. Merge remote-tracking branch 'origin/jruby-1_7'

    Conflicts:
    	.travis.yml
    	antlib/spec.xml
    	rakelib/rubyspec.rake
    	spec/jruby.1.8.mspec
    headius committed Dec 2, 2014
    Copy the full SHA
    45a7e3e View commit details
  9. Update to RubyGems 2.4.4.

    headius committed Dec 2, 2014
    Copy the full SHA
    6ba7c41 View commit details
  10. Copy the full SHA
    7edda48 View commit details
2 changes: 1 addition & 1 deletion bin/jirb
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@

require "irb"

if __FILE__.sub(/file:/, '') == $0.sub(/file:/, '')
if __FILE__.sub(/file:/, '').gsub(/ /,'%20') == $0.gsub(/file:/, '').gsub(/ /,'%20')
IRB.start(__FILE__)
else
# check -e option
3 changes: 1 addition & 2 deletions core/src/main/java/org/jruby/RubyFileTest.java
Original file line number Diff line number Diff line change
@@ -197,8 +197,7 @@ public static IRubyObject readable_p(ThreadContext context, IRubyObject recv, IR
filename = get_path(context, filename);
}

FileStat stat = fileResource(filename).stat();
return runtime.newBoolean(stat != null && stat.isReadable());
return runtime.newBoolean(fileResource(filename).canRead());
}

// Not exposed by filetest, but so similiar in nature that it is stored here
4 changes: 4 additions & 0 deletions core/src/main/java/org/jruby/util/JarResource.java
Original file line number Diff line number Diff line change
@@ -24,6 +24,10 @@ public static JarResource create(String pathname) {
// since pathname is actually an uri we need to decode any url decoded characters like %20
// which happens when directory names contain spaces
sanitized = URLDecoder.decode(sanitized, "UTF-8");
} catch (IllegalArgumentException iae) {
// something in the path did not decode, so it's probably not a URI
// See jruby/jruby#2264.
return null;
} catch (UnsupportedEncodingException e) {
throw new RuntimeException( "hmm - system does not know UTF-8 string encoding :(" );
}
7 changes: 7 additions & 0 deletions core/src/main/java/org/jruby/util/ShellLauncher.java
Original file line number Diff line number Diff line change
@@ -766,6 +766,13 @@ private static Process popenShared(Ruby runtime, IRubyObject[] strings, Map env,
File pwd = new File(runtime.getCurrentDirectory());

try {
// Peel off env hash, if given
IRubyObject envHash = null;
if (env == null && strings.length > 0 && !(envHash = TypeConverter.checkHashType(runtime, strings[0])).isNil()) {
strings = Arrays.copyOfRange(strings, 1, strings.length);
env = (Map)envHash;
}

String[] args = parseCommandLine(runtime.getCurrentContext(), runtime, strings);
boolean useShell = false;
if (addShell) for (String arg : args) useShell |= shouldUseShell(arg);
2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems.rb
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
require 'thread'

module Gem
VERSION = '2.4.3'
VERSION = '2.4.4'
end

# Must be first since it unloads the prelude from 1.9.2
2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems/commands/contents_command.rb
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ def files_in_gem spec
end

def files_in_default_gem spec
spec.files.sort.map do |file|
spec.files.map do |file|
case file
when /\A#{spec.bindir}\//
[RbConfig::CONFIG['bindir'], $POSTMATCH]
2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems/resolver/api_specification.rb
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ def initialize(set, api_data)
@set = set
@name = api_data[:name]
@version = Gem::Version.new api_data[:number]
@platform = api_data[:platform]
@platform = Gem::Platform.new api_data[:platform]
@dependencies = api_data[:dependencies].map do |name, ver|
Gem::Dependency.new name, ver.split(/\s*,\s*/)
end
25 changes: 25 additions & 0 deletions lib/ruby/stdlib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-----BEGIN CERTIFICATE-----
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
-----END CERTIFICATE-----
8 changes: 8 additions & 0 deletions test/jruby/test_file.rb
Original file line number Diff line number Diff line change
@@ -484,6 +484,14 @@ def test_file_query # - file?
assert(result == 'falsefalsetrue')
end

def test_readable_query # - readable?
assert(File.readable?('test/test_file.rb'))
assert(File.readable?('test'))
assert(! File.readable?('test_not'))
result = jruby("-e 'print File.readable?(\"test_not\");print File.readable?(\"test\");print File.readable?(\"test/test_file.rb\")'", 'jruby.native.enabled' => 'false' )
assert(result == 'falsetruetrue')
end

def test_file_exist_query
assert(File.exist?('test'))
assert(! File.exist?('test_not'))