animoto 0.0.0.alpha1 → 0.0.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +196 -39
- data/lib/animoto/asset.rb +4 -4
- data/lib/animoto/client.rb +1 -0
- data/lib/animoto/coverable.rb +29 -0
- data/lib/animoto/directing_manifest.rb +1 -4
- data/lib/animoto/footage.rb +2 -1
- data/lib/animoto/image.rb +2 -0
- data/lib/animoto/rendering_manifest.rb +5 -5
- data/lib/animoto/song.rb +1 -3
- data/lib/animoto/video.rb +1 -1
- data/lib/animoto.rb +1 -1
- data/spec/animoto/asset_spec.rb +4 -0
- data/spec/animoto/coverable_spec.rb +5 -0
- data/spec/animoto/directing_and_rendering_manifest_spec.rb +1 -6
- data/spec/animoto/directing_manifest_spec.rb +1 -14
- data/spec/animoto/footage_spec.rb +3 -3
- data/spec/animoto/image_spec.rb +3 -3
- data/spec/animoto/rendering_manifest_spec.rb +7 -7
- data/spec/animoto/song_spec.rb +4 -21
- data/spec/animoto/standard_envelope_spec.rb +5 -0
- data/spec/animoto/video_spec.rb +4 -0
- data/spec/animoto/visual_spec.rb +5 -0
- metadata +6 -4
data/README.md
CHANGED
@@ -1,39 +1,196 @@
|
|
1
|
-
Animoto API Client
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
1
|
+
Animoto API Ruby Client
|
2
|
+
=======================
|
3
|
+
|
4
|
+
The Animoto API is a RESTful web service that transforms images, videos,
|
5
|
+
music, and text into amazing video presentations.
|
6
|
+
|
7
|
+
The Animoto API Ruby Client provides a convenient Ruby interface for working
|
8
|
+
with the Animoto RESTful HTTP API.
|
9
|
+
|
10
|
+
### Topics
|
11
|
+
|
12
|
+
* [Who should read this document](#who_should_read_this_document)
|
13
|
+
* [What is covered in this document](#what_is_covered_in_this_document)
|
14
|
+
* [Getting Started using the Ruby Client](#getting_started_using_the_ruby_client)
|
15
|
+
* [How to contribute to this client](#how_to_contribute)
|
16
|
+
|
17
|
+
<a name="who_should_read_this_document"></a>
|
18
|
+
## Who should read this document?
|
19
|
+
|
20
|
+
This document is primarily aimed at developers looking to integrate with
|
21
|
+
Animoto services from a Ruby environment or using the Ruby language.
|
22
|
+
|
23
|
+
<a name="what_is_covered_in_this_document"></a>
|
24
|
+
## What is covered in this document
|
25
|
+
|
26
|
+
This document covers the technical details of the Animoto API Ruby client and
|
27
|
+
provides a general overview of its use.
|
28
|
+
|
29
|
+
This document does not cover the details of the Animoto API itself. For such information please see the [Animoto API documentation][api_docs]
|
30
|
+
|
31
|
+
<a name="getting_started_using_the_ruby_client"></a>
|
32
|
+
## Getting Started using the Ruby Client
|
33
|
+
|
34
|
+
### Prerequisites
|
35
|
+
|
36
|
+
#### Readers of this document should be familiar with...
|
37
|
+
|
38
|
+
* The [the Ruby language](http://ruby-lang.org)
|
39
|
+
* The [Animoto API documentation][api_docs]
|
40
|
+
|
41
|
+
#### Authentication
|
42
|
+
|
43
|
+
You must have a application key and secret to use the Animoto API. If you
|
44
|
+
don't have a key/secret pair, please contact your Animoto representative. Note
|
45
|
+
that you may have multiple key/secret pairs at one time.
|
46
|
+
|
47
|
+
### Conceptual overview of Animoto
|
48
|
+
|
49
|
+
Creating a video using the Animoto API consists of two major steps:
|
50
|
+
"directing" and "rendering".
|
51
|
+
|
52
|
+
Directing is the process in which the Animoto system analyzes input visuals
|
53
|
+
and music and determines the best way to present those visuals with the
|
54
|
+
specified music. The output of directing is stored in the Animoto system for
|
55
|
+
later use and is called a "storyboard".
|
56
|
+
|
57
|
+
The second major phase of creating an Animoto video is called rendering.
|
58
|
+
Rendering is the transformation of the artistic choices made by the director
|
59
|
+
(and stored in a storyboard) into an actual video file that can be downloaded
|
60
|
+
and viewed.
|
61
|
+
|
62
|
+
Every time a new set of photos is to be transformed into a video, or every
|
63
|
+
time a new set of artistic choices is to be made, a new storyboard must be
|
64
|
+
created via directing. Once directing happens and a storyboard is created,
|
65
|
+
videos can be rendered from that storyboard at any time, each with different
|
66
|
+
resolutions, encodings, etc. suitable to different display environments.
|
67
|
+
|
68
|
+
While directing and rendering are generally speedy processes, they do take
|
69
|
+
longer than is appropriate for a typical HTTP request. These long-running
|
70
|
+
tasks are represented as "jobs" in the Animoto API. Directing (creating
|
71
|
+
storyboards) is accomplished by initiating a directing job, and rendering
|
72
|
+
(creating a video file) starts by creating a rendering job. Jobs are a handy
|
73
|
+
way to track status and debug problems if the requested operation couldn't be
|
74
|
+
completed.
|
75
|
+
|
76
|
+
### Creating a video using the Ruby client
|
77
|
+
|
78
|
+
This example shows how to create an Animoto video in one shot with the Ruby
|
79
|
+
client and using HTTP callbacks for status updates.
|
80
|
+
|
81
|
+
require 'animoto/client'
|
82
|
+
include Animoto
|
83
|
+
|
84
|
+
# Create a new client using our application key and secret
|
85
|
+
client = Client.new("application_key", "secret")
|
86
|
+
|
87
|
+
# create a directing and rendering manifest with the video title and
|
88
|
+
# producer. Also include rendering parameters like resolution, framerate,
|
89
|
+
# and format.
|
90
|
+
manifest = DirectingAndRenderingManifest.new(
|
91
|
+
:title => "Amazing Title!",
|
92
|
+
:producer => "Fishy Joe",
|
93
|
+
:resolution => "720p",
|
94
|
+
:framerate => 24,
|
95
|
+
:format => 'h264'
|
96
|
+
)
|
97
|
+
|
98
|
+
# Add some images, text, and footage to our manifest.
|
99
|
+
manifest << Image.new("http://website.com/picture.png")
|
100
|
+
manifest << Image.new("http://website.com/hooray.png", :spotlit => true)
|
101
|
+
manifest << TitleCard.new("Woohoo!", "Hooray for everything!")
|
102
|
+
manifest << Footage.new("http://website.com/movie.mp4", :duration => 3.5)
|
103
|
+
|
104
|
+
# Setup the soundtrack.
|
105
|
+
manifest << Song.new("http://website.com/song.mp3", :artist => "Fishy Joe")
|
106
|
+
|
107
|
+
# Setup to get http callbacks for status notification (see below for
|
108
|
+
# polling example).
|
109
|
+
manifest.http_callback_url = "http://mysite.com/animoto_callback"
|
110
|
+
manifest.http_callback_format = "json"
|
111
|
+
|
112
|
+
# Send the manifest to the API. Your app will be notified of
|
113
|
+
# completion/failure via an HTTP POST to
|
114
|
+
# "http://mysite.com/animoto_callback"
|
115
|
+
client.direct_and_render!(manifest)
|
116
|
+
|
117
|
+
|
118
|
+
### A basic example using the Ruby client
|
119
|
+
|
120
|
+
This example shows how to separately direct a storyboard and render a video
|
121
|
+
with that storyboard. It also demonstrates how to use polling to check on job
|
122
|
+
status.
|
123
|
+
|
124
|
+
require 'animoto/client'
|
125
|
+
include Animoto
|
126
|
+
|
127
|
+
# Create a new client using our application key and secret
|
128
|
+
client = Client.new("application_key", "secret")
|
129
|
+
|
130
|
+
# Create a directing manifest. The directing manifest controls the images
|
131
|
+
# and other visual elements that will be in our final video.
|
132
|
+
manifest = DirectingManifest.new(:title => "Amazing Title!", :producer => "Fishy Joe")
|
133
|
+
|
134
|
+
# Add some images, text, and footage to our manifest.
|
135
|
+
manifest << Image.new("http://website.com/picture.png")
|
136
|
+
manifest << Image.new("http://website.com/hooray.png", :spotlit => true)
|
137
|
+
manifest << TitleCard.new("Woohoo!", "Hooray for everything!")
|
138
|
+
manifest << Footage.new("http://website.com/movie.mp4", :duration => 3.5)
|
139
|
+
|
140
|
+
# Setup the soundtrack.
|
141
|
+
manifest << Song.new("http://website.com/song.mp3", :artist => "Fishy Joe")
|
142
|
+
|
143
|
+
# Request a new directing job by sending the API our directing manifest.
|
144
|
+
directing_job = client.direct!(manifest)
|
145
|
+
|
146
|
+
# Poll the service until the directing job is done.
|
147
|
+
while directing_job.pending?
|
148
|
+
sleep(30)
|
149
|
+
client.reload!(directing_job)
|
150
|
+
end
|
151
|
+
|
152
|
+
# If the directing job finished successfully, there will be a "storyboard"
|
153
|
+
# associated with this job.
|
154
|
+
if storyboard = directing_job.storyboard
|
155
|
+
|
156
|
+
# Now it's time to render the storyboard into a video. First we create
|
157
|
+
# a rendering manifest.
|
158
|
+
manifest = RenderingManifest.new(storyboard, :resolution => "720p", :framerate => 24, :format => 'h264')
|
159
|
+
|
160
|
+
# Send the manifest to the API.
|
161
|
+
rendering_job = client.render!(manifest)
|
162
|
+
|
163
|
+
# Poll the service until the rendering job is done
|
164
|
+
while rendering_job.pending?
|
165
|
+
sleep(30)
|
166
|
+
client.reload!(rendering_job)
|
167
|
+
end
|
168
|
+
|
169
|
+
# If the job has a video associated with it, everything worked out ok.
|
170
|
+
if video = rendering_job.video
|
171
|
+
# Print a link to download the video file.
|
172
|
+
puts video.url
|
173
|
+
else
|
174
|
+
# Something happened during rendering...
|
175
|
+
raise rendering_job.errors.first
|
176
|
+
end
|
177
|
+
else
|
178
|
+
# Looks like there was a problem. Perhaps one of the assets wasn't
|
179
|
+
# retrieved or was corrupt...
|
180
|
+
raise directing_job.errors.first
|
181
|
+
end
|
182
|
+
|
183
|
+
<a name="how_to_contribute"></a>
|
184
|
+
## How to contribute to this client
|
185
|
+
|
186
|
+
1. [Fork](http://help.github.com/forking/) `animoto_ruby_client`
|
187
|
+
2. Create a topic branch - `git checkout -b my_branch`
|
188
|
+
3. Push to your branch - `git push origin my_branch`
|
189
|
+
4. Create an [Issue](http://github.com/animoto/animoto_ruby_client/issues) with a link to your branch
|
190
|
+
5. That's it!
|
191
|
+
|
192
|
+
You might want to checkout our [the wiki page](http://wiki.github.com/animoto/animoto_ruby_client) for information
|
193
|
+
on coding standards, new features, etc.
|
194
|
+
|
195
|
+
|
196
|
+
[api_docs]: http://animoto.com/developer/api
|
data/lib/animoto/asset.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
module Animoto
|
2
2
|
class Asset
|
3
3
|
|
4
|
-
attr_accessor :
|
4
|
+
attr_accessor :source
|
5
5
|
|
6
|
-
def initialize
|
7
|
-
@
|
6
|
+
def initialize source, options = {}
|
7
|
+
@source = source
|
8
8
|
end
|
9
9
|
|
10
10
|
# Returns a representation of this asset as a Hash. Used mainly for generating
|
@@ -12,7 +12,7 @@ module Animoto
|
|
12
12
|
#
|
13
13
|
# @return [Hash] this asset as a Hash
|
14
14
|
def to_hash
|
15
|
-
{ '
|
15
|
+
{ 'source' => @source }
|
16
16
|
end
|
17
17
|
|
18
18
|
# Returns a representation of this asset as JSON.
|
data/lib/animoto/client.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
module Animoto
|
2
|
+
module Coverable
|
3
|
+
|
4
|
+
# Setter for cover, which makes this visual the cover for the video. Only
|
5
|
+
# one image or piece of footage in a manifest can be declared the cover.
|
6
|
+
#
|
7
|
+
# @param [Boolean] bool true if this visual should be the cover
|
8
|
+
def cover= bool
|
9
|
+
@cover = bool
|
10
|
+
end
|
11
|
+
|
12
|
+
# Returns true if this visual is the cover.
|
13
|
+
#
|
14
|
+
# @return [Boolean] whether or not this visual is the cover
|
15
|
+
def cover?
|
16
|
+
@cover
|
17
|
+
end
|
18
|
+
|
19
|
+
# Returns a representation of this visual as a Hash.
|
20
|
+
#
|
21
|
+
# @return [Hash] this visual as a Hash
|
22
|
+
def to_hash
|
23
|
+
hash = super rescue {}
|
24
|
+
hash['cover'] = cover? unless @cover.nil?
|
25
|
+
hash
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -1,20 +1,18 @@
|
|
1
1
|
module Animoto
|
2
2
|
class DirectingManifest < Animoto::Manifest
|
3
3
|
|
4
|
-
attr_accessor :title, :
|
4
|
+
attr_accessor :title, :pacing, :http_callback_url, :http_callback_format
|
5
5
|
attr_reader :visuals, :song, :style
|
6
6
|
|
7
7
|
# Creates a new DirectingManifest.
|
8
8
|
#
|
9
9
|
# @param [Hash] options
|
10
10
|
# @option options [String] :title the title of this project
|
11
|
-
# @option options [String] :producer the name of the producer of this project
|
12
11
|
# @option options ['default','half','double'] :pacing ('default') the pacing for this project
|
13
12
|
# @option options [String] :http_callback_url a URL to receive a callback when this job is done
|
14
13
|
# @option options ['json','xml'] :http_callback_format the format of the callback
|
15
14
|
def initialize options = {}
|
16
15
|
@title = options[:title]
|
17
|
-
@producer = options[:producer]
|
18
16
|
@pacing = options[:pacing] || 'default'
|
19
17
|
@style = 'original'
|
20
18
|
@visuals = []
|
@@ -102,7 +100,6 @@ module Animoto
|
|
102
100
|
manifest['style'] = style
|
103
101
|
manifest['pacing'] = pacing if pacing
|
104
102
|
manifest['title'] = title if title
|
105
|
-
manifest['producer_name'] = producer if producer
|
106
103
|
manifest['visuals'] = []
|
107
104
|
visuals.each do |visual|
|
108
105
|
manifest['visuals'] << visual.to_hash
|
data/lib/animoto/footage.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Animoto
|
2
2
|
class Footage < Animoto::Asset
|
3
3
|
include Animoto::Visual
|
4
|
+
include Animoto::Coverable
|
4
5
|
|
5
6
|
attr_accessor :audio_mix, :start_time, :duration
|
6
7
|
|
@@ -9,7 +10,7 @@ module Animoto
|
|
9
10
|
hash['audio_mix'] = 'MIX' if audio_mix
|
10
11
|
hash['start_time'] = start_time if start_time
|
11
12
|
hash['duration'] = duration if duration
|
12
|
-
hash
|
13
|
+
hash
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
data/lib/animoto/image.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Animoto
|
2
2
|
class Image < Animoto::Asset
|
3
3
|
include Animoto::Visual
|
4
|
+
include Animoto::Coverable
|
4
5
|
|
5
6
|
attr_accessor :rotation
|
6
7
|
|
@@ -8,6 +9,7 @@ module Animoto
|
|
8
9
|
hash = super
|
9
10
|
hash['rotation'] = rotation if rotation
|
10
11
|
hash['spotlit'] = spotlit? unless @spotlit.nil?
|
12
|
+
hash['cover'] = cover? unless @cover.nil?
|
11
13
|
hash
|
12
14
|
end
|
13
15
|
end
|
@@ -18,7 +18,7 @@ module Animoto
|
|
18
18
|
# @return [Hash] this manifest as a Hash
|
19
19
|
# @raise [ArgumentError] if a callback URL was specified but not the format
|
20
20
|
def to_hash
|
21
|
-
hash = { 'rendering_job' => { 'rendering_manifest' => { '
|
21
|
+
hash = { 'rendering_job' => { 'rendering_manifest' => { 'rendering_parameters' => {} } } }
|
22
22
|
job = hash['rendering_job']
|
23
23
|
if http_callback_url
|
24
24
|
raise ArgumentError, "You must specify a http_callback_format (either 'xml' or 'json')" if http_callback_format.nil?
|
@@ -27,10 +27,10 @@ module Animoto
|
|
27
27
|
end
|
28
28
|
manifest = job['rendering_manifest']
|
29
29
|
manifest['storyboard_url'] = storyboard.url
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
params = manifest['rendering_parameters']
|
31
|
+
params['resolution'] = resolution
|
32
|
+
params['framerate'] = framerate
|
33
|
+
params['format'] = format
|
34
34
|
hash
|
35
35
|
end
|
36
36
|
end
|
data/lib/animoto/song.rb
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
module Animoto
|
2
2
|
class Song < Animoto::Asset
|
3
3
|
|
4
|
-
attr_accessor :start_time, :duration
|
4
|
+
attr_accessor :start_time, :duration
|
5
5
|
|
6
6
|
def to_hash
|
7
7
|
hash = super
|
8
8
|
hash['start_time'] = start_time if start_time
|
9
9
|
hash['duration'] = duration if duration
|
10
|
-
hash['title'] = title if title
|
11
|
-
hash['artist'] = artist if artist
|
12
10
|
hash
|
13
11
|
end
|
14
12
|
|
data/lib/animoto/video.rb
CHANGED
@@ -3,7 +3,7 @@ module Animoto
|
|
3
3
|
|
4
4
|
def self.unpack_standard_envelope body
|
5
5
|
super.merge({
|
6
|
-
:download_url => body['response']['payload'][payload_key]['links']['
|
6
|
+
:download_url => body['response']['payload'][payload_key]['links']['file'],
|
7
7
|
:storyboard_url => body['response']['payload'][payload_key]['links']['storyboard'],
|
8
8
|
:duration => body['response']['payload'][payload_key]['metadata']['duration'],
|
9
9
|
:format => body['response']['payload'][payload_key]['metadata']['format'],
|
data/lib/animoto.rb
CHANGED
data/spec/animoto/asset_spec.rb
CHANGED
@@ -8,7 +8,7 @@ describe Animoto::DirectingAndRenderingManifest do
|
|
8
8
|
|
9
9
|
describe "generating a hash" do
|
10
10
|
before do
|
11
|
-
manifest(:title => 'Funderful Wonderment', :
|
11
|
+
manifest(:title => 'Funderful Wonderment', :pacing => 'double',
|
12
12
|
:resolution => "720p", :framerate => 24, :format => 'flv')
|
13
13
|
@image = manifest.add_image 'http://website.com/image.png'
|
14
14
|
@title_card = manifest.add_title_card 'woohoo', 'this is awesome'
|
@@ -69,11 +69,6 @@ describe Animoto::DirectingAndRenderingManifest do
|
|
69
69
|
@hash['pacing'].should == manifest.pacing
|
70
70
|
end
|
71
71
|
|
72
|
-
it "should have a 'producer_name' key in the manifest" do
|
73
|
-
@hash.should have_key('producer_name')
|
74
|
-
@hash['producer_name'].should == manifest.producer
|
75
|
-
end
|
76
|
-
|
77
72
|
it "should have a 'visuals' key in the manifest" do
|
78
73
|
@hash.should have_key('visuals')
|
79
74
|
end
|
@@ -23,14 +23,6 @@ describe Animoto::DirectingManifest do
|
|
23
23
|
manifest.style.should == 'original'
|
24
24
|
end
|
25
25
|
|
26
|
-
it "should default to no producer" do
|
27
|
-
manifest.producer.should be_nil
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should be able to specify the producer with a :producer parameter" do
|
31
|
-
manifest(:producer => "Senor Spielbergo").producer.should == "Senor Spielbergo"
|
32
|
-
end
|
33
|
-
|
34
26
|
it "should default to having to visuals" do
|
35
27
|
manifest.visuals.should be_empty
|
36
28
|
end
|
@@ -92,7 +84,7 @@ describe Animoto::DirectingManifest do
|
|
92
84
|
|
93
85
|
describe "generating a hash" do
|
94
86
|
before do
|
95
|
-
manifest(:title => 'Funderful Wonderment', :
|
87
|
+
manifest(:title => 'Funderful Wonderment', :pacing => 'double')
|
96
88
|
@image = manifest.add_image 'http://website.com/image.png'
|
97
89
|
@title_card = manifest.add_title_card 'woohoo', 'this is awesome'
|
98
90
|
@footage = manifest.add_footage 'http://website.com/movie.mp4'
|
@@ -119,11 +111,6 @@ describe Animoto::DirectingManifest do
|
|
119
111
|
manifest.to_hash['directing_job']['directing_manifest']['pacing'].should == manifest.pacing
|
120
112
|
end
|
121
113
|
|
122
|
-
it "should have a 'producer_name' key in the manifest" do
|
123
|
-
manifest.to_hash['directing_job']['directing_manifest'].should have_key('producer_name')
|
124
|
-
manifest.to_hash['directing_job']['directing_manifest']['producer_name'].should == manifest.producer
|
125
|
-
end
|
126
|
-
|
127
114
|
it "should have a 'visuals' key in the manifest" do
|
128
115
|
manifest.to_hash['directing_job']['directing_manifest'].should have_key('visuals')
|
129
116
|
end
|
@@ -11,9 +11,9 @@ describe Animoto::Footage do
|
|
11
11
|
@footage = Animoto::Footage.new 'http://website.com/movie.mp4'
|
12
12
|
end
|
13
13
|
|
14
|
-
it "should have a '
|
15
|
-
@footage.to_hash.should have_key('
|
16
|
-
@footage.to_hash['
|
14
|
+
it "should have a 'source' key with the url" do
|
15
|
+
@footage.to_hash.should have_key('source')
|
16
|
+
@footage.to_hash['source'].should == @footage.source
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should not have a 'spotlit' key" do
|
data/spec/animoto/image_spec.rb
CHANGED
@@ -11,9 +11,9 @@ describe Animoto::Image do
|
|
11
11
|
@image = Animoto::Image.new 'http://website.com/image.png'
|
12
12
|
end
|
13
13
|
|
14
|
-
it "should have a '
|
15
|
-
@image.to_hash.should have_key('
|
16
|
-
@image.to_hash['
|
14
|
+
it "should have a 'source' key with the url" do
|
15
|
+
@image.to_hash.should have_key('source')
|
16
|
+
@image.to_hash['source'].should == @image.source
|
17
17
|
end
|
18
18
|
|
19
19
|
describe "if rotated" do
|
@@ -61,18 +61,18 @@ describe Animoto::RenderingManifest do
|
|
61
61
|
manifest.to_hash['rendering_job']['rendering_manifest']['storyboard_url'].should == @storyboard.url
|
62
62
|
end
|
63
63
|
|
64
|
-
it "should have a '
|
65
|
-
manifest.to_hash['rendering_job']['rendering_manifest'].should have_key('
|
66
|
-
manifest.to_hash['rendering_job']['rendering_manifest']['
|
64
|
+
it "should have a 'rendering_parameters' object in the manifest" do
|
65
|
+
manifest.to_hash['rendering_job']['rendering_manifest'].should have_key('rendering_parameters')
|
66
|
+
manifest.to_hash['rendering_job']['rendering_manifest']['rendering_parameters'].should be_a(Hash)
|
67
67
|
end
|
68
68
|
|
69
|
-
describe "rendering
|
69
|
+
describe "rendering parameters" do
|
70
70
|
before do
|
71
|
-
@profile = manifest.to_hash['rendering_job']['rendering_manifest']['
|
71
|
+
@profile = manifest.to_hash['rendering_job']['rendering_manifest']['rendering_parameters']
|
72
72
|
end
|
73
73
|
|
74
|
-
it "should have a '
|
75
|
-
@profile['
|
74
|
+
it "should have a 'resolution' key" do
|
75
|
+
@profile['resolution'].should == manifest.resolution
|
76
76
|
end
|
77
77
|
|
78
78
|
it "should have a 'framerate' key" do
|
data/spec/animoto/song_spec.rb
CHANGED
@@ -7,9 +7,9 @@ describe Animoto::Song do
|
|
7
7
|
@song = Animoto::Song.new 'http://website.com/song.mp3'
|
8
8
|
end
|
9
9
|
|
10
|
-
it "should have a '
|
11
|
-
@song.to_hash.should have_key('
|
12
|
-
@song.to_hash['
|
10
|
+
it "should have a 'source' key with the url" do
|
11
|
+
@song.to_hash.should have_key('source')
|
12
|
+
@song.to_hash['source'].should == @song.source
|
13
13
|
end
|
14
14
|
|
15
15
|
describe "if a start time was specified" do
|
@@ -32,23 +32,6 @@ describe Animoto::Song do
|
|
32
32
|
@song.to_hash.should have_key('duration')
|
33
33
|
@song.to_hash['duration'].should == @song.duration
|
34
34
|
end
|
35
|
-
end
|
36
|
-
|
37
|
-
describe "if a title and/or artist was specified" do
|
38
|
-
before do
|
39
|
-
@song.title = "Antarctican Drinking Song"
|
40
|
-
@song.artist = "Gwar"
|
41
|
-
end
|
42
|
-
|
43
|
-
it "should have an 'artist' key with the artist" do
|
44
|
-
@song.to_hash.should have_key('artist')
|
45
|
-
@song.to_hash['artist'].should == @song.artist
|
46
|
-
end
|
47
|
-
|
48
|
-
it "should have a 'title' key with the title" do
|
49
|
-
@song.to_hash.should have_key('title')
|
50
|
-
@song.to_hash['title'].should == @song.title
|
51
|
-
end
|
52
|
-
end
|
35
|
+
end
|
53
36
|
end
|
54
37
|
end
|
data/spec/animoto/video_spec.rb
CHANGED
data/spec/animoto/visual_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: animoto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: -
|
4
|
+
hash: -1710980560
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
-
|
11
|
-
version: 0.0.0.
|
10
|
+
- alpha2
|
11
|
+
version: 0.0.0.alpha2
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Animoto
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-08-
|
19
|
+
date: 2010-08-30 00:00:00 -04:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -48,6 +48,7 @@ files:
|
|
48
48
|
- ./lib/animoto/asset.rb
|
49
49
|
- ./lib/animoto/client.rb
|
50
50
|
- ./lib/animoto/content_type.rb
|
51
|
+
- ./lib/animoto/coverable.rb
|
51
52
|
- ./lib/animoto/directing_and_rendering_job.rb
|
52
53
|
- ./lib/animoto/directing_and_rendering_manifest.rb
|
53
54
|
- ./lib/animoto/directing_job.rb
|
@@ -69,6 +70,7 @@ files:
|
|
69
70
|
- ./lib/animoto.rb
|
70
71
|
- ./spec/animoto/asset_spec.rb
|
71
72
|
- ./spec/animoto/client_spec.rb
|
73
|
+
- ./spec/animoto/coverable_spec.rb
|
72
74
|
- ./spec/animoto/directing_and_rendering_job_spec.rb
|
73
75
|
- ./spec/animoto/directing_and_rendering_manifest_spec.rb
|
74
76
|
- ./spec/animoto/directing_job_spec.rb
|