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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c55e4322db5a7c2c4ccff3b87fb1eaf1af6aabc
4
- data.tar.gz: 69d4ed2229b49a2185408ec520cb1f3d302aee69
3
+ metadata.gz: 1794b84df23a5eb4dcc558ad01c5d4af80300272
4
+ data.tar.gz: 0f92833be4360d0da7e60ab3b909ca2ec6d140b9
5
5
  SHA512:
6
- metadata.gz: e64c9eae042da797b8ec3a422c914640a3074e6757bb228ef63f7b836a03d54d0c205253b1f078a4a611ffcedd1611c9cd878faa35a1e2d5f6af6e6af6b271f6
7
- data.tar.gz: 378a1fc7b2194c631ca63abb4d7266ea7f81498c66cecd67290991cdca6499b470e1c5edaf875b4f969d6e162c396f492a49f7f4029029e638db2bc7f82f51fa
6
+ metadata.gz: 6309d780432e92dfddcebd5878736b88898bcf8525e0f15f700e7230a741e6ce968f51afefbe37ce463827da2d86f0a2251d2ec4fba7e24d5cf6d718163f64f3
7
+ data.tar.gz: 75bbe56d2a776238f00214b10de67e632b02d4e244800200070c78d31897fbe2f908494fa8338a9fd0625d6a15aecdf63bc95e47d7f3da331bc81820afe049fa
@@ -4,22 +4,30 @@ IRB.init_config nil
4
4
  IRB.conf[:PROMPT_MODE] = :DEFAULT
5
5
  IRB.conf[:VERBOSE] = false
6
6
 
7
- def IRB.Output
8
- IRB.conf[:OUTPUT]
9
- end
7
+ class << IRB
8
+ def Output
9
+ conf[:OUTPUT]
10
+ end
10
11
 
11
- def IRB.evaluate_string string
12
- IRB.conf[:PROMPT_MODE] = :DEFAULT
13
- IRB.conf[:VERBOSE] = false
14
- IRB.conf[:OUTPUT] = []
12
+ def evaluate_string string
13
+ conf[:PROMPT_MODE] = :DEFAULT
14
+ conf[:VERBOSE] = false
15
+ conf[:OUTPUT] = []
15
16
 
16
- irb = IRB::Irb.new nil, StringInputMethod.new(string + "\n")
17
- IRB.conf[:MAIN_CONTEXT] = irb.context
18
- irb.eval_input
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
- def IRB.irb_exit irb, ret
22
- ret
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
- context = IRB.CurrentContext
46
- IRB.Output << [ :stdout, context.return_format % context.inspect_last_value ]
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 << [ :stderr, args.join, caller ]
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 << [ :stderr, format % args, caller ]
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
 
@@ -1,3 +1,3 @@
1
1
  module Tailog
2
- VERSION = "0.6.7"
2
+ VERSION = "0.6.8"
3
3
  end
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.7
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-10-31 00:00:00.000000000 Z
11
+ date: 2016-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra