extra_print 1.1.6 → 1.1.7
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/extra_print.rb +9 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d51296c03230ed1f4449712d5095f562bd23751d
|
4
|
+
data.tar.gz: 2cda1c2a03a78d638254126cf2d54ce00dd9886a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a29ea4d27f8d18e9f0bf1506e21d31a0081fbd932143078c751a9d3085579d399db7a9fc87f9abda25000164bc349de065d29d187c34a44c4a568f7ce913f64
|
7
|
+
data.tar.gz: 7dc892716e9217ea5346e21f2d6c8dd1f0e978178011c4f301a243015e93954fa81a51b708e1c369cd9312db21515a3ad22d88bd452e269de4764242eaae93bc
|
data/lib/extra_print.rb
CHANGED
@@ -19,14 +19,14 @@ def ep(*args)
|
|
19
19
|
@caller_path = caller
|
20
20
|
return display_emoji_break if args.empty?
|
21
21
|
extra_print(args[0], args[1])
|
22
|
-
args[0]
|
22
|
+
return_value(args[0])
|
23
23
|
end
|
24
24
|
|
25
25
|
def eap(*args)
|
26
26
|
@caller_path = caller
|
27
27
|
return display_emoji_break if args.empty?
|
28
28
|
extra_print(args[0], args[1], true)
|
29
|
-
args[0]
|
29
|
+
return_value(args[0])
|
30
30
|
end
|
31
31
|
|
32
32
|
private
|
@@ -45,6 +45,13 @@ def extra_print(variable = nil, msg = nil, add_awesome_print = false)
|
|
45
45
|
display_footer
|
46
46
|
end
|
47
47
|
|
48
|
+
# Checks to see if running in a Ruby file
|
49
|
+
# IF so returns value, enabling ep's from the end of a method without disrupting functionality.
|
50
|
+
# ELSE returns nil, presuming it is running in a REPL and we don't want to see our output doubled because the REPL prints the return value as well.
|
51
|
+
def return_value(val)
|
52
|
+
$0.split('.').last == 'rb' ? val : nil
|
53
|
+
end
|
54
|
+
|
48
55
|
def path_clip
|
49
56
|
@caller_path[0].split('/').last(2).join('/').split(':in')[0]
|
50
57
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extra_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hunter T. Chapman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 1.8.0
|
33
|
-
description: 'Debugging Companion: Informative variable
|
33
|
+
description: 'Debugging Companion: Informative variable inspection || visual breaks.'
|
34
34
|
email: bootcoder@gmail.com
|
35
35
|
executables: []
|
36
36
|
extensions: []
|