zencoder 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.markdown +30 -7
  2. data/lib/zencoder/version.rb +1 -1
  3. metadata +2 -2
data/README.markdown CHANGED
@@ -37,6 +37,16 @@ A Zencoder::Response can be used as follows:
37
37
  response.raw_body # => the body pre-JSON-parsing
38
38
  response.raw_response # => the raw Net::HTTP or Typhoeus response (see below for how to use Typhoeus)
39
39
 
40
+ ### Parameters
41
+
42
+ When sending API request parameters you can specify them as a non-string object, which we'll then serialize to JSON (by default):
43
+
44
+ Zencoder::Job.create({:input => 's3://bucket/key.mp4'})
45
+
46
+ Or you can specify them as a string, which we'll just pass along as the request body:
47
+
48
+ Zencoder::Job.create('{"input": "s3://bucket/key.mp4"}')
49
+
40
50
  ## Jobs
41
51
 
42
52
  There's more you can do on jobs than anything else in the API. The following methods are available: `list`, `create`, `details`, `progress`, `resubmit`, `cancel`, `delete`.
@@ -157,9 +167,16 @@ See the HTTP backends in this library to get started on your own.
157
167
 
158
168
  ### Advanced Options
159
169
 
160
- A secondary options hash can be passed to any method call which will then be passed on to the HTTP backend. You can pass `timeout` (in milliseconds), `headers`, and `params` (will be added to the query string) to any of the backends. If you are using Typhoeus, see their documentation for further options.
170
+ A secondary options hash can be passed to any method call which will then be passed on to the HTTP backend. You can pass `timeout` (in milliseconds), `headers`, and `params` (will be added to the query string) to any of the backends. If you are using Typhoeus, see their documentation for further options. In the following example the timeout is set to one second:
171
+
172
+ Zencoder::Job.create({:input => 's3://bucket/key.mp4'}, {:timeout => 1000})
161
173
 
162
- Zencoder::Job.list(:timeout => 1000) # Timeout is 1 second.
174
+
175
+ ### Format
176
+
177
+ By default we'll send and receive JSON for all our communication. If you would rather use XML then you can pass :format => :xml in the secondary options hash.
178
+
179
+ Zencoder::Job.create({:input => 's3://bucket/key.mp4'}, {:format => :xml})
163
180
 
164
181
  ### Default Options
165
182
 
@@ -171,14 +188,20 @@ Default options are passed to the HTTP backend. These can be retrieved and modif
171
188
 
172
189
  ### SSL
173
190
 
174
- The Net::HTTP backend will do its best to locate your local SSL certs to allow SSL verification. For a list of paths that are checked, see `Zencoder::HTTP::NetHTTP.root_cert_paths`. Feel free to add your own at runtime.
191
+ The Net::HTTP backend will do its best to locate your local SSL certs to allow SSL verification. For a list of paths that are checked, see `Zencoder::HTTP::NetHTTP.root_cert_paths`. Feel free to add your own at runtime. Let us know if we're missing a common location.
175
192
 
176
193
  Zencoder::HTTP::NetHTTP.root_cert_paths << '/my/custom/cert/path'
177
194
 
178
- ## Advanced JSON
195
+ ## Advanced JSON and XML
196
+
197
+ ### Alternate JSON and XML Libraries
198
+
199
+ This library uses the `activesupport` gem to encode and decode JSON. The latest versions of ActiveSupport allow you to change the libraries used to decode JSON and XML.
200
+
201
+ You can change the JSON decoding backend for ActiveSupport in Rails 2.3 like so:
179
202
 
180
- ### Alternate JSON Libraries
203
+ ActiveSupport::JSON.backend = "JSONGem"
181
204
 
182
- This library uses the `multi_json` gem to encode and decode JSON. It uses the `json_pure` gem by default for compatibility with different ruby implementations. You can change the JSON engine for MultiJson:
205
+ Or change the XML decoding backend for ActiveSupport in Rails 2.3 like so:
183
206
 
184
- MultiJson.engine = :yajl
207
+ ActiveSupport::XmlMini.backend = "Nokogiri"
@@ -1,3 +1,3 @@
1
1
  class Zencoder
2
- VERSION = '2.1.0'
2
+ VERSION = '2.1.1'
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 1
8
- - 0
9
- version: 2.1.0
8
+ - 1
9
+ version: 2.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nathan Sutton