dbg-rb 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/Rakefile +4 -2
- data/dbg-rb.gemspec +1 -0
- data/lib/dbg-rb.rb +3 -4
- data/lib/dbg_rb/version.rb +1 -1
- data/spec/smoke_spec.rb +9 -4
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06ece8262bca3c3a9d03add835a5fe4eeaffa8e361b1e5326d0b4a065cfa6a0c
|
4
|
+
data.tar.gz: 9f7dec1e66d87d71926eea65bb077083b4daafde9055c4f9e611ac6ba710b93a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4afe7542dbad65fc2564b33d7f5db219546eaa40cd7e365a14f0f80904e587566f63bb488d6f619da5e9104480147e4db51cf8eec29c35201e0b2fe17b2292c3
|
7
|
+
data.tar.gz: 611c0e692fd8c1300f46c073eda4ed09155d0221d9068fc70dcd8ecd0b2669f13f39ce1df9fb0125ce7255e9c395046b631ea1b6d32d066d4ab2e7d548db6255
|
data/.github/workflows/ci.yml
CHANGED
data/Rakefile
CHANGED
data/dbg-rb.gemspec
CHANGED
@@ -15,6 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.require_paths = ["lib"]
|
16
16
|
s.license = "MIT"
|
17
17
|
s.add_dependency "binding_of_caller"
|
18
|
+
s.add_dependency "json"
|
18
19
|
s.add_development_dependency "rake"
|
19
20
|
s.add_development_dependency "rspec"
|
20
21
|
s.add_development_dependency "rufo"
|
data/lib/dbg-rb.rb
CHANGED
@@ -45,11 +45,10 @@ module DbgRb
|
|
45
45
|
|
46
46
|
val = if obj.is_a?(Symbol)
|
47
47
|
begin
|
48
|
-
|
49
|
-
|
48
|
+
val = binding.of_caller(4).local_variable_get(obj)
|
49
|
+
val = format_val(val)
|
50
50
|
|
51
|
-
|
52
|
-
end
|
51
|
+
"#{obj} = #{val}"
|
53
52
|
rescue NameError
|
54
53
|
":#{obj}"
|
55
54
|
end
|
data/lib/dbg_rb/version.rb
CHANGED
data/spec/smoke_spec.rb
CHANGED
@@ -6,17 +6,17 @@ require "ostruct"
|
|
6
6
|
|
7
7
|
describe DbgRb do
|
8
8
|
it "variable values" do
|
9
|
-
expect { dbg
|
9
|
+
expect { dbg("123") }.to output("[spec/smoke_spec.rb:9] \"123\"\n").to_stdout
|
10
10
|
end
|
11
11
|
|
12
12
|
it "binded variables" do
|
13
13
|
b = 123
|
14
|
-
expect { dbg
|
14
|
+
expect { dbg(:b) }.to output("[spec/smoke_spec.rb:14] b = 123\n").to_stdout
|
15
15
|
end
|
16
16
|
|
17
17
|
it "missing binded variables" do
|
18
18
|
b = 123
|
19
|
-
expect { dbg
|
19
|
+
expect { dbg(:c) }.to output("[spec/smoke_spec.rb:19] :c\n").to_stdout
|
20
20
|
end
|
21
21
|
|
22
22
|
it "complex objects" do
|
@@ -53,7 +53,12 @@ describe DbgRb do
|
|
53
53
|
DbgRb.color_code = nil
|
54
54
|
|
55
55
|
expect {
|
56
|
-
|
56
|
+
dbg(123)
|
57
57
|
}.to output("[spec/smoke_spec.rb:56] 123\n").to_stdout
|
58
58
|
end
|
59
|
+
|
60
|
+
it "binded nil variables" do
|
61
|
+
b = nil
|
62
|
+
expect { dbg(:b) }.to output("[spec/smoke_spec.rb:62] b = nil\n").to_stdout
|
63
|
+
end
|
59
64
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbg-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: json
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|