tailog 0.6.7 → 0.6.8
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/tailog/ext/irb.rb +41 -17
- data/lib/tailog/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1794b84df23a5eb4dcc558ad01c5d4af80300272
|
4
|
+
data.tar.gz: 0f92833be4360d0da7e60ab3b909ca2ec6d140b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6309d780432e92dfddcebd5878736b88898bcf8525e0f15f700e7230a741e6ce968f51afefbe37ce463827da2d86f0a2251d2ec4fba7e24d5cf6d718163f64f3
|
7
|
+
data.tar.gz: 75bbe56d2a776238f00214b10de67e632b02d4e244800200070c78d31897fbe2f908494fa8338a9fd0625d6a15aecdf63bc95e47d7f3da331bc81820afe049fa
|
data/lib/tailog/ext/irb.rb
CHANGED
@@ -4,22 +4,30 @@ IRB.init_config nil
|
|
4
4
|
IRB.conf[:PROMPT_MODE] = :DEFAULT
|
5
5
|
IRB.conf[:VERBOSE] = false
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
class << IRB
|
8
|
+
def Output
|
9
|
+
conf[:OUTPUT]
|
10
|
+
end
|
10
11
|
|
11
|
-
def
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
def evaluate_string string
|
13
|
+
conf[:PROMPT_MODE] = :DEFAULT
|
14
|
+
conf[:VERBOSE] = false
|
15
|
+
conf[:OUTPUT] = []
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
end
|
17
|
+
irb = Irb.new nil, StringInputMethod.new(string + "\n")
|
18
|
+
conf[:MAIN_CONTEXT] = irb.context
|
19
|
+
irb.eval_input
|
20
|
+
end
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
alias_method :raw_irb_exit, :irb_exit
|
23
|
+
|
24
|
+
def irb_exit irb, ret
|
25
|
+
if IRB.Output
|
26
|
+
ret
|
27
|
+
else
|
28
|
+
raw_irb_exit irb, ret
|
29
|
+
end
|
30
|
+
end
|
23
31
|
end
|
24
32
|
|
25
33
|
class IRB::WorkSpace
|
@@ -41,17 +49,33 @@ class IRB::WorkSpace
|
|
41
49
|
end
|
42
50
|
|
43
51
|
class IRB::Irb
|
52
|
+
alias_method :raw_output_value, :output_value
|
53
|
+
alias_method :raw_print, :print
|
54
|
+
alias_method :raw_printf, :printf
|
55
|
+
|
44
56
|
def output_value
|
45
|
-
|
46
|
-
|
57
|
+
if IRB.Output
|
58
|
+
context = IRB.CurrentContext
|
59
|
+
IRB.Output << [ :stdout, context.return_format % context.inspect_last_value ]
|
60
|
+
else
|
61
|
+
raw_output_value
|
62
|
+
end
|
47
63
|
end
|
48
64
|
|
49
65
|
def print *args
|
50
|
-
IRB.Output
|
66
|
+
if IRB.Output
|
67
|
+
IRB.Output << [ :stderr, args.join, caller ]
|
68
|
+
else
|
69
|
+
raw_print *args
|
70
|
+
end
|
51
71
|
end
|
52
72
|
|
53
73
|
def printf format, *args
|
54
|
-
IRB.Output
|
74
|
+
if IRB.Output
|
75
|
+
IRB.Output << [ :stderr, format % args, caller ]
|
76
|
+
else
|
77
|
+
raw_printf format, *args
|
78
|
+
end
|
55
79
|
end
|
56
80
|
end
|
57
81
|
|
data/lib/tailog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tailog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bbtfr
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|