falcon 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -95,26 +95,34 @@ module Falcon
95
95
  self.status == SUCCESS
96
96
  end
97
97
 
98
+ def processing!
99
+ self.status = PROCESSING
100
+ save(:validate => false)
101
+ end
102
+
103
+ def fail!
104
+ self.status = FAILURE
105
+ save(:validate => false)
106
+ end
107
+
108
+ def success!
109
+ self.status = SUCCESS
110
+ self.encoded_at = Time.now
111
+ save(:validate => false)
112
+ end
113
+
98
114
  protected
99
115
 
100
116
  def process_encoding
101
117
  begun_encoding = Time.now
102
118
 
103
- self.status = PROCESSING
104
- self.save(:validate => false)
119
+ processing!
105
120
 
106
- begin
107
- self.encode_source
108
- self.generate_screenshots
109
-
110
- self.status = SUCCESS
111
- self.encoded_at = Time.now
121
+ if encode_source && generate_screenshots
112
122
  self.encoding_time = (Time.now - begun_encoding).to_i
113
- self.save(:validate => false)
114
- rescue
115
- self.status = FAILURE
116
- self.save(:validate => false)
117
- raise
123
+ success!
124
+ else
125
+ fail!
118
126
  end
119
127
  end
120
128
 
data/lib/falcon/media.rb CHANGED
@@ -148,10 +148,7 @@ module Falcon
148
148
 
149
149
  # Clear generated files and created encodings
150
150
  def flush_deletes
151
- profiles.each do |profile_name, profile|
152
- filepath = path(profile)
153
- FileUtils.rm(filepath, :force => true) if filepath && File.exists?(filepath)
154
- end
151
+ instance.falcon_encodings.clear
155
152
  end
156
153
  end
157
154
  end
@@ -1,3 +1,3 @@
1
1
  module Falcon
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.1.2".freeze
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: falcon
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Igor Galeta