vedeu 0.6.8 → 0.6.9

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.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +9 -0
  3. data/README.md +1 -1
  4. data/docs/api.md +60 -67
  5. data/docs/configuration.md +8 -5
  6. data/docs/events.md +31 -15
  7. data/docs/events/application.md +12 -0
  8. data/docs/events/document.md +57 -0
  9. data/docs/events/drb.md +43 -0
  10. data/docs/events/focus.md +24 -0
  11. data/docs/events/menu.md +57 -0
  12. data/docs/events/movement.md +57 -0
  13. data/docs/events/refresh.md +25 -0
  14. data/docs/events/system.md +90 -0
  15. data/docs/events/visibility.md +68 -0
  16. data/lib/vedeu.rb +2 -2
  17. data/lib/vedeu/all.rb +3 -2
  18. data/lib/vedeu/api.rb +18 -18
  19. data/lib/vedeu/application/controller.rb +1 -1
  20. data/lib/vedeu/application/helper.rb +1 -1
  21. data/lib/vedeu/application/view.rb +1 -1
  22. data/lib/vedeu/bindings/application.rb +1 -12
  23. data/lib/vedeu/bindings/bindings.rb +3 -1
  24. data/lib/vedeu/bindings/document.rb +9 -62
  25. data/lib/vedeu/bindings/drb.rb +12 -56
  26. data/lib/vedeu/bindings/focus.rb +3 -28
  27. data/lib/vedeu/bindings/menus.rb +10 -66
  28. data/lib/vedeu/bindings/movement.rb +4 -69
  29. data/lib/vedeu/bindings/refresh.rb +3 -33
  30. data/lib/vedeu/bindings/system.rb +14 -100
  31. data/lib/vedeu/bindings/visibility.rb +20 -71
  32. data/lib/vedeu/borders/all.rb +4 -3
  33. data/lib/vedeu/borders/border.rb +39 -33
  34. data/lib/vedeu/borders/dsl.rb +40 -33
  35. data/lib/vedeu/borders/null.rb +2 -2
  36. data/lib/vedeu/borders/render.rb +29 -24
  37. data/lib/vedeu/borders/repository.rb +2 -2
  38. data/lib/vedeu/buffers/all.rb +8 -7
  39. data/lib/vedeu/buffers/buffer.rb +47 -39
  40. data/lib/vedeu/buffers/null.rb +2 -2
  41. data/lib/vedeu/buffers/refresh.rb +4 -3
  42. data/lib/vedeu/buffers/virtual_buffer.rb +122 -118
  43. data/lib/vedeu/buffers/virtual_buffers.rb +62 -56
  44. data/lib/vedeu/colours/background.rb +2 -1
  45. data/lib/vedeu/colours/colour.rb +21 -19
  46. data/lib/vedeu/colours/foreground.rb +2 -1
  47. data/lib/vedeu/colours/repository.rb +6 -5
  48. data/lib/vedeu/colours/translator.rb +39 -35
  49. data/lib/vedeu/configuration/api.rb +59 -51
  50. data/lib/vedeu/configuration/cli.rb +9 -7
  51. data/lib/vedeu/configuration/configuration.rb +41 -32
  52. data/lib/vedeu/cursors/cursor.rb +1 -1
  53. data/lib/vedeu/cursors/refresh.rb +20 -16
  54. data/lib/vedeu/distributed/server.rb +8 -6
  55. data/lib/vedeu/distributed/subprocess.rb +90 -86
  56. data/lib/vedeu/distributed/uri.rb +4 -3
  57. data/lib/vedeu/dsl/composition.rb +2 -2
  58. data/lib/vedeu/dsl/group.rb +4 -4
  59. data/lib/vedeu/dsl/interface.rb +5 -5
  60. data/lib/vedeu/dsl/presentation.rb +2 -2
  61. data/lib/vedeu/dsl/text.rb +1 -1
  62. data/lib/vedeu/editor/cropper.rb +4 -4
  63. data/lib/vedeu/editor/cursor.rb +6 -4
  64. data/lib/vedeu/editor/document.rb +20 -18
  65. data/lib/vedeu/editor/editor.rb +2 -2
  66. data/lib/vedeu/editor/line.rb +10 -5
  67. data/lib/vedeu/editor/lines.rb +2 -2
  68. data/lib/vedeu/internal_api.rb +4 -4
  69. data/lib/vedeu/models/focus.rb +197 -191
  70. data/lib/vedeu/models/group.rb +171 -159
  71. data/lib/vedeu/models/groups.rb +14 -10
  72. data/lib/vedeu/models/interface.rb +116 -110
  73. data/lib/vedeu/models/interfaces.rb +24 -20
  74. data/lib/vedeu/models/toggleable.rb +4 -4
  75. data/lib/vedeu/models/views/char.rb +1 -1
  76. data/lib/vedeu/models/views/composition.rb +1 -1
  77. data/lib/vedeu/models/views/line.rb +1 -1
  78. data/lib/vedeu/models/views/stream.rb +1 -1
  79. data/lib/vedeu/models/views/view.rb +1 -1
  80. data/lib/vedeu/null/interface.rb +1 -1
  81. data/lib/vedeu/null/view.rb +1 -1
  82. data/lib/vedeu/output/clear/named_interface.rb +1 -1
  83. data/lib/vedeu/output/compressor.rb +78 -73
  84. data/lib/vedeu/output/direct.rb +61 -57
  85. data/lib/vedeu/output/output.rb +34 -29
  86. data/lib/vedeu/output/{presentation.rb → presentation/presentation.rb} +2 -1
  87. data/lib/vedeu/output/presentation/style.rb +64 -18
  88. data/lib/vedeu/output/presentation/styles.rb +39 -0
  89. data/lib/vedeu/output/renderers/html.rb +2 -2
  90. data/lib/vedeu/output/renderers/json.rb +2 -1
  91. data/lib/vedeu/output/renderers/terminal.rb +3 -3
  92. data/lib/vedeu/output/renderers/text.rb +3 -3
  93. data/lib/vedeu/output/text.rb +186 -180
  94. data/lib/vedeu/output/wordwrap.rb +142 -138
  95. data/lib/vedeu/refresh/refresh.rb +2 -2
  96. data/lib/vedeu/templating/helpers.rb +11 -6
  97. data/lib/vedeu/templating/view_template.rb +1 -1
  98. data/lib/vedeu/terminal/terminal.rb +2 -2
  99. data/lib/vedeu/version.rb +1 -1
  100. data/test/lib/vedeu/borders/render_test.rb +1 -1
  101. data/test/lib/vedeu/buffers/buffer_test.rb +16 -14
  102. data/test/lib/vedeu/buffers/virtual_buffer_test.rb +105 -101
  103. data/test/lib/vedeu/buffers/virtual_buffers_test.rb +43 -39
  104. data/test/lib/vedeu/colours/colour_test.rb +4 -4
  105. data/test/lib/vedeu/cursors/cursor_test.rb +2 -2
  106. data/test/lib/vedeu/cursors/repository_test.rb +3 -3
  107. data/test/lib/vedeu/distributed/subprocess_test.rb +33 -29
  108. data/test/lib/vedeu/dsl/group_test.rb +3 -3
  109. data/test/lib/vedeu/dsl/interface_test.rb +6 -5
  110. data/test/lib/vedeu/dsl/line_test.rb +4 -2
  111. data/test/lib/vedeu/dsl/presentation_test.rb +2 -2
  112. data/test/lib/vedeu/dsl/text_test.rb +8 -8
  113. data/test/lib/vedeu/editor/document_test.rb +10 -6
  114. data/test/lib/vedeu/input/keymap_test.rb +1 -10
  115. data/test/lib/vedeu/models/focus_test.rb +177 -170
  116. data/test/lib/vedeu/models/group_test.rb +99 -95
  117. data/test/lib/vedeu/models/groups_test.rb +13 -9
  118. data/test/lib/vedeu/models/interface_test.rb +93 -87
  119. data/test/lib/vedeu/models/interfaces_test.rb +24 -20
  120. data/test/lib/vedeu/models/views/char_test.rb +2 -2
  121. data/test/lib/vedeu/models/views/line_test.rb +11 -7
  122. data/test/lib/vedeu/models/views/stream_test.rb +1 -1
  123. data/test/lib/vedeu/models/views/view_test.rb +1 -1
  124. data/test/lib/vedeu/output/clear/named_group_test.rb +1 -1
  125. data/test/lib/vedeu/output/clear/named_interface_test.rb +3 -1
  126. data/test/lib/vedeu/output/compressor_test.rb +126 -122
  127. data/test/lib/vedeu/output/direct_test.rb +49 -43
  128. data/test/lib/vedeu/output/output_test.rb +35 -31
  129. data/test/lib/vedeu/output/{presentation_test.rb → presentation/presentation_test.rb} +11 -7
  130. data/test/lib/vedeu/output/presentation/style_test.rb +88 -48
  131. data/test/lib/vedeu/output/presentation/styles_test.rb +84 -0
  132. data/test/lib/vedeu/output/text_test.rb +109 -105
  133. data/test/lib/vedeu/output/viewport_test.rb +3 -1
  134. data/test/lib/vedeu/output/wordwrap_test.rb +209 -205
  135. data/test/lib/vedeu/refresh/refresh_test.rb +3 -1
  136. data/test/lib/vedeu/templating/helpers_test.rb +6 -6
  137. data/test/lib/vedeu/templating/view_template_test.rb +1 -1
  138. metadata +17 -8
  139. data/lib/vedeu/output/style.rb +0 -76
  140. data/test/lib/vedeu/output/style_test.rb +0 -120
