lib/knj/unix_proc.rb in knjrbfw-0.0.7 vs lib/knj/unix_proc.rb in knjrbfw-0.0.8
- old
+ new
@@ -36,13 +36,13 @@
"ram_last" => match[3],
"cmd" => match[4],
"app" => File.basename(match[4])
}
- next if (!args.has_key?("ignore_self") or args["ignore_self"]) and match[1].to_i == $$.to_i
+ next if (!args.key?("ignore_self") or args["ignore_self"]) and match[1].to_i == $$.to_i
next if grepstr.length > 0 and match[4].index(grepstr) != nil #dont return current process.
- next if args.has_key?("pids") and args["pids"].index(pid) == nil
+ next if args.key?("pids") and args["pids"].index(pid) == nil
ret << Knj::Unix_proc.spawn(data)
end
return ret
@@ -70,10 +70,10 @@
def update_data(data)
@data = data
end
def [](key)
- raise "No such data: #{key}" if !@data.has_key?(key)
+ raise "No such data: #{key}" if !@data.key?(key)
return @data[key]
end
def kill
Process.kill(9, @data["pid"].to_i)
\ No newline at end of file