io-grab 0.0.1 → 0.0.2
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/README.md +13 -9
- data/lib/io/grab.rb +1 -0
- data/lib/io/grab/version.rb +1 -1
- metadata +14 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 173d96123e3eeae8ce25fd382dfaa8ca8163f9a8
|
4
|
+
data.tar.gz: 7b91df293a70697567aaba63576a6f890d00972f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88c30bea1ce4b4062c76d22d48e62e4c4892493944b437202e9d4194746563d5f764570ee88ca12691eb0e784bd8cf5b20cec819739899d6ca5980020b69646a
|
7
|
+
data.tar.gz: 886d6607a36c22611810d45bd931fc504012b2eb155b606588880438579544101ea3019e4111489627d4a63ec15ce4d49c13f8447c50dbe475dd737a425bb8cd
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Capture IO writes.
|
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
-
gem 'io-grab'
|
9
|
+
gem 'io-grab', require: false
|
10
10
|
|
11
11
|
And then execute:
|
12
12
|
|
@@ -21,18 +21,22 @@ Or install it yourself as:
|
|
21
21
|
io-grab adds #grab method to IO. (It also extends StringIO for consistency, even though it isn't really an IO.)
|
22
22
|
You can use this method to temporarily redirect writes to the object to a string, ie. for later examination.
|
23
23
|
|
24
|
-
|
24
|
+
```ruby
|
25
|
+
require 'io/grab'
|
25
26
|
|
26
|
-
|
27
|
-
|
27
|
+
STDOUT.grab { puts "foo" }
|
28
|
+
# _ == "foo\n"
|
29
|
+
```
|
28
30
|
|
29
31
|
This is particularly useful for testing, eg. to check for expected messages.
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
```ruby
|
34
|
+
describe "Kernel#puts" do
|
35
|
+
it "adds a newline at the end" do
|
36
|
+
STDOUT.grab { puts "foo" }.should =~ /\n\z/
|
37
|
+
end
|
38
|
+
end
|
39
|
+
```
|
36
40
|
|
37
41
|
## Contributing
|
38
42
|
|
data/lib/io/grab.rb
CHANGED
data/lib/io/grab/version.rb
CHANGED
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: io-grab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafał Rzepecki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: 'Adds #grab method to IO, which permits capturing all writes to that
|
@@ -60,8 +60,8 @@ executables: []
|
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
-
- .gitignore
|
64
|
-
- .kateproject
|
63
|
+
- ".gitignore"
|
64
|
+
- ".kateproject"
|
65
65
|
- Gemfile
|
66
66
|
- LICENSE.txt
|
67
67
|
- README.md
|
@@ -80,19 +80,20 @@ require_paths:
|
|
80
80
|
- lib
|
81
81
|
required_ruby_version: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
|
-
- -
|
83
|
+
- - ">="
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - ">="
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.4.8
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Capture IO writes
|
97
97
|
test_files:
|
98
98
|
- spec/io-grab_spec.rb
|
99
|
+
has_rdoc:
|