vidibus-recording 2.0.0 → 2.0.1

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.
@@ -17,22 +17,18 @@ Capistrano::Configuration.instance.load do
17
17
  fetch(:rails_env, false) ? "RAILS_ENV=#{fetch(:rails_env)}" : ''
18
18
  end
19
19
 
20
- def roles
21
- fetch(:app)
22
- end
23
-
24
20
  desc 'Stop the recording process'
25
- task :stop, :roles => lambda { roles } do
21
+ task :stop, :roles => :app do
26
22
  run "cd #{current_path};#{rails_env} script/recording stop"
27
23
  end
28
24
 
29
25
  desc 'Start the recording process'
30
- task :start, :roles => lambda { roles } do
26
+ task :start, :roles => :app do
31
27
  run "cd #{current_path};#{rails_env} script/recording start"
32
28
  end
33
29
 
34
30
  desc 'Restart the recording process'
35
- task :restart, :roles => lambda { roles } do
31
+ task :restart, :roles => :app do
36
32
  run "cd #{current_path};#{rails_env} script/recording restart"
37
33
  end
38
34
  end
@@ -71,7 +71,7 @@ module Vidibus::Recording
71
71
  # Stops the recording worker and starts postprocessing.
72
72
  def stop
73
73
  return false if done? || !started?
74
- worker.stop
74
+ stop_worker
75
75
  self.pid = nil
76
76
  self.stopped_at = Time.now
77
77
  self.running = false
@@ -82,7 +82,7 @@ module Vidibus::Recording
82
82
  # Gets called from recording worker if it receives no more data.
83
83
  def halt(msg = nil)
84
84
  return false unless running?
85
- worker.stop
85
+ stop_worker
86
86
  self.pid = nil
87
87
  self.running = false
88
88
  postprocess
@@ -92,7 +92,7 @@ module Vidibus::Recording
92
92
  # The worker gets stopped and postprocessing is started.
93
93
  def fail(msg)
94
94
  return false unless running?
95
- worker.stop
95
+ stop_worker
96
96
  self.pid = nil
97
97
  self.error = msg
98
98
  self.failed_at = Time.now
@@ -230,6 +230,10 @@ module Vidibus::Recording
230
230
  self.pid = worker.pid
231
231
  end
232
232
 
233
+ def stop_worker
234
+ worker.stop
235
+ end
236
+
233
237
  def setup_next_part
234
238
  number = nil
235
239
  if current_part
@@ -275,14 +279,13 @@ module Vidibus::Recording
275
279
  end
276
280
 
277
281
  def cleanup
278
- worker.stop
282
+ stop_worker
279
283
  remove_files
280
284
  end
281
285
 
282
- # DEPRECATED: this is kept for existing records only.
283
286
  def remove_files
284
- [file, log_file, yml_file].each do |f|
285
- File.delete(f) if File.exists?(f)
287
+ Dir["#{basename}*"].each do |f|
288
+ File.delete(f)
286
289
  end
287
290
  end
288
291
  end
@@ -62,7 +62,6 @@ module Vidibus::Recording
62
62
  process_yml_file
63
63
  track_progress
64
64
  self.stopped_at = Time.now
65
- # save!
66
65
  end
67
66
 
68
67
  def start
@@ -1,5 +1,5 @@
1
1
  module Vidibus
2
2
  module Recording
3
- VERSION = '2.0.0'
3
+ VERSION = '2.0.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidibus-recording
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-01 00:00:00.000000000 Z
12
+ date: 2013-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -210,7 +210,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
210
210
  version: '0'
211
211
  segments:
212
212
  - 0
213
- hash: 507116490268825761
213
+ hash: 432343217845410671
214
214
  required_rubygems_version: !ruby/object:Gem::Requirement
215
215
  none: false
216
216
  requirements: