Skip to content
Browse files

Move the monkey-patching to utils

  • Loading branch information...
1 parent c3d5a0c commit 0b57688e73cbbaf8d7f4dee4d0c87a1ea8b00c6e @decklin committed
Showing with 17 additions and 17 deletions.
  1. +0 −17 lib/sensu-handler.rb
  2. +17 −0 lib/sensu-plugin/utils.rb
View
17 lib/sensu-handler.rb
@@ -133,20 +133,3 @@ def filter_dependencies
end
end
-
-# Monkey Patching.
-
-class Array
- def deep_merge(other_array, &merger)
- concat(other_array).uniq
- end
-end
-
-class Hash
- def deep_merge(other_hash, &merger)
- merger ||= proc do |key, old_value, new_value|
- old_value.deep_merge(new_value, &merger) rescue new_value
- end
- merge(other_hash, &merger)
- end
-end
View
17 lib/sensu-plugin/utils.rb
@@ -33,3 +33,20 @@ def read_event(file)
end
end
end
+
+# Monkey Patching.
+
+class Array
+ def deep_merge(other_array, &merger)
+ concat(other_array).uniq
+ end
+end
+
+class Hash
+ def deep_merge(other_hash, &merger)
+ merger ||= proc do |key, old_value, new_value|
+ old_value.deep_merge(new_value, &merger) rescue new_value
+ end
+ merge(other_hash, &merger)
+ end
+end

0 comments on commit 0b57688

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