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: 7901f47cb8db
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 078602e19e64
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Feb 15, 2018

  1. Copy the full SHA
    9fff154 View commit details
  2. Add Process::last_status method

    For more information, please see feature #14043.
    nomadium committed Feb 15, 2018
    Copy the full SHA
    6b06410 View commit details
  3. Merge pull request #5046 from nomadium/add-process-last-status-as-ali…

    …as-for-dollar-question-var
    
    Add Process::last_status method
    enebo authored Feb 15, 2018
    Copy the full SHA
    078602e View commit details
Showing with 10 additions and 0 deletions.
  1. +5 −0 core/src/main/java/org/jruby/RubyProcess.java
  2. +5 −0 test/mri/ruby/test_process.rb
5 changes: 5 additions & 0 deletions core/src/main/java/org/jruby/RubyProcess.java
Original file line number Diff line number Diff line change
@@ -603,6 +603,11 @@ public static IRubyObject groups(IRubyObject recv) {
return ary;
}

@JRubyMethod(name = "last_status", module = true, visibility = PRIVATE)
public static IRubyObject last_status(ThreadContext context, IRubyObject recv) {
return context.getLastExitStatus();
}

@JRubyMethod(name = "setrlimit", module = true, visibility = PRIVATE)
public static IRubyObject setrlimit(ThreadContext context, IRubyObject recv, IRubyObject resource, IRubyObject rlimCur) {
return setrlimit(context, recv, resource, rlimCur, context.nil);
5 changes: 5 additions & 0 deletions test/mri/ruby/test_process.rb
Original file line number Diff line number Diff line change
@@ -2312,4 +2312,9 @@ def to_hash
end
end
end

def test_last_status
Process.wait spawn(RUBY, "-e", "exit 13")
assert_same(Process.last_status, $?)
end
end