/usr/lib/ruby/vendor_ruby/naught/null_class_builder/commands/pebble.rb is in ruby-naught 1.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 22 23 24 25 26 27 28 29 30 31 32 33 34 | require 'naught/null_class_builder/command'
module Naught
class NullClassBuilder
module Commands
class Pebble < ::Naught::NullClassBuilder::Command
def initialize(builder, output = $stdout)
@builder = builder
@output = output
end
def call
defer do |subject|
subject.module_exec(@output) do |output|
define_method(:method_missing) do |method_name, *args, &block|
pretty_args = args.collect(&:inspect).join(', ').gsub("\"", "'")
output.puts "#{method_name}(#{pretty_args}) from #{parse_caller}"
self
end
def parse_caller
caller = Kernel.caller(2).first
method_name = caller.match(/\`([\w\s]+(\(\d+\s\w+\))?[\w\s]*)/)
method_name ? method_name[1] : caller
end
private :parse_caller
end
end
end
end
end
end
end
|