vedeu 0.6.29 → 0.6.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -0
  3. data/Guardfile +6 -5
  4. data/README.md +50 -4
  5. data/Rakefile +16 -4
  6. data/docs/dsl.md +3 -3
  7. data/lib/vedeu/all.rb +6 -8
  8. data/lib/vedeu/bindings/all.rb +43 -13
  9. data/lib/vedeu/borders/border.rb +26 -3
  10. data/lib/vedeu/borders/refresh.rb +5 -0
  11. data/lib/vedeu/buffers/refresh.rb +10 -0
  12. data/lib/vedeu/cursors/cursor.rb +59 -0
  13. data/lib/vedeu/cursors/refresh.rb +5 -0
  14. data/lib/vedeu/distributed/server.rb +12 -0
  15. data/lib/vedeu/distributed/subprocess.rb +7 -2
  16. data/lib/vedeu/editor/editor.rb +5 -0
  17. data/lib/vedeu/editor/repository.rb +41 -0
  18. data/lib/vedeu/geometry/geometry.rb +19 -8
  19. data/lib/vedeu/geometry/repository.rb +25 -0
  20. data/lib/vedeu/groups/clear.rb +3 -0
  21. data/lib/vedeu/groups/group.rb +9 -0
  22. data/lib/vedeu/groups/refresh.rb +5 -0
  23. data/lib/vedeu/input/dsl.rb +4 -4
  24. data/lib/vedeu/input/mapper.rb +3 -0
  25. data/lib/vedeu/interfaces/all.rb +1 -0
  26. data/lib/vedeu/interfaces/dsl.rb +1 -1
  27. data/lib/vedeu/interfaces/interface.rb +12 -0
  28. data/lib/vedeu/logging/log.rb +3 -0
  29. data/lib/vedeu/menus/repository.rb +40 -0
  30. data/lib/vedeu/models/focus.rb +9 -0
  31. data/lib/vedeu/output/clear/interface.rb +9 -1
  32. data/lib/vedeu/output/refresh/refresh.rb +3 -0
  33. data/lib/vedeu/repositories/model.rb +1 -9
  34. data/lib/vedeu/runtime/application.rb +7 -0
  35. data/lib/vedeu/runtime/flags.rb +3 -0
  36. data/lib/vedeu/runtime/launcher.rb +2 -0
  37. data/lib/vedeu/runtime/router.rb +7 -0
  38. data/lib/vedeu/terminal/buffer.rb +11 -0
  39. data/lib/vedeu/terminal/terminal.rb +3 -0
  40. data/lib/vedeu/version.rb +1 -1
  41. data/test/lib/vedeu/bindings/all_test.rb +19 -0
  42. data/test/lib/vedeu/borders/border_test.rb +0 -4
  43. data/test/lib/vedeu/borders/refresh_test.rb +4 -0
  44. data/test/lib/vedeu/buffers/refresh_test.rb +5 -0
  45. data/test/lib/vedeu/cursors/cursor_test.rb +21 -0
  46. data/test/lib/vedeu/cursors/refresh_test.rb +4 -0
  47. data/test/lib/vedeu/distributed/server_test.rb +7 -0
  48. data/test/lib/vedeu/editor/editor_test.rb +4 -0
  49. data/test/lib/vedeu/editor/repository_test.rb +12 -0
  50. data/test/lib/vedeu/events/aliases_test.rb +0 -1
  51. data/test/lib/vedeu/geometry/geometry_test.rb +0 -3
  52. data/test/lib/vedeu/geometry/repository_test.rb +13 -0
  53. data/test/lib/vedeu/groups/clear_test.rb +4 -0
  54. data/test/lib/vedeu/groups/group_test.rb +6 -0
  55. data/test/lib/vedeu/groups/refresh_test.rb +4 -0
  56. data/test/lib/vedeu/input/dsl_test.rb +3 -3
  57. data/test/lib/vedeu/input/mapper_test.rb +4 -0
  58. data/test/lib/vedeu/interfaces/interface_test.rb +9 -0
  59. data/test/lib/vedeu/logging/log_test.rb +4 -0
  60. data/test/lib/vedeu/menus/repository_test.rb +13 -0
  61. data/test/lib/vedeu/models/focus_test.rb +6 -0
  62. data/test/lib/vedeu/output/clear/interface_test.rb +5 -0
  63. data/test/lib/vedeu/output/refresh/refresh_test.rb +4 -0
  64. data/test/lib/vedeu/repositories/model_test.rb +0 -15
  65. data/test/lib/vedeu/runtime/application_test.rb +5 -0
  66. data/test/lib/vedeu/runtime/flags_test.rb +4 -0
  67. data/test/lib/vedeu/runtime/router_test.rb +26 -0
  68. data/test/lib/vedeu/terminal/buffer_test.rb +8 -0
  69. data/test/lib/vedeu/terminal/terminal_test.rb +4 -0
  70. data/test/support/examples/material_colours_app.rb +24 -4
  71. data/test/test_helper.rb +23 -23
  72. metadata +4 -40
  73. data/lib/vedeu/bindings/application.rb +0 -41
  74. data/lib/vedeu/bindings/bindings.rb +0 -46
  75. data/lib/vedeu/bindings/cursors.rb +0 -101
  76. data/lib/vedeu/bindings/document.rb +0 -97
  77. data/lib/vedeu/bindings/drb.rb +0 -78
  78. data/lib/vedeu/bindings/focus.rb +0 -46
  79. data/lib/vedeu/bindings/menus.rb +0 -99
  80. data/lib/vedeu/bindings/movement.rb +0 -51
  81. data/lib/vedeu/bindings/refresh.rb +0 -74
  82. data/lib/vedeu/bindings/system.rb +0 -81
  83. data/lib/vedeu/bindings/view.rb +0 -50
  84. data/lib/vedeu/bindings/visibility.rb +0 -118
  85. data/test/lib/vedeu/bindings/application_test.rb +0 -39
  86. data/test/lib/vedeu/bindings/bindings_test.rb +0 -109
  87. data/test/lib/vedeu/bindings/cursors_test.rb +0 -24
  88. data/test/lib/vedeu/bindings/document_test.rb +0 -25
  89. data/test/lib/vedeu/bindings/drb_test.rb +0 -27
  90. data/test/lib/vedeu/bindings/focus_test.rb +0 -19
  91. data/test/lib/vedeu/bindings/menus_test.rb +0 -26
  92. data/test/lib/vedeu/bindings/movement_test.rb +0 -24
  93. data/test/lib/vedeu/bindings/refresh_test.rb +0 -22
  94. data/test/lib/vedeu/bindings/system_test.rb +0 -24
  95. data/test/lib/vedeu/bindings/view_test.rb +0 -19
  96. data/test/lib/vedeu/bindings/visibility_test.rb +0 -52
  97. data/test/support/all_seeds.sh +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acc3caf904e10f4af35074e6b869c3ad65f96af2