@@ -8,7 +8,8 @@ module Vedeu
8
8
 
9
9
  # Custom log for configuration.
10
10
  #
11
- # @param from [String] Which configuration set the options ('API' or 'CLI').
11
+ # @param from [String] Which configuration set the options
12
+ # ('API' or 'CLI').
12
13
  # @param options [Hash] The configuration options set.
13
14
  # @return [Hash] The options param.
14
15
  def log(from, options)
@@ -20,13 +21,13 @@ module Vedeu
20
21
 
21
22
  end
22
23
 
23
- # Allows the customisation of Vedeu's behaviour through the configuration API
24
- # or command-line arguments.
24
+ # Allows the customisation of Vedeu's behaviour through the
25
+ # configuration API or command-line arguments.
25
26
  #
26
- # Provides access to Vedeu's configuration, which was set with sensible
27
- # defaults (influenced by environment variables), overridden by client
28
- # application settings (via the configuration API), or any command-line
29
- # arguments provided.
27
+ # Provides access to Vedeu's configuration, which was set with
28
+ # sensible defaults (influenced by environment variables),
29
+ # overridden by client application settings (via the configuration
30
+ # API), or any command-line arguments provided.
30
31
  #
31
32
  class Configuration
32
33
 
@@ -49,10 +50,10 @@ module Vedeu
49
50
  end
