kastner-kompress 0.0.2 → 0.0.3
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/kompress.gemspec +1 -1
- data/lib/kompress/job.rb +4 -1
- data/test/job-freeze +6 -5
- data/test/job_test.rb +9 -0
- metadata +1 -1
data/kompress.gemspec
CHANGED
data/lib/kompress/job.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Kompress
|
2
2
|
class Job
|
3
|
-
attr_accessor :options, :job_id, :input_file, :container_type
|
3
|
+
attr_accessor :options, :job_id, :input_file, :container_type, :start_time
|
4
4
|
attr_accessor :state
|
5
5
|
|
6
6
|
def self.from_file(file)
|
@@ -11,6 +11,7 @@ module Kompress
|
|
11
11
|
@job_id = rpls[:job_id]
|
12
12
|
@container_type = rpls[:container_type]
|
13
13
|
@input_file = rpls[:input_file]
|
14
|
+
@start_time = rpls[:start_time]
|
14
15
|
@options = rpls
|
15
16
|
def replacements; @options; end
|
16
17
|
end
|
@@ -27,6 +28,7 @@ module Kompress
|
|
27
28
|
end
|
28
29
|
|
29
30
|
def fill(name, command, input_file, container_type, options)
|
31
|
+
@start_time = Time.now
|
30
32
|
@state = :pending
|
31
33
|
@options, @input_file, @command = options, input_file, command
|
32
34
|
@container_type = container_type
|
@@ -43,6 +45,7 @@ module Kompress
|
|
43
45
|
rpl[:job_id] = @job_id
|
44
46
|
rpl[:container_type] = @container_type
|
45
47
|
rpl[:input_file] = @input_file
|
48
|
+
rpl[:start_time] = @start_time
|
46
49
|
rpl.merge(kc_replacements)
|
47
50
|
end
|
48
51
|
|
data/test/job-freeze
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
---
|
2
|
+
:directory: /tmp
|
2
3
|
:frame_rate_regexp: !ruby/regexp /0.0,,,,,Video,.*q=.*,([\d\.]+)$/
|
3
|
-
:job_id: 1221549341-rad
|
4
|
-
:post_command: ":qt_faststart :temp_file :output_file"
|
5
|
-
:qt_faststart: /usr/bin/qt-faststart
|
6
|
-
:current_frame_regexp: !ruby/regexp /frame=\s*(\d+)/
|
7
4
|
:input_file: ~/Development/Ruby/test.mov
|
5
|
+
:current_frame_regexp: !ruby/regexp /frame=\s*(\d+)/
|
6
|
+
:job_id: 1221549341-rad
|
8
7
|
:container_type: mp4
|
8
|
+
:qt_faststart: /usr/bin/qt-faststart
|
9
9
|
:duration_regexp: !ruby/regexp /Duration-(\d+)/
|
10
10
|
:ffmpeg: /Library/Application\ Support/Techspansion/vh131ffmpeg
|
11
|
-
:
|
11
|
+
:start_time: 2008-09-21 10:58:35.514628 -04:00
|
12
|
+
:post_command: ":qt_faststart :temp_file :output_file"
|
data/test/job_test.rb
CHANGED
@@ -84,6 +84,10 @@ describe "A real job" do
|
|
84
84
|
@job.current_frame.should == 157
|
85
85
|
# puts @job.replacements.to_yaml
|
86
86
|
end
|
87
|
+
|
88
|
+
it "should have a start time" do
|
89
|
+
@job.start_time.should.be.kind_of Time
|
90
|
+
end
|
87
91
|
end
|
88
92
|
|
89
93
|
describe "A frozen job" do
|
@@ -112,4 +116,9 @@ describe "A frozen job" do
|
|
112
116
|
it "should be considered active" do
|
113
117
|
@job.state.should == :running
|
114
118
|
end
|
119
|
+
|
120
|
+
it "should unfreeze the start time" do
|
121
|
+
@job.start_time.year.should.be 2008
|
122
|
+
@job.start_time.month.should.be 9
|
123
|
+
end
|
115
124
|
end
|