4
- data.tar.gz: fe00ef8a86cc1e6e4615361e9d57e30ed2f316fc
3
+ metadata.gz: ea4a90f4f35a50a9277083e0f25eb794c4bde66f
4
+ data.tar.gz: f88025c5b2d624ff2cd1f66ec06e52465157ea22
5
5
  SHA512:
6
- metadata.gz: f0c354b58c059144923e853c58d3a3b5d5ac31b194f51362cb876c9182fa2fde1003781963b1b3fc69e17e36e830af7f4c6ad6f053b67003289345eed811c9d3
7
- data.tar.gz: 2c618148a9cf0f395c110ba0b4e9d1aa845966f1c9d2d1d771860bb27f808b24502e66550aac3c6fdf9e677bb3ed653a5d3d50c0b0259e73564d3192e5164a4f
6
+ metadata.gz: 346ade00d603a72378c0da55b48650c87335ededb334f576ebee3fb0c1249c66af74574aa90bd4ebe21e38eb651b7862b523ebe2e536a7734c057fa09c500718
7
+ data.tar.gz: cba34e4d351846db0e2d08de4f125a25674d8430badf95e4820db70ed8fa66b502476ad8e1499f758f19d50029bb9907253024ea15172b66d918784fe4d80a16
data/.yardopts CHANGED
@@ -24,4 +24,5 @@ docs/events/menu.md
24
24
  docs/events/movement.md
25
25
  docs/events/refresh.md
26
26
  docs/events/system.md
27
+ docs/events/view.md
27
28
  docs/events/visibility.md
data/Guardfile CHANGED
@@ -1,11 +1,12 @@
1
- guard :rubocop do
2
- watch(/.+\.rb$/)
3
- watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
1
+ if ENV['RUBOCOP']
2
+ guard :rubocop do
3
+ watch(/.+\.rb$/)
4
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
5
+ end
4
6
  end
