cutest-cj 1.4.0 → 1.5.0
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/cutest.rb +23 -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: e578da17f40e6293cbf2b06d678604d9ea397db3
|
4
|
+
data.tar.gz: 589892bbad0c5b7d9c465b51496bb4474523f888
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20fcbf7f247e61f52a02d5199069614d7dfd78a34122c8b0d510ad0b395b5559cb92f02a17a16425c80599fc199a3fb44ed210741bd41cf2eb63631235369f96
|
7
|
+
data.tar.gz: 48c47a62b81325b56468dd404771dd233c691b5b9e48482f88728830e9b14bb8d6b1c3f8ff071b06f897b63e3f3af80134954de422cc571646714992a37856ce
|
data/lib/cutest.rb
CHANGED
@@ -7,7 +7,7 @@ class Cutest
|
|
7
7
|
autoload :Database, 'database'
|
8
8
|
|
9
9
|
unless defined?(VERSION)
|
10
|
-
VERSION = "1.
|
10
|
+
VERSION = "1.5.0"
|
11
11
|
FILTER = %r[/(ruby|jruby|rbx)[-/]([0-9\.])+]
|
12
12
|
CACHE = Hash.new { |h, k| h[k] = File.readlines(k) }
|
13
13
|
end
|
@@ -128,6 +128,28 @@ class Cutest
|
|
128
128
|
puts " → \033[0mfile: #{fn} ↪#{ln}\e[0m"
|
129
129
|
puts " → \033[90mline: #{code(fn, ln)}\e[0m"
|
130
130
|
end
|
131
|
+
|
132
|
+
def capture_output
|
133
|
+
old_stdout = STDOUT.clone
|
134
|
+
pipe_r, pipe_w = IO.pipe
|
135
|
+
pipe_r.sync = true
|
136
|
+
output = ""
|
137
|
+
reader = Thread.new do
|
138
|
+
begin
|
139
|
+
loop do
|
140
|
+
output << pipe_r.readpartial(1024)
|
141
|
+
end
|
142
|
+
rescue EOFError
|
143
|
+
end
|
144
|
+
end
|
145
|
+
STDOUT.reopen(pipe_w)
|
146
|
+
yield
|
147
|
+
ensure
|
148
|
+
STDOUT.reopen(old_stdout)
|
149
|
+
pipe_w.close
|
150
|
+
reader.join
|
151
|
+
return output
|
152
|
+
end
|
131
153
|
end
|
132
154
|
|
133
155
|
class Scope
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cutest-cj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damian Janowski
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-07-
|
13
|
+
date: 2014-07-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: pry
|