dia 2.2.1 → 2.2.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.
- data/Changelog +13 -1
- data/CodingStyle +15 -0
- data/GitPolicy +27 -0
- data/{README.mkd → README.md} +11 -3
- data/dia.gemspec +6 -3
- data/lib/dia.rb +2 -1
- data/lib/dia/ruby_block.rb +108 -71
- data/test/suite/lib/dia/RubyBlock#redirect_stderr.rb +29 -0
- data/test/suite/lib/dia/RubyBlock#redirect_stdout.rb +29 -0
- data/test/suite/lib/dia/RubyBlock#rescue_exception.rb +28 -0
- metadata +13 -5
data/Changelog
CHANGED
@@ -1,9 +1,21 @@
|
|
1
|
+
2010-08-20 Robert Gleeson <rob@flowof.info> (2.2.2)
|
2
|
+
|
3
|
+
* Documented the VERSION constant.
|
4
|
+
Dia has 100% documentation coverage now.
|
5
|
+
|
6
|
+
* Fixed GH Issue 3 and GH Issue 4.
|
7
|
+
See http://github.com/robgleeson/dia/issues for more info.
|
8
|
+
|
9
|
+
* Document every pair of getter and setter on RubyBlock using
|
10
|
+
the @overload YARD tag. Before this change, documentation for
|
11
|
+
setters was not visible.
|
12
|
+
|
1
13
|
2010-08-12 Robert Gleeson <rob@flowof.info> (v2.2.1)
|
2
14
|
|
3
15
|
* Fixed a bug that saw #e ( an alias for #exception ) always return nil.
|
4
16
|
#exception itself worked properly.
|
5
17
|
|
6
|
-
* #redirect_stderr, #redirect_stdout, and #rescue_exception
|
18
|
+
* #redirect_stderr, #redirect_stdout, and #rescue_exception
|
7
19
|
have been added to the RubyBlock class and are documented as getters.
|
8
20
|
They're aliased as #redirect_stderr?, #redirect_stdout? and
|
9
21
|
#rescue_exception? respectively.
|
data/CodingStyle
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
== Coding Style
|
2
|
+
|
3
|
+
* Soft tabs(or "spaces") with a width of two spaces should be used when
|
4
|
+
identing code.
|
5
|
+
|
6
|
+
* The width of a line of code shouldn't be more than 100 columns, but exceptions
|
7
|
+
can be made in certain circumstances such as documentation that exceeds 100 columns
|
8
|
+
by a single column or two.
|
9
|
+
|
10
|
+
* When a method receives arguments, parenthesis should always be used.
|
11
|
+
|
12
|
+
The usual Ruby conventions should be applied as well, such as snake_case for method names,
|
13
|
+
CamelCase for classes/modules, and UPPERCASE_SNAKE_CASE for constants which do not reference
|
14
|
+
a class or module.
|
15
|
+
|
data/GitPolicy
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
== Git Policy
|
2
|
+
|
3
|
+
* master is reserved for the latest stable code in the project.
|
4
|
+
It shouldn't ever contain code that is experimental or that
|
5
|
+
hasn't been thoroughly tested.
|
6
|
+
|
7
|
+
* bug-fixes is a branch which inherits from the latest stable
|
8
|
+
release of the project.
|
9
|
+
This branch serves as a branch that fixes issues in the latest
|
10
|
+
stable release of the project.
|
11
|
+
|
12
|
+
Changes made in this branch should be merged into experimental,
|
13
|
+
and tested thoroughly.
|
14
|
+
Ideally, every bug has a test that confirms it has been fixed).
|
15
|
+
|
16
|
+
* topic-branches(ie, feature branches) inherit from master, and are
|
17
|
+
then merged into experimental to be thoroughly tested.
|
18
|
+
|
19
|
+
* After experimental has been confirmed to be stable, it is merged into
|
20
|
+
master.
|
21
|
+
|
22
|
+
The experimental branch is the only branch that gets merged back into
|
23
|
+
master, all other branches(topic branches, bug fixes) are merged into
|
24
|
+
the experimental branch for testing, before being merged into master.
|
25
|
+
|
26
|
+
This workflow hasn't been set in stone yet, it might be altered and it's open
|
27
|
+
to discussion and possibly change, too.
|
data/{README.mkd → README.md}
RENAMED
@@ -34,7 +34,7 @@ simple, and a joy to use. I hope you feel the same way :-)
|
|
34
34
|
|
35
35
|
## Documentation
|
36
36
|
|
37
|
-
* [API Documentation](http://
|
37
|
+
* [API Documentation](http://doc.fork-bomb.org/dia)
|
38
38
|
Written using YARD, the API documentation makes a great reference.
|
39
39
|
*The API documentation linked is for the latest stable release*
|
40
40
|
|
@@ -44,7 +44,7 @@ simple, and a joy to use. I hope you feel the same way :-)
|
|
44
44
|
* Wiki documentation
|
45
45
|
*Work in progress*
|
46
46
|
|
47
|
-
## Supported Rubies
|
47
|
+
## Supported Rubies
|
48
48
|
|
49
49
|
The following Ruby implementations have had the test suite run against them, and
|
50
50
|
reported a 100% success rate.
|
@@ -52,7 +52,9 @@ reported a 100% success rate.
|
|
52
52
|
* MRI
|
53
53
|
* 1.8.7-p299
|
54
54
|
* 1.9.1-p378
|
55
|
-
* 1.9.2-rc1
|
55
|
+
* 1.9.2-rc1
|
56
|
+
* 1.9.2-p0
|
57
|
+
|
56
58
|
* REE
|
57
59
|
* Ruby Enterprise Edition 2010.02 (1.8.7-p253)
|
58
60
|
|
@@ -60,6 +62,12 @@ MacRuby is not supported because it does not support Kernel.fork, and it won't a
|
|
60
62
|
for fork anytime soon(if ever).
|
61
63
|
JRuby has experimental support for fork, but I haven't tried it.
|
62
64
|
|
65
|
+
## Contribute
|
66
|
+
Contributions and collaboration is welcomed with open arms, but before
|
67
|
+
you contribute, you should take the time to read the
|
68
|
+
[GitPolicy](http://github.com/robgleeson/Dia/blob/master/GitPolicy) and
|
69
|
+
[CodingStyle](http://github.com/robgleeson/Dia/blob/master/CodingStyle) files.
|
70
|
+
|
63
71
|
## Bugs
|
64
72
|
Bug reports are _very_ welcome, and can be reported through the
|
65
73
|
[issue tracker](http://github.com/robgleeson/dia/issues).
|
data/dia.gemspec
CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.summary = s.description
|
19
19
|
|
20
20
|
s.require_paths = ["lib"]
|
21
|
-
s.files = Dir["lib/**/*.rb"] + Dir["test/**/*.rb"] + %w(COPYING Changelog
|
22
|
-
dia.gemspec)
|
21
|
+
s.files = Dir["lib/**/*.rb"] + Dir["test/**/*.rb"] + %w(COPYING Changelog CodingStyle
|
22
|
+
GitPolicy README.md dia.gemspec)
|
23
23
|
s.test_files = Dir["test/**/*.rb"]
|
24
24
|
|
25
25
|
|
@@ -33,11 +33,14 @@ Gem::Specification.new do |s|
|
|
33
33
|
The >=2.0.0 releases are not backward compatiable with the 1.0 series.
|
34
34
|
|
35
35
|
Resources:
|
36
|
-
* API Documentation http://
|
36
|
+
* API Documentation http://doc.fork-bomb.org/dia
|
37
37
|
* Github http://github.com/robgleeson/dia
|
38
38
|
* Mailing List http://groups.google.com/group/ruby-dia
|
39
39
|
|
40
40
|
Release notes are available at the mailing list.
|
41
|
+
|
42
|
+
Please note the API documentation is no longer hosted at http://yardoc.org
|
43
|
+
See the link posted above for the new documentation link.
|
41
44
|
|
42
45
|
Happy Hacking!
|
43
46
|
--------------------------------------------------------------------------------
|
data/lib/dia.rb
CHANGED
@@ -11,5 +11,6 @@ require(File.expand_path('dia/exception_struct' , File.dirname(__FILE__)))
|
|
11
11
|
|
12
12
|
# The Dia module provides a namespace for all classes and modules Dia needs to operate.
|
13
13
|
module Dia
|
14
|
-
VERSION
|
14
|
+
# The VERSION constant represents the current version of Dia.
|
15
|
+
VERSION = '2.2.2'
|
15
16
|
end
|
data/lib/dia/ruby_block.rb
CHANGED
@@ -11,8 +11,79 @@ module Dia
|
|
11
11
|
attr_reader :stdout
|
12
12
|
attr_reader :exception
|
13
13
|
|
14
|
+
# @overload redirect_stderr=(boolean)
|
15
|
+
# This method can enable or disable a feature that will redirect Standard Error output
|
16
|
+
# in the process that is spawned to execute a sandbox.
|
17
|
+
#
|
18
|
+
# @param [Boolean] Enable Passing true will enable the redirection of Standard Error output.
|
19
|
+
#
|
20
|
+
# @param [Boolean] Disable Passing false will disable the redirection of Standard Error output.
|
21
|
+
#
|
22
|
+
# @return [void]
|
23
|
+
#
|
24
|
+
# @see #stderr Standard Error output can be accessed through #stderr.
|
25
|
+
#
|
26
|
+
# @see #redirect_stderr? #redirect_stderr? can tell you if Standard Error output is being
|
27
|
+
# redirected.
|
28
|
+
#
|
29
|
+
# @overload redirect_stderr
|
30
|
+
# This method provides access to the object passed to {#redirect_stderr=}
|
31
|
+
#
|
32
|
+
# @return [Object] Returns the object passed to {#redirect_stderr=}
|
33
|
+
#
|
34
|
+
# @return [Boolean] Returns false if {#redirect_stderr=} has not been called.
|
35
|
+
#
|
36
|
+
# @see #redirect_stderr? #redirect_stderr?
|
14
37
|
attr_accessor :redirect_stderr
|
38
|
+
|
39
|
+
# @overload redirect_stdout=(boolean)
|
40
|
+
# This method can enable or disable a feature that will redirect Standard Output
|
41
|
+
# in the process that is spawned to execute a sandbox.
|
42
|
+
#
|
43
|
+
# @param [Boolean] Enable Passing true will enable the redirection of Standard Output.
|
44
|
+
#
|
45
|
+
# @param [Boolean] Disable Passing false will disable the redirection of Standard Output.
|
46
|
+
#
|
47
|
+
# @return [void]
|
48
|
+
#
|
49
|
+
# @see #stdout Standard Output can be accessed through #stdout.
|
50
|
+
#
|
51
|
+
# @see #redirect_stdout? #redirect_stdout? can tell you if Standard Output is
|
52
|
+
# being redirected.
|
53
|
+
#
|
54
|
+
# @overload redirect_stdout
|
55
|
+
# This method provides access to the object passed to {#redirect_stdout=}
|
56
|
+
#
|
57
|
+
# @return [Object] Returns the object passed to {#redirect_stdout=}
|
58
|
+
#
|
59
|
+
# @return [Boolean] Returns false if {#redirect_stdout=} has not been called.
|
60
|
+
#
|
61
|
+
# @see #redirect_stdout? #redirect_stdout?
|
15
62
|
attr_accessor :redirect_stdout
|
63
|
+
|
64
|
+
|
65
|
+
# @overload rescue_exception=
|
66
|
+
# This method can enable or disable a feature that will try to rescue exceptions
|
67
|
+
# that are raised in the process that is spawned to execute a sandbox.
|
68
|
+
#
|
69
|
+
# @param [Boolean] Enable Passing true will enable the capture of exceptions.
|
70
|
+
#
|
71
|
+
# @param [Boolean] Disable Passing false will disable the capture of exceptions.
|
72
|
+
#
|
73
|
+
# @return [void]
|
74
|
+
#
|
75
|
+
# @see #exception An exception can be accessed through the #exception
|
76
|
+
# method.
|
77
|
+
# @since 2.0.0
|
78
|
+
#
|
79
|
+
# @overload rescue_exception
|
80
|
+
# This method provides access to the object passed to {#rescue_exception=}
|
81
|
+
#
|
82
|
+
# @return [Object] Returns the object passed to {#rescue_exception=}
|
83
|
+
#
|
84
|
+
# @return [Boolean] Returns false if {#rescue_exception=} has not been called.
|
85
|
+
#
|
86
|
+
# @see #rescue_exception? #rescue_exception?
|
16
87
|
attr_accessor :rescue_exception
|
17
88
|
|
18
89
|
# @param [String] Profile Accepts one of five profiles which can be found
|
@@ -29,7 +100,7 @@ module Dia
|
|
29
100
|
"Please consult the documentation.") unless block_given?
|
30
101
|
@profile = profile
|
31
102
|
@proc = block
|
32
|
-
@
|
103
|
+
@rescue_exception = false
|
33
104
|
@redirect_stdout = false
|
34
105
|
@redirect_stderr = false
|
35
106
|
@pipes = {}
|
@@ -61,37 +132,27 @@ module Dia
|
|
61
132
|
@stdout
|
62
133
|
end
|
63
134
|
|
64
|
-
# This method can enable or disable a feature that will redirect Standard Output
|
65
|
-
# in the process that is spawned to execute a sandbox.
|
66
|
-
#
|
67
|
-
# @param [true] Enable Passing true will enable the redirection of Standard Output.
|
68
|
-
#
|
69
|
-
# @param [false] Disable Passing false will disable the redirection of Standard Output.
|
70
|
-
#
|
71
|
-
# @return [void]
|
72
|
-
#
|
73
|
-
# @see #stdout Standard Output can be accessed through #stdout.
|
74
|
-
#
|
75
|
-
# @see #redirect_stdout? #redirect_stdout? can tell you if Standard Output is
|
76
|
-
# being redirected.
|
77
135
|
def redirect_stdout=(boolean)
|
78
136
|
@redirect_stdout = boolean
|
79
137
|
end
|
80
138
|
|
139
|
+
def redirect_stdout
|
140
|
+
@redirect_stdout
|
141
|
+
end
|
142
|
+
|
81
143
|
# This method will tell you if Standard Output is being redirected in the
|
82
144
|
# process spawned to execute a sandbox.
|
83
145
|
#
|
84
|
-
# @return [
|
146
|
+
# @return [Boolean] Returns true when Standard Output is being redirected.
|
85
147
|
#
|
86
|
-
# @return [
|
148
|
+
# @return [Boolean] Returns false when Standard Output is not being redirected.
|
87
149
|
#
|
88
|
-
# @see #redirect_stdout=
|
150
|
+
# @see #redirect_stdout= Redirection of stdout can be enabled through #redirect_stdout=.
|
89
151
|
#
|
90
|
-
# @see #stdout
|
91
|
-
def redirect_stdout
|
152
|
+
# @see #stdout Standard Ouput can be accessed through #stdout.
|
153
|
+
def redirect_stdout?
|
92
154
|
!!@redirect_stdout
|
93
155
|
end
|
94
|
-
alias :redirect_stdout? :redirect_stdout
|
95
156
|
|
96
157
|
# Provides access to the Standard Error stream of the process that was last used to execute
|
97
158
|
# a sandbox. This feature is disabled by default.
|
@@ -116,53 +177,43 @@ module Dia
|
|
116
177
|
@stderr
|
117
178
|
end
|
118
179
|
|
119
|
-
# This method can enable or disable a feature that will redirect Standard Error output
|
120
|
-
# in the process that is spawned to execute a sandbox.
|
121
|
-
#
|
122
|
-
# @param [true] Enable Passing true will enable the redirection of Standard Error output.
|
123
|
-
#
|
124
|
-
# @param [false] Disable Passing false will disable the redirection of Standard Error output.
|
125
|
-
#
|
126
|
-
# @return [void]
|
127
|
-
#
|
128
|
-
# @see #stderr Standard Error output can be accessed through #stderr.
|
129
|
-
#
|
130
|
-
# @see #redirect_stderr? #redirect_stderr? can tell you if Standard Error output is being
|
131
|
-
# redirected.
|
132
180
|
def redirect_stderr=(boolean)
|
133
181
|
@redirect_stderr = boolean
|
134
182
|
end
|
135
183
|
|
184
|
+
def redirect_stderr
|
185
|
+
@redirect_stderr
|
186
|
+
end
|
187
|
+
|
136
188
|
# This method will tell you if Standard Error output is being redirected in the process
|
137
189
|
# spawned to execute a sandbox.
|
138
190
|
#
|
139
|
-
# @return [
|
191
|
+
# @return [Boolean] Returns true when Standard Error output is being redirected.
|
140
192
|
#
|
141
|
-
# @return [
|
193
|
+
# @return [Boolean] Returns false when Standard Error output is not being redirected.
|
142
194
|
#
|
143
|
-
# @see #redirect_stderr=
|
195
|
+
# @see #redirect_stderr= Redirection of stderr can be enabled through #redirect_stderr=.
|
144
196
|
#
|
145
|
-
# @see #stderr
|
146
|
-
def redirect_stderr
|
197
|
+
# @see #stderr Standard Error output can be accessed through #stderr.
|
198
|
+
def redirect_stderr?
|
147
199
|
!!@redirect_stderr
|
148
200
|
end
|
149
|
-
alias :redirect_stderr? :redirect_stderr
|
150
201
|
|
151
202
|
# This method will tell you if an exception has been rescued in the process that was
|
152
203
|
# last used to execute a sandbox.
|
153
204
|
#
|
154
|
-
# @return [
|
205
|
+
# @return [Boolean] Returns true when an exception has been rescued.
|
155
206
|
#
|
156
|
-
# @return [
|
207
|
+
# @return [Boolean] Returns false when an exception has not been rescued.
|
157
208
|
#
|
158
|
-
# @return [
|
159
|
-
#
|
209
|
+
# @return [Boolean] Returns false if Dia was not set to rescue exceptions
|
210
|
+
# before a call to {#run} or {#run_nonblock}.
|
160
211
|
#
|
161
|
-
# @see #rescue_exception=
|
162
|
-
#
|
212
|
+
# @see #rescue_exception= The rescue of exceptions can be enabled or disabled through
|
213
|
+
# #rescue_exception=
|
163
214
|
#
|
164
|
-
# @see #exception
|
165
|
-
#
|
215
|
+
# @see #exception An exception can be accessed through the #exception
|
216
|
+
# method.
|
166
217
|
def exception_rescued?
|
167
218
|
!!exception
|
168
219
|
end
|
@@ -180,36 +231,22 @@ module Dia
|
|
180
231
|
# This method will tell you if an exception will be rescued in the process that is
|
181
232
|
# spawned to execute a sandbox.
|
182
233
|
#
|
183
|
-
# @return [
|
234
|
+
# @return [Boolean] Returns true when exceptions are being rescued.
|
184
235
|
#
|
185
|
-
# @return [
|
186
|
-
#
|
236
|
+
# @return [Boolean] Returns false when are exceptions are not being
|
237
|
+
# rescued.
|
187
238
|
# @since 2.0.0
|
188
239
|
#
|
189
|
-
# @see #rescue_exception=
|
190
|
-
#
|
191
|
-
def rescue_exception
|
192
|
-
!!@
|
240
|
+
# @see #rescue_exception= The rescue of exceptions can be enabled or disabled through
|
241
|
+
# #rescue_exception=
|
242
|
+
def rescue_exception?
|
243
|
+
!!@rescue_exception
|
193
244
|
end
|
194
|
-
alias :rescue_exception? :rescue_exception
|
195
245
|
|
196
|
-
# This method can enable or disable a feature that will try to rescue exceptions
|
197
|
-
# that are raised in the process that is spawned to execute a sandbox.
|
198
|
-
#
|
199
|
-
# @param [true] Enable Passing true will enable the capture of exceptions.
|
200
|
-
#
|
201
|
-
# @param [false] Disable Passing false will disable the capture of exceptions.
|
202
|
-
#
|
203
|
-
# @return [void]
|
204
|
-
#
|
205
|
-
# @see #exception An exception can be accessed through the #exception
|
206
|
-
# method.
|
207
|
-
# @since 2.0.0
|
208
246
|
def rescue_exception=(boolean)
|
209
|
-
@
|
247
|
+
@rescue_exception = boolean
|
210
248
|
end
|
211
249
|
|
212
|
-
|
213
250
|
# Provides access to the data of an exception object that has been rescued in the process
|
214
251
|
# that was last used to execute a sandbox. This feature is disabled by default.
|
215
252
|
#
|
@@ -303,7 +340,7 @@ module Dia
|
|
303
340
|
@pid = fork do
|
304
341
|
redirect(:stdout) if @redirect_stdout
|
305
342
|
redirect(:stderr) if @redirect_stderr
|
306
|
-
if @
|
343
|
+
if @rescue_exception
|
307
344
|
begin
|
308
345
|
initialize_sandbox
|
309
346
|
write_return_value(@proc.call(*args))
|
@@ -368,7 +405,7 @@ module Dia
|
|
368
405
|
# @api private
|
369
406
|
def open_pipes_if_needed
|
370
407
|
@pipes[:return_reader] , @pipes[:return_writer] = IO.pipe
|
371
|
-
@pipes[:exception_reader], @pipes[:exception_writer] = IO.pipe if @
|
408
|
+
@pipes[:exception_reader], @pipes[:exception_writer] = IO.pipe if @rescue_exception
|
372
409
|
@pipes[:stdout_reader] , @pipes[:stdout_writer] = IO.pipe if @redirect_stdout
|
373
410
|
@pipes[:stderr_reader] , @pipes[:stderr_writer] = IO.pipe if @redirect_stderr
|
374
411
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
suite('RubyBlock') do
|
2
|
+
suite('#redirect_stderr') do
|
3
|
+
suite('Return values') do
|
4
|
+
|
5
|
+
setup do
|
6
|
+
@result = nil
|
7
|
+
end
|
8
|
+
|
9
|
+
exercise('When #redriect_stderr= is passed an object.') do
|
10
|
+
@dia = Dia::RubyBlock.new(Dia::Profiles::NO_INTERNET) { }
|
11
|
+
@dia.redirect_stderr = "test"
|
12
|
+
end
|
13
|
+
|
14
|
+
verify('#redirect_stderr returns that object.') do
|
15
|
+
@dia.redirect_stderr == "test"
|
16
|
+
end
|
17
|
+
|
18
|
+
exercise('When #redirect_stderr= is not passed an object.') do
|
19
|
+
@dia = Dia::RubyBlock.new(Dia::Profiles::NO_INTERNET) { }
|
20
|
+
end
|
21
|
+
|
22
|
+
verify('#redirect_stderr returns false') do
|
23
|
+
@dia.redirect_stderr == false
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
suite('RubyBlock') do
|
2
|
+
suite('#redirect_stdout') do
|
3
|
+
suite('Return values') do
|
4
|
+
|
5
|
+
setup do
|
6
|
+
@result = nil
|
7
|
+
end
|
8
|
+
|
9
|
+
exercise('When #redriect_stdout= is passed an object.') do
|
10
|
+
@dia = Dia::RubyBlock.new(Dia::Profiles::NO_INTERNET) { }
|
11
|
+
@dia.redirect_stdout = "test"
|
12
|
+
end
|
13
|
+
|
14
|
+
verify('#redirect_stdout returns that object.') do
|
15
|
+
@dia.redirect_stdout == "test"
|
16
|
+
end
|
17
|
+
|
18
|
+
exercise('When #redirect_stdout= is not passed an object.') do
|
19
|
+
@dia = Dia::RubyBlock.new(Dia::Profiles::NO_INTERNET) { }
|
20
|
+
end
|
21
|
+
|
22
|
+
verify('#redirect_stdout returns false') do
|
23
|
+
@dia.redirect_stdout == false
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
suite('RubyBlock') do
|
2
|
+
suite('#rescue_exception') do
|
3
|
+
suite('Return values') do
|
4
|
+
|
5
|
+
setup do
|
6
|
+
@result = nil
|
7
|
+
end
|
8
|
+
|
9
|
+
exercise('When #rescue_exception= is passed an object.') do
|
10
|
+
@dia = Dia::RubyBlock.new(Dia::Profiles::NO_INTERNET) { }
|
11
|
+
@dia.rescue_exception = "test"
|
12
|
+
end
|
13
|
+
|
14
|
+
verify('#rescue_exception returns that object.') do
|
15
|
+
@dia.rescue_exception == "test"
|
16
|
+
end
|
17
|
+
|
18
|
+
exercise('When #rescue_exception= is not passed an object.') do
|
19
|
+
@dia = Dia::RubyBlock.new(Dia::Profiles::NO_INTERNET) { }
|
20
|
+
end
|
21
|
+
|
22
|
+
verify('#rescue_exception returns false') do
|
23
|
+
@dia.rescue_exception == false
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 2
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 2.2.
|
8
|
+
- 2
|
9
|
+
version: 2.2.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Robert Gleeson
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-08-
|
17
|
+
date: 2010-08-24 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -73,8 +73,11 @@ files:
|
|
73
73
|
- test/suite/lib/dia/Application#run_nonblock.rb
|
74
74
|
- test/suite/lib/dia/RubyBlock#exception.rb
|
75
75
|
- test/suite/lib/dia/RubyBlock#exception_raised?.rb
|
76
|
+
- test/suite/lib/dia/RubyBlock#redirect_stderr.rb
|
76
77
|
- test/suite/lib/dia/RubyBlock#redirect_stderr?.rb
|
78
|
+
- test/suite/lib/dia/RubyBlock#redirect_stdout.rb
|
77
79
|
- test/suite/lib/dia/RubyBlock#redirect_stdout?.rb
|
80
|
+
- test/suite/lib/dia/RubyBlock#rescue_exception.rb
|
78
81
|
- test/suite/lib/dia/RubyBlock#rescue_exception?.rb
|
79
82
|
- test/suite/lib/dia/RubyBlock#run.rb
|
80
83
|
- test/suite/lib/dia/RubyBlock#run_nonblock.rb
|
@@ -87,13 +90,15 @@ files:
|
|
87
90
|
- test/suite/lib/dia/SharedFeatures#terminate.rb
|
88
91
|
- COPYING
|
89
92
|
- Changelog
|
90
|
-
-
|
93
|
+
- CodingStyle
|
94
|
+
- GitPolicy
|
95
|
+
- README.md
|
91
96
|
- dia.gemspec
|
92
97
|
has_rdoc: yard
|
93
98
|
homepage:
|
94
99
|
licenses: []
|
95
100
|
|
96
|
-
post_install_message: " -------------------------------------------------------------------------------- \n Thanks for installing Dia, 2.2.
|
101
|
+
post_install_message: " -------------------------------------------------------------------------------- \n Thanks for installing Dia, 2.2.2! \n The >=2.0.0 releases are not backward compatiable with the 1.0 series.\n \n Resources: \n * API Documentation http://doc.fork-bomb.org/dia\n * Github http://github.com/robgleeson/dia \n * Mailing List http://groups.google.com/group/ruby-dia\n\n Release notes are available at the mailing list.\n \n Please note the API documentation is no longer hosted at http://yardoc.org\n See the link posted above for the new documentation link.\n\n Happy Hacking!\n -------------------------------------------------------------------------------- \n"
|
97
102
|
rdoc_options: []
|
98
103
|
|
99
104
|
require_paths:
|
@@ -128,8 +133,11 @@ test_files:
|
|
128
133
|
- test/suite/lib/dia/Application#run_nonblock.rb
|
129
134
|
- test/suite/lib/dia/RubyBlock#exception.rb
|
130
135
|
- test/suite/lib/dia/RubyBlock#exception_raised?.rb
|
136
|
+
- test/suite/lib/dia/RubyBlock#redirect_stderr.rb
|
131
137
|
- test/suite/lib/dia/RubyBlock#redirect_stderr?.rb
|
138
|
+
- test/suite/lib/dia/RubyBlock#redirect_stdout.rb
|
132
139
|
- test/suite/lib/dia/RubyBlock#redirect_stdout?.rb
|
140
|
+
- test/suite/lib/dia/RubyBlock#rescue_exception.rb
|
133
141
|
- test/suite/lib/dia/RubyBlock#rescue_exception?.rb
|
134
142
|
- test/suite/lib/dia/RubyBlock#run.rb
|
135
143
|
- test/suite/lib/dia/RubyBlock#run_nonblock.rb
|