5
7
 
6
8
  guard :minitest, all_after_pass: true,
7
- focus_on_failed: true,
8
- env: { 'NO_SIMPLECOV' => true } do
9
+ focus_on_failed: true do
9
10
  watch(%r{^test/(.*)_test\.rb})
10
11
  watch(%r{^lib/(.+)\.rb}) { |m| "test/lib/#{m[1]}_test.rb" }
11
12
  watch(%r{^test/test_helper\.rb}) { 'test' }
data/README.md CHANGED
@@ -75,17 +75,63 @@ Pull requests are very welcome! Please try to follow these simple rules if
75
75
  * Make sure your patches are well tested.
76
76
  * Update the [Yard](http://yardoc.org/) documentation.
77
77
  (Use `yard stats --list-undoc` to locate undocumented code)
78
- * Update the [README](https://github.com/gavinlaking/vedeu/blob/master/README.md).
78
+ * Update the
79
+ [README](https://github.com/gavinlaking/vedeu/blob/master/README.md),
80
+ if appropriate.
79
81
  * Please **do not change** the version number.
80
82
 
83
+ Raising issues and finding bugs, updating documentation and improving
84
+ the code are all welcome contributions. I may also have left some TODO
85
+ items lying around, which you're quite welcome to and can find
86
+ with either Yard, or git:
87
+
88
+ yard list --query '@todo'
89
+
90
+ git grep --line-number '@todo'
91
+
92
+
81
93
  Any branch on the repository that is not `master` is probably experimental; do
82
94
  not rely on anything in these branches. Typically, `twerks` will be merged
83
95
  into `master` before a release, and branches prefixed with `spike/` are me
84
- playing with ideas.
96
+ playing with ideas- they aren't guaranteed to work at all.
85
97
 
86
- I may have left some TODO items lying around, which you can find with:
98
+ Various environment variables are available to you to help with testing, all of
99
+ which can be used in combination, prefaced to `rake`:
100
+
101
+ - Produce statistics on the slowest performing parts of the
102
+ application/tests. Useful when used multiple times. See
103
+ `test/test_helper.rb` for configuration.
104
+
105
+ PERFORMANCE=1 rake
106
+
107
+ - Produce a 'SimpleCov' test coverage report in the `coverage/`
108
+ directory.
109
+
110
+ SIMPLECOV=1 rake
111
+
112
+ - Produces a 'SimpleCov' test coverage report with output to the
113
+ console.
114
+
115
+ CONSOLE_COVERAGE=1 rake
116
+
117
+ - Enable Ruby's warnings mode (this can usually be quote verbose, but
118
+ thankfully more so with gem dependencies rather than Vedeu itself).
119
+
120
+ WARNINGS=1 rake
121
+
122
+ - Disable Ruby's garbage collection for this test run.
123
+
124
+ DISABLE_GC=1 rake
125
+
126
+ - Use Rubocop to catch coding misdemeanours for this test run. (Or
127
+ use `rake rubocop`).
128
+
129
+ RUBOCOP=1 rake
130
+
131
+ - Build the Yard documentation for the project. (Or use `rake yard`).
132
+
133
+ YARD=1 rake
87
134
 
88
- yard list --query '@todo'
89
135
 
90
136
  ### General contribution help
91
137
 
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ Rake::TestTask.new(:test) do |task|
8
8
  task.libs.push 'test'
9
9
  task.pattern = 'test/**/*_test.rb'
10
10
  task.verbose = false
11
- task.warning = false # set to true for Ruby warnings (ruby -w)
11
+ task.warning = true if ENV['WARNINGS']
12
12
  end
13
13
 
14
14
  YARD::Rake::YardocTask.new(:yard) do |task|
@@ -16,11 +16,19 @@ YARD::Rake::YardocTask.new(:yard) do |task|
16
16
  'lib/**/*.rb',
17
17
  '-',
18
18
  'docs/api.md',
19
+ 'docs/border.md',
20
+ 'docs/buffer.md',
19
21
  'docs/configuration.md',
22
+ 'docs/cursor.md',
20
23
  'docs/dsl.md',
21
24
  'docs/events.md',
25
+ 'docs/geometry.md',
22
26
  'docs/getting_started.md',
27
+ 'docs/group.md',
28
+ 'docs/interfaces.md',
29
+ 'docs/keymaps.md',
23
30
  'docs/object_graph.md',
31
+ 'docs/view.md',
24
32
  'docs/events/application.md',
25
33
  'docs/events/document.md',
26
34
  'docs/events/drb.md',
@@ -32,14 +40,18 @@ YARD::Rake::YardocTask.new(:yard) do |task|
32
40
  'docs/events/view.md',
33
41
  'docs/events/visibility.md',
34
42
  ]
35
- task.options = ['--highlight']
43
+ task.options = ['highlight']
36
44
  task.stats_options = ['--list-undoc']
37
45
  end
38
46
 
39
47
  RuboCop::RakeTask.new(:rubocop) do |task|
40
48
  task.patterns = ['lib/**/*.rb']
41
- task.formatters = ['progress']
49
+ task.formatters = ['simple']
42
50
  task.fail_on_error = false
43
51
  end
44
52
 
45
- task default: :test
53
+ tasks_to_run = [:test]
54
+ tasks_to_run << :rubocop if ENV['RUBOCOP']
55
+ tasks_to_run << :yard if ENV['YARD']
56
+
57
+ task default: tasks_to_run
@@ -129,9 +129,9 @@ end
129
129
 
130
130
  ## Keymaps
131
131
 
132
- {include:Vedeu::Keymaps::DSL}
133
- {include:Vedeu::Keymaps::DSL.keymap}
134
- {include:Vedeu::Keymaps::DSL#name}
132
+ {include:Vedeu::Input::DSL}
133
+ {include:Vedeu::Input::DSL.keymap}
134
+ {include:Vedeu::Input::DSL#name}
135
135
 
136
136
  ## Menus
137
137
 
@@ -1,17 +1,16 @@
1
1
  require 'vedeu/version'
2
2
 
3
+ require 'vedeu/common'
4
+ require 'vedeu/configuration/api'
5
+ require 'vedeu/configuration/configuration'
6
+ require 'vedeu/repositories/all'
7
+ require 'vedeu/events/all'
8
+ require 'vedeu/esc/all'
3
9
  require 'vedeu/logging/all'
4
10
  require 'vedeu/options'
5
-
6
11
  require 'vedeu/error'
7
- require 'vedeu/common'
8
12
  require 'vedeu/runtime/all'
9
-
10
- require 'vedeu/configuration/api'
11
- require 'vedeu/configuration/configuration'
12
-
13
13
  require 'vedeu/terminal/all'
14
- require 'vedeu/repositories/all'
15
14
 
16
15
  require 'vedeu/models/toggleable'
17
16
 
@@ -37,7 +36,6 @@ require 'vedeu/colours/all'
37
36
  require 'vedeu/cursors/all'
38
37
  require 'vedeu/distributed/all'
39
38
  require 'vedeu/editor/all'
40
- require 'vedeu/events/all'
41
39
  require 'vedeu/geometry/all'
42
40
  require 'vedeu/groups/all'
43
41
  require 'vedeu/input/all'
@@ -16,19 +16,49 @@ module Vedeu
16
16
  #
17
17
  module Bindings
18
18
 
19
+ extend self
20
+
21
+ # Setup events for running Vedeu. This method is called by Vedeu.
22
+ #
23
+ # @return [TrueClass]
24
+ def setup!
25
+ cleanup!
26
+ command!
27
+ drb_input!
28
+
29
+ true
30
+ end
31
+
32
+ private
33
+
34
+ # See {file:docs/events/system.md#\_cleanup_}
35
+ def cleanup!
36
+ Vedeu.bind(:_cleanup_) do
37
+ Vedeu.trigger(:_drb_stop_)
38
+ Vedeu.trigger(:cleanup)
39
+ end
40
+ end
41
+
42
+ # See {file:docs/events/system.md#\_command_}
43
+ def command!
44
+ Vedeu.bind(:_command_) { |command| Vedeu.trigger(:command, command) }
45
+ end
46
+
47
+ # See {file:docs/events/drb.md#\_drb_input_}
48
+ def drb_input!
49
+ Vedeu.bind(:_drb_input_) do |data, type|
50
+ Vedeu.log(type: :drb, message: "Sending input (#{type})".freeze)
51
+
52
+ case type
53
+ when :command then Vedeu.trigger(:_command_, data)
54
+ when :keypress then Vedeu.trigger(:_keypress_, data)
55
+ else Vedeu.trigger(:_keypress_, data)
56
+ end
57
+ end
58
+ end
59
+
19
60
  end # Bindings
20
61
 
21
- end # Vedeu
62
+ Vedeu::Bindings.setup!
22
63
 
23
- require 'vedeu/bindings/application'
24
- require 'vedeu/bindings/cursors'
25
- require 'vedeu/bindings/document'
26
- require 'vedeu/bindings/drb'
27
- require 'vedeu/bindings/menus'
28
- require 'vedeu/bindings/movement'
29
- require 'vedeu/bindings/focus'
30
- require 'vedeu/bindings/refresh'
31
- require 'vedeu/bindings/system'
32
- require 'vedeu/bindings/view'
33
- require 'vedeu/bindings/visibility'
34
- require 'vedeu/bindings/bindings'
64
+ end # Vedeu
@@ -129,13 +129,36 @@ module Vedeu
129
129
  # character.
130
130
  # @return [Vedeu::Borders::Border]
131
131
  def initialize(attributes = {})
132
- @attributes = defaults.merge!(attributes)
133
-
134
- @attributes.each do |key, value|
132
+ defaults.merge!(attributes).each do |key, value|
135
133
  instance_variable_set("@#{key}", value)
136
134
  end
137
135
  end
138
136
 
137
+ # @return [Hash]
138
+ def attributes
139
+ {
140
+ bottom_left: @bottom_left,
141
+ bottom_right: @bottom_right,
142
+ caption: @caption,
143
+ client: @client,
144
+ colour: @colour,
145
+ enabled: @enabled,
146
+ horizontal: @horizontal,
147
+ name: @name,
148
+ parent: @parent,
149
+ repository: @repository,
150
+ show_bottom: @show_bottom,
151
+ show_left: @show_,
152
+ show_right: @show_,
153
+ show_top: @show_,
154
+ style: @style,
155
+ title: @title,
156
+ top_left: @top_left,
157
+ top_right: @top_right,
158
+ vertical: @vertical,
159
+ }
160
+ end
161
+
139
162
  # @return [Fixnum]
140
163
  def bx
141
164
  (enabled? && left?) ? x + 1 : x
@@ -362,4 +362,9 @@ module Vedeu
362
362
 
363
363
  end # Borders
364
364
 
365
+ # See {file:docs/events/refresh.md#\_refresh_border_}
366
+ Vedeu.bind(:_refresh_border_) do |name|
367
+ Vedeu::Borders::Refresh.by_name(name)
368
+ end
369
+
365
370
  end # Vedeu
@@ -74,4 +74,14 @@ module Vedeu
74
74
 
75
75
  end # Buffers
76
76
 
77
+ # See {file:docs/events/refresh.md#\_refresh_view_}
78
+ Vedeu.bind(:_refresh_view_) do |name|
79
+ Vedeu::Buffers::Refresh.by_name(name)
80
+ end
81
+
82
+ # See {file:docs/events/refresh.md#\_refresh_view_content_}
83
+ Vedeu.bind(:_refresh_view_content_) do |name|
84
+ Vedeu::Buffers::Refresh.refresh_content_by_name(name)
85
+ end
86
+
77
87
  end # Vedeu
@@ -313,4 +313,63 @@ module Vedeu
313
313
  def_delegators Vedeu::Cursors::Cursor, :hide_cursor, :show_cursor,
314
314
  :toggle_cursor
315
315
 
316
+ # See {file:docs/events/visibility.md#\_hide_cursor_}
317
+ Vedeu.bind(:_hide_cursor_) { |name| Vedeu.hide_cursor(name) }
318
+ # Vedeu.bind_alias(:_cursor_hide_, :_hide_cursor_)
319
+
320
+ # See {file:docs/events/visibility.md#\_show_cursor_}
321
+ Vedeu.bind(:_show_cursor_) { |name| Vedeu.show_cursor(name) }
322
+ # Vedeu.bind_alias(:_cursor_show_, :_show_cursor_)
323
+
324
+ # See {file:docs/events/visibility.md#\_toggle_cursor_}
325
+ Vedeu.bind(:_toggle_cursor_) { |name| Vedeu.toggle_cursor(name) }
326
+
327
+ # See {file:docs/cursors.md}
328
+ Vedeu.bind(:_cursor_left_) do |name|
329
+ Vedeu.cursors.by_name(name).move_left
330
+
331
+ Vedeu.trigger(:_refresh_cursor_, name)
332
+ end
333
+
334
+ # See {file:docs/cursors.md}
335
+ Vedeu.bind(:_cursor_down_) do |name|
336
+ Vedeu.cursors.by_name(name).move_down
337
+
338
+ Vedeu.trigger(:_refresh_cursor_, name)
339
+ end
340
+
341
+ # See {file:docs/cursors.md}
342
+ Vedeu.bind(:_cursor_up_) do |name|
343
+ Vedeu.cursors.by_name(name).move_up
344
+
345
+ Vedeu.trigger(:_refresh_cursor_, name)
346
+ end
347
+
348
+ # See {file:docs/cursors.md}
349
+ Vedeu.bind(:_cursor_right_) do |name|
350
+ Vedeu.cursors.by_name(name).move_right
351
+
352
+ Vedeu.trigger(:_refresh_cursor_, name)
353
+ end
354
+
355
+ # See {file:docs/cursors.md}
356
+ Vedeu.bind(:_cursor_origin_) do |name|
357
+ Vedeu.cursors.by_name(name).move_origin
358
+ end
359
+ # Vedeu.bind_alias(:_cursor_reset_, :_cursor_origin_)
360
+
361
+ # See {file:docs/cursors.md}
362
+ Vedeu.bind(:_cursor_position_) do |name|
363
+ Vedeu.cursors.by_name(name).to_a
364
+ end
365
+
366
+ # See {file:docs/cursors.md}
367
+ Vedeu.bind(:_cursor_reposition_) do |name, y, x|
368
+ Vedeu.cursors.by_name(name).reposition(y, x)
369
+
370
+ Vedeu.trigger(:_clear_view_, name)
371
+ Vedeu.trigger(:_refresh_view_, name)
372
+ Vedeu.trigger(:_refresh_cursor_, name)
373
+ end
374
+
316
375
  end # Vedeu
@@ -86,4 +86,9 @@ module Vedeu
86
86
 
87
87
  end # Cursors
88
88
 
89
+ # See {file:docs/events/refresh.md#\_refresh_cursor_}
90
+ Vedeu.bind(:_refresh_cursor_) do |name|
91
+ Vedeu::Cursors::Refresh.by_name(name)
92
+ end
93
+
89
94
  end # Vedeu
@@ -249,4 +249,16 @@ module Vedeu
249
249
  def_delegators Vedeu::Distributed::Server, :drb_restart, :drb_start,
250
250
  :drb_status, :drb_stop
251
251
 
252
+ # See {file:docs/events/drb.md#\_drb_restart_}
253
+ Vedeu.bind(:_drb_restart_) { Vedeu::Distributed::Server.restart }
254
+
255
+ # See {file:docs/events/drb.md#\_drb_start_}
256
+ Vedeu.bind(:_drb_start_) { Vedeu::Distributed::Server.start }
257
+
258
+ # See {file:docs/events/drb.md#\_drb_status_}
259
+ Vedeu.bind(:_drb_status_) { Vedeu::Distributed::Server.status }
260
+
261
+ # See {file:docs/events/drb.md#\_drb_stop_}
262
+ Vedeu.bind(:_drb_stop_) { Vedeu::Distributed::Server.stop }
263
+
252
264
  end # Vedeu
@@ -74,7 +74,7 @@ module Vedeu
74
74
 
75
75
  # @return [Fixnum] The number of files removed; 1.
76
76
  def file_unlink
77
- File.unlink("/tmp/foo_#{timestamp}".freeze)
77
+ File.unlink(file_name)
78
78
  end
79
79
 
80
80
  # return [String]
@@ -84,10 +84,15 @@ module Vedeu
84
84
 
85
85
  # @return [File]
86
86
  def file_open
87
- @file ||= File.new("/tmp/foo_#{timestamp}", 'w', 0755)
87
+ @file ||= File.new(file_name, 'w', 0755)
88
88
  end
89
89
  alias_method :file, :file_open
90
90
 
91
+ # @return [String]
92
+ def file_name
93
+ "/tmp/foo_#{timestamp}".freeze
94
+ end
95
+
91
96
  # return [Fixnum]
92
97
  def timestamp
93
98
  @timestamp ||= Time.now.to_i