50
51
  alias_method :compression?, :compression
51
52
 
52
- # Provides the mechanism to configure Vedeu. If the client application
53
- # sets options, override the defaults with those, and when command-line
54
- # arguments are provided at application invocation, override any options
55
- # with the arguments provided.
53
+ # Provides the mechanism to configure Vedeu. If the client
54
+ # application sets options, override the defaults with those,
55
+ # and when command-line arguments are provided at application
56
+ # invocation, override any options with the arguments provided.
56
57
  #
57
58
  # @example
58
59
  # Vedeu.configure do
@@ -73,7 +74,8 @@ module Vedeu
73
74
  end
74
75
 
75
76
  # Returns the configuration singleton.
76
- # Append configuration methods to access the configuration variable.
77
+ # Append configuration methods to access the configuration
78
+ # variable.
77
79
  #
78
80
  # @example
79
81
  # Vedeu.configuration
@@ -90,8 +92,9 @@ module Vedeu
90
92
  instance.options[:colour_mode]
91
93
  end
92
94
 
93
- # Returns whether debugging is enabled or disabled. Default is false;
94
- # meaning nothing apart from warnings are written to the log file.
95
+ # Returns whether debugging is enabled or disabled. Default is
96
+ # false; meaning nothing apart from warnings are written to the
97
+ # log file.
95
98
  #
96
99
  # @return [Boolean]
97
100
  def debug?
@@ -99,7 +102,8 @@ module Vedeu
99
102
  end
100
103
  alias_method :debug, :debug?
101
104
 
102
- # Returns whether the DRb server is enabled or disabled. Default is false.
105
+ # Returns whether the DRb server is enabled or disabled. Default
106
+ # is false.
103
107
  #
104
108
  # @return [Boolean]
105
109
  def drb?
@@ -135,9 +139,10 @@ module Vedeu
135
139
  instance.options[:drb_width]
136
140
  end
