media_monster_client 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/lib/media_monster/job.rb +11 -5
- data/lib/media_monster_client/version.rb +1 -1
- data/lib/media_monster_client.rb +1 -0
- data/media_monster_client.gemspec +2 -0
- data/test/helper.rb +1 -0
- metadata +42 -14
data/.gitignore
CHANGED
data/lib/media_monster/job.rb
CHANGED
@@ -2,12 +2,18 @@ module MediaMonster
|
|
2
2
|
|
3
3
|
class Job < Model
|
4
4
|
|
5
|
-
attr_accessor :job_type # which type of job is this? audio to start, video, document, etc.
|
6
|
-
attr_accessor :priority # curently supports blank and 'high'
|
7
|
-
attr_accessor :original # file location
|
8
|
-
attr_accessor :call_back # url for webhook
|
9
|
-
attr_accessor :tasks # array of tasks
|
10
5
|
attr_accessor :id
|
6
|
+
attr_accessor :priority # Now supports a numeric value
|
7
|
+
attr_accessor :job_type # which type of job is this? audio to start, video, document, etc.
|
8
|
+
attr_accessor :original # file location
|
9
|
+
attr_accessor :call_back # url for webhook
|
10
|
+
attr_accessor :tasks # array of tasks
|
11
|
+
|
12
|
+
# for retry logic, you can set a number of times to retry (retry_max)
|
13
|
+
# and how long to wait before try in seconds (retry_delay)
|
14
|
+
attr_accessor :retry_count
|
15
|
+
attr_accessor :retry_delay
|
16
|
+
attr_accessor :retry_max
|
11
17
|
|
12
18
|
def initialize(*args)
|
13
19
|
super
|
data/lib/media_monster_client.rb
CHANGED
@@ -26,6 +26,7 @@ module MediaMonsterClient
|
|
26
26
|
job ||= MediaMonster::Job.new
|
27
27
|
yield job
|
28
28
|
job.tap do |j|
|
29
|
+
# puts "posting: #{j.to_json}"
|
29
30
|
j_str = post(create_url('jobs'), j.to_json, {'Accept'=>'application/json','Content-Type'=>'application/json'}).body
|
30
31
|
json = JSON.parse(j_str)
|
31
32
|
j.id = json['job']['id']
|
@@ -19,6 +19,8 @@ Gem::Specification.new do |s|
|
|
19
19
|
|
20
20
|
s.add_runtime_dependency("activesupport")
|
21
21
|
s.add_runtime_dependency("oauth")
|
22
|
+
s.add_runtime_dependency("json")
|
23
|
+
s.add_runtime_dependency("i18n")
|
22
24
|
|
23
25
|
s.add_development_dependency "rake"
|
24
26
|
s.add_development_dependency "test-unit"
|
data/test/helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: media_monster_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 2.0.
|
9
|
+
- 3
|
10
|
+
version: 2.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew Kuklewicz (kookster)
|
@@ -15,11 +15,11 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-08-14 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
22
|
+
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
@@ -30,10 +30,10 @@ dependencies:
|
|
30
30
|
segments:
|
31
31
|
- 0
|
32
32
|
version: "0"
|
33
|
-
|
33
|
+
name: activesupport
|
34
34
|
version_requirements: *id001
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
|
-
|
36
|
+
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
segments:
|
45
45
|
- 0
|
46
46
|
version: "0"
|
47
|
-
|
47
|
+
name: oauth
|
48
48
|
version_requirements: *id002
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
|
-
|
50
|
+
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
requirement: &id003 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
@@ -58,10 +58,10 @@ dependencies:
|
|
58
58
|
segments:
|
59
59
|
- 0
|
60
60
|
version: "0"
|
61
|
-
|
61
|
+
name: json
|
62
62
|
version_requirements: *id003
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
|
-
|
64
|
+
type: :runtime
|
65
65
|
prerelease: false
|
66
66
|
requirement: &id004 !ruby/object:Gem::Requirement
|
67
67
|
none: false
|
@@ -72,10 +72,10 @@ dependencies:
|
|
72
72
|
segments:
|
73
73
|
- 0
|
74
74
|
version: "0"
|
75
|
-
|
75
|
+
name: i18n
|
76
76
|
version_requirements: *id004
|
77
77
|
- !ruby/object:Gem::Dependency
|
78
|
-
|
78
|
+
type: :development
|
79
79
|
prerelease: false
|
80
80
|
requirement: &id005 !ruby/object:Gem::Requirement
|
81
81
|
none: false
|
@@ -86,8 +86,36 @@ dependencies:
|
|
86
86
|
segments:
|
87
87
|
- 0
|
88
88
|
version: "0"
|
89
|
-
|
89
|
+
name: rake
|
90
90
|
version_requirements: *id005
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
type: :development
|
93
|
+
prerelease: false
|
94
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
hash: 3
|
100
|
+
segments:
|
101
|
+
- 0
|
102
|
+
version: "0"
|
103
|
+
name: test-unit
|
104
|
+
version_requirements: *id006
|
105
|
+
- !ruby/object:Gem::Dependency
|
106
|
+
type: :development
|
107
|
+
prerelease: false
|
108
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
hash: 3
|
114
|
+
segments:
|
115
|
+
- 0
|
116
|
+
version: "0"
|
117
|
+
name: fakeweb
|
118
|
+
version_requirements: *id007
|
91
119
|
description: client gem for media monster app
|
92
120
|
email:
|
93
121
|
- andrew@prx.org
|