Skip to content
This repository
Browse code

Improve Process::Status#to_json

Because Process::Status has no instance_variables, the
ActiveSupport version of #to_json produces {}, which isn't good.

Therefore, we implement our own #as_json, which makes it useful
again.

Fixes #4857
  • Loading branch information...
commit afe96542977ed52d0e80164b5079b3e5541fdcdb 1 parent 60c88e6
Steve Klabnik authored September 15, 2012
8  activesupport/lib/active_support/core_ext/object/to_json.rb
@@ -17,3 +17,11 @@ def to_json(options = nil)
17 17
     end
18 18
   end
19 19
 end
  20
+
  21
+module Process
  22
+  class Status
  23
+    def as_json(options = nil)
  24
+      { :exitstatus => exitstatus, :pid => pid }
  25
+    end
  26
+  end
  27
+end

0 notes on commit afe9654

Please sign in to comment.
Something went wrong with that request. Please try again.