zencoder 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -27,3 +27,7 @@
27
27
  === 1.0.6 / 2010-05-28
28
28
 
29
29
  * Added support for toplevel options. {:test=>1} for example. This breaks the old api. The recipes argument to submit_job() must be present, and an optional :opts hash will be merged into the toplevel Zencoder request hash.
30
+
31
+ === 1.0.7 / 2010-06-10
32
+
33
+ * Merged in changes from Cory Preus for compatibility with upstream API changes.
data/lib/recipes.rb CHANGED
@@ -8,7 +8,8 @@ module ZencoderAPI #:nodoc:
8
8
  :upscale, :stretch, :frame_rate, :max_frame_rate, :keyframe_interval,
9
9
  :video_bitrate, :bitrate_cap, :buffer_size, :h264_profile, :h264_level,
10
10
  :skip_video, :audio_codec, :audio_bitrate, :audio_channels, :audio_sample_rate,
11
- :skip_audio, :start_clip, :clip_length, :thumbnails, :notifications]
11
+ :skip_audio, :start_clip, :clip_length, :thumbnails, :notifications, :tuning,
12
+ :autolevel, :audio_quality, :deblock, :public, :denoise, :video_codec]
12
13
 
13
14
  @@thumb_keys = [:number, :size, :base_url, :prefix]
14
15
 
@@ -20,7 +21,7 @@ module ZencoderAPI #:nodoc:
20
21
  m
21
22
  end
22
23
  raise RecipeError.new("no recipe parameters?") if params.empty?
23
- raise RecipeError.new("unknown recipe parameter #{params.keys - @@keys}") unless (params.keys - @@keys).empty?
24
+ raise RecipeError.new("unknown recipe parameter '#{params.keys - @@keys}' ") unless (params.keys - @@keys).empty?
24
25
  if params[:thumbnails]
25
26
  raise RecipeError.new("unknown thumb keys #{params[:thumbnails].keys - @@thumb_keys}") unless (params[:thumbnails].keys - @@thumb_keys).empty?
26
27
  end
@@ -71,7 +72,7 @@ module ZencoderAPI #:nodoc:
71
72
  }
72
73
  params = defaults.merge(params)
73
74
 
74
- Recipe.new(:web, params)
75
+ Recipe.new(:web, params)
75
76
  end
76
77
  end
77
78
  end
data/lib/zencoder.rb CHANGED
@@ -13,7 +13,7 @@ class Zencoder
13
13
  # Currently https://app.zencoder.com/api This means you have to have ssl built into your ruby!
14
14
  API_URL = 'https://app.zencoder.com/api'
15
15
 
16
- VERSION = '1.0.6' #:nodoc:
16
+ VERSION = '1.0.7' #:nodoc:
17
17
  # Submits a job to zencoder.
18
18
  # The recipe should be an instance or array of instances of ZencoderAPI::Recipe
19
19
  # Exceptions are not handled, but rather propagated upwards.
@@ -102,5 +102,21 @@ class TestZencoder < Test::Unit::TestCase
102
102
  ZencoderAPI::Recipes.web('base_url' =>@base_url, :thumbnails => {:bad_key => 'wtf?'})
103
103
  end
104
104
  end
105
+ context "with the following request" do
106
+ setup do
107
+ @params = JSON.parse(IO.readlines('test/fixtures/sample_request.json').to_s)
108
+ @params['output'] = @params['output'][0]
109
+ # Change string keys to symbols, no HashWithIndifferentAccess
110
+ @params['output']['thumbnails'].each_pair do |key, value|
111
+ @params['output']['thumbnails'][key.to_sym] = value
112
+ @params['output']['thumbnails'].delete(key)
113
+ end
114
+ end
115
+ should "have the output keys" do
116
+ assert_nothing_raised do
117
+ ZencoderAPI::Recipes.web({'base_url' => @base_url}.merge(@params['output']))
118
+ end
119
+ end
120
+ end
105
121
  end
106
122
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 6
9
- version: 1.0.6
8
+ - 7
9
+ version: 1.0.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - McClain Looney
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-28 00:00:00 -05:00
17
+ date: 2010-06-10 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency