lib/cutter/inspection.rb in cutter-0.5.9 vs lib/cutter/inspection.rb in cutter-0.5.10

- old
+ new

@@ -38,15 +38,21 @@ # Basic info puts %|\nmethod: `#{eval('__method__', _binding)}'| puts %| called from class: #{eval('self.class', _binding)}| lvb = eval('local_variables',_binding) - puts %| variables: #{"[]" if lvb.empty?}| + puts %| local_variables: #{"[]" if lvb.empty?}| lvb.map do |lv| puts %| #{lv}: #{eval(lv.to_s, _binding)}| end if lvb + ivb = eval('instance_variables',_binding) + puts %| instance_variables: #{"[]" if ivb.empty?}| + ivb.map do |lv| + puts %| #{lv}: #{eval(lv.to_s, _binding)}| + end if ivb + # Self inspection begin puts %| self inspection:| puts %| #{self_inspection}| end if self_inspection @@ -59,10 +65,10 @@ } end if level puts "\n" # Yield mysterious things if they exist in block. - yield if block_given? + yield if block_given? end def caller_method_name(level = 1) caller[level][/`([^']*)'/,1].to_sym end