ruby_var_dump 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ruby_var_dump/version.rb +1 -1
- data/lib/ruby_var_dump.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49d1815ebd1e0d7ef77ea119d3354402b15a8c7186db795aeeeb5a4f68e046ee
|
4
|
+
data.tar.gz: babdb610fca6f79c6fe2a837fbc64141d181b5c6c6a9a225502490dbaf4899f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e591976ffbb0b1c3a52e690f164408f0cb3f2e6436daeeeacf5dcd8d4e03a6ccb29dc2b4dcfb15575925e754389e705be89ae94a3337de06c9c78ee8440a5f3b
|
7
|
+
data.tar.gz: 276f7b79d00e94ce81593c163ea151ecb7233b4a5f15cb8741137fa9d84bad312d653bdd5b24c4a5ba065deabaca07e7f45014a0b94cdc1072ff52a089be691a
|
data/lib/ruby_var_dump.rb
CHANGED
@@ -12,6 +12,7 @@ module RubyVarDump
|
|
12
12
|
print "#{is_value ? '' : indent}" + "["
|
13
13
|
if obj.empty?
|
14
14
|
print "]"
|
15
|
+
print "\n" if level == 0 # メソッドの出力の最後に改行を追加
|
15
16
|
else
|
16
17
|
print "\n"
|
17
18
|
obj.each_with_index do |item, index|
|
@@ -20,11 +21,13 @@ module RubyVarDump
|
|
20
21
|
print "\n"
|
21
22
|
end
|
22
23
|
print "#{indent}]"
|
24
|
+
print "\n" if level == 0 # メソッドの出力の最後に改行を追加
|
23
25
|
end
|
24
26
|
elsif obj.is_a?(Hash)
|
25
27
|
print "#{is_value ? '' : indent}" + "{"
|
26
28
|
if obj.empty?
|
27
29
|
print "}"
|
30
|
+
print "\n" if level == 0 # メソッドの出力の最後に改行を追加
|
28
31
|
else
|
29
32
|
print "\n"
|
30
33
|
obj.each_with_index do |(key, value), index|
|
@@ -39,6 +42,7 @@ module RubyVarDump
|
|
39
42
|
print "\n"
|
40
43
|
end
|
41
44
|
print "#{indent}}"
|
45
|
+
print "\n" if level == 0 # メソッドの出力の最後に改行を追加
|
42
46
|
end
|
43
47
|
elsif defined?(ActiveRecord::Relation) && obj.is_a?(ActiveRecord::Relation)
|
44
48
|
obj.each_with_index do |record, index|
|
@@ -47,12 +51,14 @@ module RubyVarDump
|
|
47
51
|
print ",\n"
|
48
52
|
else
|
49
53
|
print "\n" # レコードの最後の場合は改行のみ
|
54
|
+
print "\n" if level == 0 # メソッドの出力の最後に改行を追加
|
50
55
|
end
|
51
56
|
end
|
52
57
|
elsif obj.respond_to?(:attributes)
|
53
58
|
dump(obj.attributes, level, false)
|
54
59
|
else
|
55
60
|
print indent + obj.inspect.chomp
|
61
|
+
print "\n" if level == 0 # メソッドの出力の最後に改行を追加
|
56
62
|
end
|
57
63
|
end
|
58
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_var_dump
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hirokiyam
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Ruby gem for detailed debugging and inspection of objects, mimicking
|
14
14
|
PHP's var_dump function.
|