Permalink
Browse files

Fix ENV.delete with block

  • Loading branch information...
1 parent aebaa23 commit 8141ff41691dc02d8fb589bf06974a990da78cf2 @jfirebaugh jfirebaugh committed Apr 5, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 kernel/common/env.rb
@@ -57,7 +57,11 @@ def each
def delete(key)
existing_value = self[key]
- self[key] = nil if existing_value
+ if existing_value
+ self[key] = nil
+ elsif block_given?
+ yield key
+ end
existing_value
end

0 comments on commit 8141ff4

Please sign in to comment.