137
141
 
138
- # Returns whether the application is interactive (required user input) or
139
- # standalone (will run until terminates of natural causes.) Default is
140
- # true; meaning the application will require user input.
142
+ # Returns whether the application is interactive (required user
143
+ # input) or standalone (will run until terminates of natural
144
+ # causes.) Default is true; meaning the application will require
145
+ # user input.
141
146
  #
142
147
  # @return [Boolean]
143
148
  def interactive?
@@ -152,7 +157,8 @@ module Vedeu
152
157
  instance.options[:log]
153
158
  end
154
159
 
155
- # Returns a boolean indicating whether the log has been configured.
160
+ # Returns a boolean indicating whether the log has been
161
+ # configured.
156
162
  #
157
163
  # @return [Boolean]
158
164
  def log?
@@ -164,9 +170,9 @@ module Vedeu
164
170
  instance.options[:log_only] || []
165
171
  end
166
172
 
167
- # Returns whether the application will run through its main loop once or
168
- # not. Default is false; meaning the application will loop forever or
169
- # until terminated by the user.
173
+ # Returns whether the application will run through its main loop
174
+ # once or not. Default is false; meaning the application will
175
+ # loop forever or until terminated by the user.
170
176
  #
171
177
  # @return [Boolean]
172
178
  def once?
@@ -181,8 +187,8 @@ module Vedeu
181
187
  instance.options[:renderers]
182
188
  end
183
189
 
184
- # Returns the root of the client application. Vedeu will execute this
185
- # controller first.
190
+ # Returns the root of the client application. Vedeu will execute
191
+ # this controller first.
186
192
  #
187
193
  # @return [Class]
188
194
  def root
@@ -210,7 +216,8 @@ module Vedeu
210
216
  instance.options[:stderr]
211
217
  end
212
218
 
213
- # Returns the terminal mode for the application. Default is `:raw`.
219
+ # Returns the terminal mode for the application. Default is
220
+ # `:raw`.
214
221
  #
215
222
  # @return [Symbol]
216
223
  def terminal_mode
@@ -243,9 +250,10 @@ module Vedeu
243
250
  @options = defaults
244
251
  end
245
252
 
246
- # Set up default configuration and then allow the client application to
247
- # modify it via the configuration API. After this, process any command line
248
- # arguments as potential configuration and apply that.
253
+ # Set up default configuration and then allow the client
254
+ # application to modify it via the configuration API. After this,
255
+ # process any command line arguments as potential configuration
256
+ # and apply that.
249
257
  #
250
258
  # @param args [Array]
251
259
  # @param block [Proc]
@@ -270,8 +278,8 @@ module Vedeu
270
278
 
271
279
  private
272
280
 
273
- # The Vedeu default options, which of course are influenced by environment
274
- # variables also.
281
+ # The Vedeu default options, which of course are influenced by
282
+ # environment variables also.
275
283
  #
276
284
  # @return [Hash<Symbol => void>]
277
285
  def defaults
@@ -298,8 +306,9 @@ module Vedeu
298
306
  }
299
307
  end
300
308
 
301
- # Attempt to determine the terminal colour mode via $TERM environment
302
- # variable, or be optimistic and settle for 256 colours.
309
+ # Attempt to determine the terminal colour mode via $TERM
310
+ # environment variable, or be optimistic and settle for 256
311
+ # colours.
303
312
  #
304
313
  # @return [Fixnum]
305
314
  def detect_colour_mode
@@ -138,7 +138,7 @@ module Vedeu
138
138
  #
139
139
  # @return [Array<Vedeu::Models::Escape>]
140
140
  def render
141
- Vedeu::Output.render(visibility)
141
+ Vedeu::Output::Output.render(visibility)
142
142
  end
143
143
 
144
144
  # Arbitrarily move the cursor to a given position.
@@ -2,8 +2,9 @@ module Vedeu
2
2
 
3
3
  module Cursors
4
4
 
5
- # Handle the refreshing (redrawing) of a cursor, without redrawing the whole
6
- # interface; unless the cursor's offset has caused the view to change.
5
+ # Handle the refreshing (redrawing) of a cursor, without redrawing
6
+ # the whole interface; unless the cursor's offset has caused the
7
+ # view to change.
7
8
  #
8
9
  class Refresh
9
10
 
@@ -14,7 +15,7 @@ module Vedeu
14
15
  :width
