/usr/lib/ruby/vendor_ruby/cheffish/with_pattern.rb is in ruby-cheffish 4.0.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | module Cheffish
module WithPattern
def with(symbol)
class_eval <<EOM
attr_accessor :current_#{symbol}
def with_#{symbol}(value)
old_value = self.current_#{symbol}
self.current_#{symbol} = value
if block_given?
begin
yield
ensure
self.current_#{symbol} = old_value
end
end
end
EOM
end
end
end
|