animoto 1.5.0 → 1.5.1
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/lib/animoto.rb +1 -1
- data/lib/animoto/manifests/directing.rb +1 -1
- data/lib/animoto/styles.rb +24 -6
- data/spec/animoto/manifests/directing_spec.rb +2 -2
- data/spec/animoto/styles_spec.rb +33 -0
- metadata +6 -12
- data/features/step_definitions/bundling_steps.rb +0 -0
- data/features/step_definitions/directing_and_rendering_steps.rb +0 -0
- data/features/step_definitions/directing_steps.rb +0 -0
- data/features/step_definitions/rendering_steps.rb +0 -0
- data/features/step_definitions/storyboard_steps.rb +0 -0
- data/features/step_definitions/unbundling_steps.rb +0 -0
- data/features/step_definitions/video_steps.rb +0 -0
- data/features/support/env.rb +0 -38
data/lib/animoto.rb
CHANGED
@@ -50,7 +50,7 @@ module Animoto
|
|
50
50
|
super
|
51
51
|
@title = options[:title]
|
52
52
|
@pacing = options[:pacing] || 'auto'
|
53
|
-
@style = options[:style] || Animoto::Styles::
|
53
|
+
@style = options[:style] || Animoto::Styles::ANIMOTO_ORIGINAL
|
54
54
|
@postroll = Animoto::Postroll.new(options[:postroll] || Animoto::Postroll::POWERED_BY_ANIMOTO)
|
55
55
|
@visuals = []
|
56
56
|
@song = nil
|
data/lib/animoto/styles.rb
CHANGED
@@ -1,10 +1,28 @@
|
|
1
1
|
module Animoto
|
2
2
|
module Styles
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
|
4
|
+
ANIMOTO_ORIGINAL = "original"
|
5
|
+
WATERCOLOR_SEASHORE = "mothers_day_2011"
|
6
|
+
DUSK_RETREAT = "elegance_12"
|
7
|
+
VINTAGE_VOYAGE = "vintage"
|
8
|
+
COSMIC_TIDINGS = "cosmic_tidings"
|
9
|
+
WONDERLAND_OF_SNOW = "wonderland_of_snow"
|
10
|
+
THROUGH_THE_BLOSSOMS = "valentines_day_2012_hands"
|
11
|
+
|
12
|
+
DEPRECATED_NAMES = {
|
13
|
+
:ORIGINAL => :ANIMOTO_ORIGINAL,
|
14
|
+
:MOTHERS_DAY_2011 => :WATERCOLOR_SEASHORE,
|
15
|
+
:ELEGANCE => :DUSK_RETREAT,
|
16
|
+
:VINTAGE => :VINTAGE_VOYAGE
|
17
|
+
}
|
18
|
+
|
19
|
+
def self.const_missing old_name
|
20
|
+
if new_name = DEPRECATED_NAMES[old_name]
|
21
|
+
warn("The style name \"#{old_name.to_s}\" is deprecated. Use \"#{new_name}\" instead.")
|
22
|
+
const_set(old_name, const_get(new_name))
|
23
|
+
else
|
24
|
+
super
|
25
|
+
end
|
26
|
+
end
|
9
27
|
end
|
10
28
|
end
|
@@ -20,11 +20,11 @@ describe Animoto::Manifests::Directing do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should default to 'original' style" do
|
23
|
-
manifest.style.should == Animoto::Styles::
|
23
|
+
manifest.style.should == Animoto::Styles::ANIMOTO_ORIGINAL
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should be able to specify the style with a :style parameter" do
|
27
|
-
manifest(:style => Animoto::Styles::
|
27
|
+
manifest(:style => Animoto::Styles::VINTAGE_VOYAGE).style.should == Animoto::Styles::VINTAGE_VOYAGE
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should default to having the 'powered by animoto' postroll" do
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
2
|
+
|
3
|
+
describe Animoto::Styles do
|
4
|
+
describe "deprecated constants" do
|
5
|
+
it "should warn you when using a deprecated constant name" do
|
6
|
+
Animoto::Styles.expects(:warn)
|
7
|
+
Animoto::Styles::ORIGINAL
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should inform you of the new constant name" do
|
11
|
+
const = Animoto::Styles::DEPRECATED_NAMES[:ORIGINAL].to_s
|
12
|
+
Animoto::Styles.expects(:warn).with(regexp_matches(Regexp.compile(const)))
|
13
|
+
Animoto::Styles::ORIGINAL
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should return the correct value of the new constant name" do
|
17
|
+
Animoto::Styles.stubs(:warn)
|
18
|
+
Animoto::Styles::ORIGINAL.should == Animoto::Styles::ANIMOTO_ORIGINAL
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should define the deprecated constant to suppress multiple warnings" do
|
22
|
+
Animoto::Styles.expects(:warn).once
|
23
|
+
Animoto::Styles.const_defined?(:ORIGINAL).should_not be_true
|
24
|
+
Animoto::Styles::ORIGINAL
|
25
|
+
Animoto::Styles.const_defined?(:ORIGINAL).should be_true
|
26
|
+
Animoto::Styles::ORIGINAL
|
27
|
+
end
|
28
|
+
|
29
|
+
after do
|
30
|
+
Animoto::Styles.__send__(:remove_const, :ORIGINAL) if Animoto::Styles.const_defined?(:ORIGINAL)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: animoto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 1.5.
|
9
|
+
- 1
|
10
|
+
version: 1.5.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Animoto
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01
|
18
|
+
date: 2012-02-01 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: json
|
@@ -43,14 +43,6 @@ extra_rdoc_files: []
|
|
43
43
|
|
44
44
|
files:
|
45
45
|
- README.md
|
46
|
-
- ./features/step_definitions/bundling_steps.rb
|
47
|
-
- ./features/step_definitions/directing_and_rendering_steps.rb
|
48
|
-
- ./features/step_definitions/directing_steps.rb
|
49
|
-
- ./features/step_definitions/rendering_steps.rb
|
50
|
-
- ./features/step_definitions/storyboard_steps.rb
|
51
|
-
- ./features/step_definitions/unbundling_steps.rb
|
52
|
-
- ./features/step_definitions/video_steps.rb
|
53
|
-
- ./features/support/env.rb
|
54
46
|
- ./lib/animoto/assets/base.rb
|
55
47
|
- ./lib/animoto/assets/footage.rb
|
56
48
|
- ./lib/animoto/assets/image.rb
|
@@ -114,6 +106,7 @@ files:
|
|
114
106
|
- ./spec/animoto/resources/video_spec.rb
|
115
107
|
- ./spec/animoto/response_parsers/json_adapter_spec.rb
|
116
108
|
- ./spec/animoto/response_parsers/yajl_adapter_spec.rb
|
109
|
+
- ./spec/animoto/styles_spec.rb
|
117
110
|
- ./spec/animoto/support/standard_envelope_spec.rb
|
118
111
|
- ./spec/animoto_spec.rb
|
119
112
|
- ./spec/spec_helper.rb
|
@@ -152,3 +145,4 @@ specification_version: 3
|
|
152
145
|
summary: Client for working with the Animoto RESTful HTTP API
|
153
146
|
test_files: []
|
154
147
|
|
148
|
+
has_rdoc: true
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/features/support/env.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
Bundler.setup(:default, :test)
|
2
|
-
|
3
|
-
require 'cucumber'
|
4
|
-
require 'rspec'
|
5
|
-
require 'mocha'
|
6
|
-
|
7
|
-
# Use mocha for mocking
|
8
|
-
RSpec.configure do |config|
|
9
|
-
config.mock_with :mocha
|
10
|
-
end
|
11
|
-
|
12
|
-
# Verify mocha after each scenario
|
13
|
-
After do
|
14
|
-
Mocha::Mockery.instance.verify(nil)
|
15
|
-
Mocha::Mockery.instance.teardown
|
16
|
-
Mocha::Mockery.reset_instance
|
17
|
-
end
|
18
|
-
|
19
|
-
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib', 'animoto', 'client'))
|
20
|
-
|
21
|
-
module Animoto
|
22
|
-
class IntegrationTest
|
23
|
-
include Mocha::API
|
24
|
-
|
25
|
-
def client
|
26
|
-
@client ||= begin
|
27
|
-
endpoint = case ENV['ANIMOTO_PLATFORM_ENV']
|
28
|
-
when 'production' : ''
|
29
|
-
when NilClass : '-sandbox'
|
30
|
-
else : "-#{ENV['ANIMOTO_PLATFORM_ENV']}"
|
31
|
-
end
|
32
|
-
Client.new ENV['ANIMOTO_USERNAME'], ENV['ANIMOTO_PASSWORD'], :endpoint => endpoint
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
World { Animoto::IntegrationTest.new }
|