15
16
 
16
17
  # @param (see #initialize)
17
- def self.by_name(name = Vedeu.focus)
18
+ def self.by_name(name = nil)
18
19
  new(name).by_name
19
20
  end
20
21
 
@@ -22,13 +23,14 @@ module Vedeu
22
23
  #
23
24
  # @param name [String] The name of the cursor.
24
25
  # @return [Vedeu::Cursors::Refresh]
25
- def initialize(name)
26
- @name = name
26
+ def initialize(name = nil)
27
+ @name = name || Vedeu.focus
27
28
  end
28
29
 
29
- # Renders the cursor in the terminal. If the cursor's x or y offsets are
30
- # greater or equal to the interface's width or height respectively, then
31
- # the view is also refreshed, causing the content to be offset also.
30
+ # Renders the cursor in the terminal. If the cursor's x or y
31
+ # offsets are greater or equal to the interface's width or
32
+ # height respectively, then the view is also refreshed, causing
33
+ # the content to be offset also.
32
34
  #
33
35
  # @return [Array]
34
36
  def by_name
@@ -47,9 +49,9 @@ module Vedeu
47
49
 
48
50
  private
49
51
 
50
- # Returns true when the view should be refreshed. This is determined by
51
- # checking that the offsets for x and y are outside the width and height
52
- # of the named interface.
52
+ # Returns true when the view should be refreshed. This is
53
+ # determined by checking that the offsets for x and y are
54
+ # outside the width and height of the named interface.
53
55
  #
54
56
  # @return [Boolean]
55
57
  def refresh_view?
@@ -65,11 +67,13 @@ module Vedeu
65
67
  # Fetch the border by name.
66
68
  #
67
69
  # @note
68
- # Vedeu::Borders::Border is used in this way because when there is not a
69
- # border defined, it will fallback to a Vedeu::Borders::Null which uses
70
- # Vedeu::Geometry::Geometry to determine it's dimensions based on the
71
- # name also. When a Vedeu::Geometry::Geometry cannot be found, this
72
- # falls back to a Vedeu::Geometry::Null which uses the dimensions of the
70
+ # {Vedeu::Borders::Border} is used in this way because when
71
+ # there is not a border defined, it will fallback to a
72
+ # {Vedeu::Borders::Null} which uses
73
+ # {Vedeu::Geometry::Geometry} to determine it's dimensions
74
+ # based on the name also. When a {Vedeu::Geometry::Geometry}
75
+ # cannot be found, this falls back to a
76
+ # {Vedeu::Geometry::Null} which uses the dimensions of the
73
77
  # current terminal.
74
78
  #
75
79
  # @return (see Vedeu::Borders::Repository#by_name)
@@ -1,10 +1,12 @@
1
1
  module Vedeu
2
2
 
3
- # Provides a mechanism to control a running client application via DRb.
3
+ # Provides a mechanism to control a running client application via
4
+ # DRb.
4
5
  #
5
6
  module Distributed
6
7
 
7
- # A class for the server side of the DRb server/client relationship.
8
+ # A class for the server side of the DRb server/client
9
+ # relationship.
8
10
  class Server
9
11
 
10
12
  $SAFE = 1 # disable `eval` and related calls on strings passed
@@ -106,12 +108,12 @@ module Vedeu
106
108
  end
107
109
  end
108
110
 
109
- # When called will stop the DRb server and attempt to terminate the client
110
- # application.
111
+ # When called will stop the DRb server and attempt to terminate
112
+ # the client application.
111
113
  #
112
114
  # @note
113
- # :_exit_ never gets triggered as when the DRb server goes away, no
114
- # further methods will be called.
115
+ # :_exit_ never gets triggered as when the DRb server goes
116
+ # away, no further methods will be called.
115
117
  #
116
118
  # @return [void]
117
119
  def shutdown
@@ -1,96 +1,100 @@
1
1
  module Vedeu
2
2
 
3
- # @example
4
- # Vedeu::TestApplication.build
5
- #
6
- class Subprocess
3
+ module Distributed
7
4
 
8
- # @param (see #initialize)
9
- def self.execute!(application)
10
- new(application).execute!
11
- end
12
-
13
- # Returns a new instance of Vedeu::Subprocess.
5
+ # @example
6
+ # Vedeu::TestApplication.build
14
7
  #
