Permalink
Browse files

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...
1 parent 60c88e6 commit afe96542977ed52d0e80164b5079b3e5541fdcdb @steveklabnik steveklabnik committed Sep 15, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 activesupport/lib/active_support/core_ext/object/to_json.rb
@@ -17,3 +17,11 @@ def to_json(options = nil)
end
end
end
+
+module Process
+ class Status
+ def as_json(options = nil)
+ { :exitstatus => exitstatus, :pid => pid }
+ end
+ end
+end

0 comments on commit afe9654

Please sign in to comment.