media_monster_client 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/media_monster_client.rb +4 -6
- data/lib/media_monster_client/version.rb +1 -1
- data/media_monster_client.gemspec +5 -6
- metadata +124 -114
data/lib/media_monster_client.rb
CHANGED
@@ -24,9 +24,8 @@ module MediaMonsterClient
|
|
24
24
|
|
25
25
|
def create_job(job=nil)
|
26
26
|
job ||= MediaMonster::Job.new
|
27
|
-
yield job
|
27
|
+
yield job if block_given?
|
28
28
|
job.tap do |j|
|
29
|
-
puts "posting: #{j.to_json}"
|
30
29
|
j_str = post(api_url('jobs'), j.to_json, {'Accept'=>'application/json','Content-Type'=>'application/json'}).body
|
31
30
|
json = JSON.parse(j_str)
|
32
31
|
j.id = json['job']['id']
|
@@ -35,11 +34,10 @@ module MediaMonsterClient
|
|
35
34
|
|
36
35
|
def update_job(job)
|
37
36
|
to_model(MediaMonster::Job, job).tap do |j|
|
38
|
-
puts "putting: #{j.to_json}"
|
39
37
|
put(model_url(j), j.to_json, {'Accept'=>'application/json','Content-Type'=>'application/json'})
|
40
38
|
end
|
41
39
|
end
|
42
|
-
|
40
|
+
|
43
41
|
def retry_job(job)
|
44
42
|
to_model(MediaMonster::Job, job).tap do |j|
|
45
43
|
put("#{model_url(j)}/retry", {}, {'Accept'=>'application/json'})
|
@@ -49,7 +47,7 @@ module MediaMonsterClient
|
|
49
47
|
def update_task(task_id, task_status)
|
50
48
|
json = {'task'=>{'status'=>task_status}}.to_json
|
51
49
|
put(api_url("tasks/#{task_id.to_i}"), json, {'Accept'=>'application/json', 'Content-Type'=>'application/json'})
|
52
|
-
end
|
50
|
+
end
|
53
51
|
|
54
52
|
protected
|
55
53
|
|
@@ -66,7 +64,7 @@ module MediaMonsterClient
|
|
66
64
|
def api_url(path)
|
67
65
|
"/api/#{version}/#{path}"
|
68
66
|
end
|
69
|
-
|
67
|
+
|
70
68
|
def model_url(model)
|
71
69
|
api_url("#{model.class.to_s.demodulize.downcase.pluralize}/#{model.id}")
|
72
70
|
end
|
@@ -16,14 +16,13 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
|
-
|
20
|
-
s.add_runtime_dependency("activesupport")
|
21
|
-
s.add_runtime_dependency("oauth")
|
19
|
+
|
20
|
+
s.add_runtime_dependency("activesupport", "~> 2.3.18")
|
21
|
+
s.add_runtime_dependency("oauth", "~> 0.4.7")
|
22
22
|
s.add_runtime_dependency("json")
|
23
|
-
s.add_runtime_dependency("i18n")
|
24
|
-
|
23
|
+
s.add_runtime_dependency("i18n", "~> 0.6.1")
|
24
|
+
|
25
25
|
s.add_development_dependency "rake"
|
26
26
|
s.add_development_dependency "test-unit"
|
27
27
|
s.add_development_dependency 'fakeweb'
|
28
|
-
|
29
28
|
end
|
metadata
CHANGED
@@ -1,135 +1,136 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: media_monster_client
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
- 6
|
10
|
+
version: 2.0.6
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Andrew Kuklewicz (kookster)
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
+
|
18
|
+
date: 2017-08-01 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
22
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
22
|
-
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
hash: 39
|
27
|
+
segments:
|
28
|
+
- 2
|
29
|
+
- 3
|
30
|
+
- 18
|
31
|
+
version: 2.3.18
|
32
|
+
name: activesupport
|
33
|
+
version_requirements: *id001
|
23
34
|
prerelease: false
|
24
|
-
|
35
|
+
type: :runtime
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
25
38
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
39
|
+
requirements:
|
40
|
+
- - ~>
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 1
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
- 4
|
46
|
+
- 7
|
47
|
+
version: 0.4.7
|
31
48
|
name: oauth
|
32
|
-
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
38
|
-
type: :runtime
|
49
|
+
version_requirements: *id002
|
39
50
|
prerelease: false
|
40
|
-
|
51
|
+
type: :runtime
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
54
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
47
62
|
name: json
|
48
|
-
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
|
-
type: :runtime
|
63
|
+
version_requirements: *id003
|
55
64
|
prerelease: false
|
56
|
-
|
65
|
+
type: :runtime
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
57
68
|
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
69
|
+
requirements:
|
70
|
+
- - ~>
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 5
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
- 6
|
76
|
+
- 1
|
77
|
+
version: 0.6.1
|
63
78
|
name: i18n
|
64
|
-
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
type: :runtime
|
79
|
+
version_requirements: *id004
|
71
80
|
prerelease: false
|
72
|
-
|
81
|
+
type: :runtime
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
73
84
|
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
hash: 3
|
89
|
+
segments:
|
90
|
+
- 0
|
91
|
+
version: "0"
|
79
92
|
name: rake
|
80
|
-
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ! '>='
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '0'
|
86
|
-
type: :development
|
93
|
+
version_requirements: *id005
|
87
94
|
prerelease: false
|
88
|
-
|
95
|
+
type: :development
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
89
98
|
none: false
|
90
|
-
requirements:
|
91
|
-
- -
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
|
94
|
-
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
hash: 3
|
103
|
+
segments:
|
104
|
+
- 0
|
105
|
+
version: "0"
|
95
106
|
name: test-unit
|
96
|
-
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '0'
|
102
|
-
type: :development
|
107
|
+
version_requirements: *id006
|
103
108
|
prerelease: false
|
104
|
-
|
109
|
+
type: :development
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
105
112
|
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
110
|
-
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
hash: 3
|
117
|
+
segments:
|
118
|
+
- 0
|
119
|
+
version: "0"
|
111
120
|
name: fakeweb
|
112
|
-
|
113
|
-
none: false
|
114
|
-
requirements:
|
115
|
-
- - ! '>='
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
121
|
+
version_requirements: *id007
|
119
122
|
prerelease: false
|
120
|
-
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- - ! '>='
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '0'
|
123
|
+
type: :development
|
126
124
|
description: client gem for media monster app
|
127
|
-
email:
|
125
|
+
email:
|
128
126
|
- andrew@prx.org
|
129
127
|
executables: []
|
128
|
+
|
130
129
|
extensions: []
|
130
|
+
|
131
131
|
extra_rdoc_files: []
|
132
|
-
|
132
|
+
|
133
|
+
files:
|
133
134
|
- .gitignore
|
134
135
|
- Gemfile
|
135
136
|
- Rakefile
|
@@ -143,30 +144,39 @@ files:
|
|
143
144
|
- media_monster_client.gemspec
|
144
145
|
- test/helper.rb
|
145
146
|
- test/test_media_monster_client.rb
|
146
|
-
homepage:
|
147
|
+
homepage: ""
|
147
148
|
licenses: []
|
149
|
+
|
148
150
|
post_install_message:
|
149
151
|
rdoc_options: []
|
150
|
-
|
152
|
+
|
153
|
+
require_paths:
|
151
154
|
- lib
|
152
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
153
156
|
none: false
|
154
|
-
requirements:
|
155
|
-
- -
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
|
158
|
-
|
157
|
+
requirements:
|
158
|
+
- - ">="
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
hash: 3
|
161
|
+
segments:
|
162
|
+
- 0
|
163
|
+
version: "0"
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
165
|
none: false
|
160
|
-
requirements:
|
161
|
-
- -
|
162
|
-
- !ruby/object:Gem::Version
|
163
|
-
|
166
|
+
requirements:
|
167
|
+
- - ">="
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
hash: 3
|
170
|
+
segments:
|
171
|
+
- 0
|
172
|
+
version: "0"
|
164
173
|
requirements: []
|
174
|
+
|
165
175
|
rubyforge_project:
|
166
|
-
rubygems_version: 1.8.
|
176
|
+
rubygems_version: 1.8.15
|
167
177
|
signing_key:
|
168
178
|
specification_version: 3
|
169
179
|
summary: client gem for media monster app
|
170
|
-
test_files:
|
180
|
+
test_files:
|
171
181
|
- test/helper.rb
|
172
182
|
- test/test_media_monster_client.rb
|