brightcove-api 1.0.9 → 1.0.10

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/CHANELOG.markdown CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.0.10 (2011-06-22)
2
+
3
+ * Updated `post_file_streaming` method to support Ruby 1.8.7
4
+
1
5
  # 1.0.9 (2011-06-22)
2
6
 
3
7
  * Added `post_file_streaming` method
data/README.md CHANGED
@@ -50,6 +50,11 @@ If you want to perform a file upload, for example, to create a video, you can us
50
50
  >> response = brightcove.post_file('create_video', '/path/to/video.mov', :video => {:shortDescription => 'Short Description', :name => 'Video name'})
51
51
  => {"result"=>653155417001, "error=>nil, "id"=>nil}
52
52
 
53
+ If you want to perform a file upload using HTTP streaming, for example, to create a video, you can use the __post_file_streaming()__ method.
54
+
55
+ >> response = brightcove.post_file_streaming('create_video', '/path/to/video.mov', 'video/quicktime', :video => {:shortDescription => 'Short Description', :name => 'Video name'})
56
+ => {"result"=>653155417001, "error=>nil, "id"=>nil}
57
+
53
58
  Note on Patches/Pull Requests
54
59
  =============================
55
60
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.9
1
+ 1.0.10
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{brightcove-api}
8
- s.version = "1.0.9"
8
+ s.version = "1.0.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David Czarnecki"]
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
36
36
  s.homepage = %q{http://github.com/BrightcoveOS/Ruby-MAPI-Wrapper}
37
37
  s.licenses = ["MIT"]
38
38
  s.require_paths = ["lib"]
39
- s.rubygems_version = %q{1.5.3}
39
+ s.rubygems_version = %q{1.6.2}
40
40
  s.summary = %q{Ruby gem for interacting with the Brightcove media API}
41
41
  s.test_files = [
42
42
  "test/helper.rb",
@@ -9,7 +9,7 @@ module Brightcove
9
9
  include HTTParty
10
10
  disable_rails_query_string_format
11
11
 
12
- VERSION = '1.0.9'.freeze
12
+ VERSION = '1.0.10'.freeze
13
13
 
14
14
  DEFAULT_HEADERS = {
15
15
  'User-Agent' => "brightcove-api gem #{VERSION}"
@@ -120,15 +120,21 @@ module Brightcove
120
120
  body.merge!({:method => api_method})
121
121
  body.merge!({:params => parameters})
122
122
 
123
+ # Brightcove requires that the JSON-RPC call absolutely
124
+ # be the first part of a multi-part POST like create_video.
125
+ if RUBY_VERSION >= '1.9'
126
+ payload = {}
127
+ else
128
+ payload = OrderedHash.new
129
+ end
130
+
123
131
  url = URI.parse(@write_api_url)
124
132
  response = nil
125
133
  File.open(upload_file) do |file|
126
- request = Net::HTTP::Post::Multipart.new(
127
- url.path,
128
- {
129
- :json => body.to_json,
130
- :file => UploadIO.new(file, content_type)
131
- })
134
+ payload[:json] = body.to_json
135
+ payload[:file] = UploadIO.new(file, content_type)
136
+
137
+ request = Net::HTTP::Post::Multipart.new(url.path, payload)
132
138
 
133
139
  response = Net::HTTP.start(url.host, url.port) do |http|
134
140
  http.request(request)
@@ -12,7 +12,7 @@ class TestBrightcoveApi < Test::Unit::TestCase
12
12
  end
13
13
 
14
14
  def test_api_version
15
- assert_equal '1.0.9', Brightcove::API::VERSION
15
+ assert_equal '1.0.10', Brightcove::API::VERSION
16
16
  end
17
17
 
18
18
  def test_can_set_read_api_url
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: brightcove-api
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.9
5
+ version: 1.0.10
6
6
  platform: ruby
7
7
  authors:
8
8
  - David Czarnecki
@@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - ">="
142
142
  - !ruby/object:Gem::Version
143
- hash: 1985167017172697863
143
+ hash: 3819893044315575553
144
144
  segments:
145
145
  - 0
146
146
  version: "0"
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  requirements: []
154
154
 
155
155
  rubyforge_project:
156
- rubygems_version: 1.5.3
156
+ rubygems_version: 1.6.2
157
157
  signing_key:
158
158
  specification_version: 3
159
159
  summary: Ruby gem for interacting with the Brightcove media API