cutter 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cutter/inspection.rb +7 -6
- metadata +2 -2
data/lib/cutter/inspection.rb
CHANGED
@@ -22,13 +22,14 @@ class Object
|
|
22
22
|
|
23
23
|
def inspect! _binding = nil, &block
|
24
24
|
return true if Cutter::Inspection.quiet?
|
25
|
-
raise ArgumentError, "Try inspect(binding) or inspect! {}", caller if (!block_given
|
25
|
+
raise ArgumentError, "Try inspect(binding) or inspect! {}", caller if (!block_given? && !_binding)
|
26
26
|
_binding ||= block.binding
|
27
|
-
puts
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
puts %|method: `#{caller_method_name}'|
|
28
|
+
lvb = eval('local_variables',_binding)
|
29
|
+
puts %| variables: #{"[]" if lvb.empty?}|
|
30
|
+
lvb.map do |lv|
|
31
|
+
puts %| #{lv}: #{eval(lv.to_s, _binding)}|
|
32
|
+
end if lvb
|
32
33
|
yield if block_given?
|
33
34
|
end
|
34
35
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: cutter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.5.
|
5
|
+
version: 0.5.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- stanislaw
|
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
109
|
requirements:
|
110
110
|
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
hash: -
|
112
|
+
hash: -1392113
|
113
113
|
segments:
|
114
114
|
- 0
|
115
115
|
version: "0"
|