15
- # @param application [Vedeu::TestApplication]
16
- # @return [Vedeu::Subprocess]
17
- def initialize(application)
18
- @application = application
19
- @pid = nil
20
- end
21
-
22
- # :nocov:
23
- # @return [Array]
24
- def execute!
25
- file_open && file_write && file_close
26
-
27
- @pid = fork do
28
- exec(file_path)
8
+ class Subprocess
9
+
10
+ # @param (see #initialize)
11
+ def self.execute!(application)
12
+ new(application).execute!
29
13
  end
30
14
 
31
- Process.detach(@pid)
15
+ # Returns a new instance of Vedeu::Distributed::Subprocess.
16
+ #
17
+ # @param application [Vedeu::TestApplication]
18
+ # @return [Vedeu::Distributed::Subprocess]
19
+ def initialize(application)
20
+ @application = application
21
+ @pid = nil
22
+ end
32
23
 
33
- self
34
- end
35
- # :nocov:
24
+ # :nocov:
25
+ # @return [Array]
26
+ def execute!
27
+ file_open && file_write && file_close
36
28
 
37
- # Sends the KILL signal to the process.
38
- #
39
- # @return [void]
40
- def kill
41
- Process.kill('KILL', pid)
42
-
43
- file_unlink
44
- end
45
-
46
- protected
47
-
48
- # @!attribute [r] application
49
- # @return [Vedeu::TestApplication]
50
- attr_reader :application
51
-
52
- # @!attribute [r] pid
53
- # @return [Fixnum]
54
- attr_reader :pid
55
-
56
- private
57
-
58
- # @return [String]
59
- def command
60
- "ruby #{file_path}"
61
- end
62
-
63
- # @return [Fixnum] The number of bytes written.
64
- def file_write
65
- file.write(application)
66
- end
67
-
68
- # @return [NilClass]
69
- def file_close
70
- file.close
71
- end
72
-
73
- # @return [Fixnum] The number of files removed; 1.
74
- def file_unlink
75
- File.unlink("/tmp/foo_#{timestamp}")
76
- end
77
-
78
- # return [String]
79
- def file_path
80
- file.path
81
- end
82
-
83
- # @return [File]
84
- def file_open
85
- @file ||= File.new("/tmp/foo_#{timestamp}", 'w', 0755)
86
- end
87
- alias_method :file, :file_open
88
-
89
- # return [Fixnum]
90
- def timestamp
91
- @timestamp ||= Time.now.to_i
92
- end
93
-
94
- end # Subprocess
29
+ @pid = fork do
30
+ exec(file_path)
31
+ end
32
+
33
+ Process.detach(@pid)
34
+
35
+ self
36
+ end
37
+ # :nocov:
38
+
39
+ # Sends the KILL signal to the process.
40
+ #
41
+ # @return [void]
42
+ def kill
43
+ Process.kill('KILL', pid)
44
+
45
+ file_unlink
46
+ end
47
+
48
+ protected
49
+
50
+ # @!attribute [r] application
51
+ # @return [Vedeu::TestApplication]
52
+ attr_reader :application
53
+
54
+ # @!attribute [r] pid
55
+ # @return [Fixnum]
56
+ attr_reader :pid
57
+
58
+ private
59
+
60
+ # @return [String]
61
+ def command
62
+ "ruby #{file_path}"
63
+ end
64
+
65
+ # @return [Fixnum] The number of bytes written.
66
+ def file_write
67
+ file.write(application)
68
+ end
69
+
70
+ # @return [NilClass]
71
+ def file_close
72
+ file.close
73
+ end
74
+
75
+ # @return [Fixnum] The number of files removed; 1.
76
+ def file_unlink
77
+ File.unlink("/tmp/foo_#{timestamp}")
78
+ end
79
+
80
+ # return [String]
81
+ def file_path
82
+ file.path
83
+ end
84
+
85
+ # @return [File]
86
+ def file_open
87
+ @file ||= File.new("/tmp/foo_#{timestamp}", 'w', 0755)
88
+ end
89
+ alias_method :file, :file_open
90
+
91
+ # return [Fixnum]
92
+ def timestamp
93
+ @timestamp ||= Time.now.to_i
94
+ end
95
+
96
+ end # Subprocess
97
+
98
+ end # Distributed
95
99
 
96
100
  end # Vedeu