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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b774aaf99ca885d4c07e6aa084ec6a6457f7c792644e44a4553cd9dd8648243
4
- data.tar.gz: f3bc9623770172d9559edb3858558451cd9cedad079555bdb724f386570a959c
3
+ metadata.gz: 06ece8262bca3c3a9d03add835a5fe4eeaffa8e361b1e5326d0b4a065cfa6a0c
4
+ data.tar.gz: 9f7dec1e66d87d71926eea65bb077083b4daafde9055c4f9e611ac6ba710b93a
5
5
  SHA512:
6
- metadata.gz: b52978b310b562b2c74894765e89482ab4104add1826a16d289c91b0198ff6c1dd6493e77d05464ef8a0893e24988308962cc49bbb6cf984ff189e02ca74b677
7
- data.tar.gz: 750b1dab1c2d2a4a32e2f8c82e83b10dc4e218da68e2d30ef292046a7f68d79650461b201ab99bb149f6df9792d824703d874ea7f984472ca68f3bf905741948
6
+ metadata.gz: 4afe7542dbad65fc2564b33d7f5db219546eaa40cd7e365a14f0f80904e587566f63bb488d6f619da5e9104480147e4db51cf8eec29c35201e0b2fe17b2292c3
7
+ data.tar.gz: 611c0e692fd8c1300f46c073eda4ed09155d0221d9068fc70dcd8ecd0b2669f13f39ce1df9fb0125ce7255e9c395046b631ea1b6d32d066d4ab2e7d548db6255
@@ -27,4 +27,4 @@ jobs:
27
27
  bundle install
28
28
  - name: Run tests
29
29
  run: |
30
- bundle exec rake test
30
+ bundle exec rspec spec
data/Rakefile CHANGED
@@ -1,9 +1,11 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
-
4
3
  Rake::TestTask.new do |t|
5
4
  t.libs << "test"
6
5
  end
7
-
8
6
  desc "Run tests"
9
7
  task :default => :test
8
+
9
+ task :test do
10
+ system("bundle exec rspec spec")
11
+ end
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
- if (val = binding.of_caller(4).local_variable_get(obj))
49
- val = format_val(val)
48
+ val = binding.of_caller(4).local_variable_get(obj)
49
+ val = format_val(val)
50
50
 
51
- "#{obj} = #{val}"
52
- end
51
+ "#{obj} = #{val}"
53
52
  rescue NameError
54
53
  ":#{obj}"
55
54
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DbgRb
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.4"
5
5
  end
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!("123") }.to output("[spec/smoke_spec.rb:9] \"123\"\n").to_stdout
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!(:b) }.to output("[spec/smoke_spec.rb:14] b = 123\n").to_stdout
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!(:c) }.to output("[spec/smoke_spec.rb:19] :c\n").to_stdout
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
- dgb(123)
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.3
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