360_services 0.0.8 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/360_services.gemspec +4 -4
- data/HOW_TO_BUILD.txt +1 -3
- data/Manifest +0 -1
- data/Rakefile +1 -1
- data/lib/sorenson/services/account.rb +2 -4
- data/lib/sorenson/services/base.rb +1 -1
- data/lib/sorenson/services/group.rb +0 -11
- data/lib/sorenson/services.rb +1 -2
- metadata +2 -4
- data/lib/sorenson/services/preset.rb +0 -21
data/360_services.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{360_services}
|
5
|
-
s.version = "0.0
|
5
|
+
s.version = "1.0.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Sorenson Media"]
|
9
|
-
s.date = %q{2010-03-
|
9
|
+
s.date = %q{2010-03-07}
|
10
10
|
s.description = %q{Ruby bindings for Sorenson 360}
|
11
11
|
s.email = %q{video@sorensonmedia.com}
|
12
|
-
s.extra_rdoc_files = ["README.rdoc", "lib/sorenson/services.rb", "lib/sorenson/services/account.rb", "lib/sorenson/services/array.rb", "lib/sorenson/services/asset.rb", "lib/sorenson/services/base.rb", "lib/sorenson/services/category.rb", "lib/sorenson/services/core_ext.rb", "lib/sorenson/services/core_ext/attribute_accessors.rb", "lib/sorenson/services/core_ext/hash.rb", "lib/sorenson/services/core_ext/object.rb", "lib/sorenson/services/event.rb", "lib/sorenson/services/flag.rb", "lib/sorenson/services/group.rb", "lib/sorenson/services/metric.rb", "lib/sorenson/services/
|
13
|
-
s.files = ["HOW_TO_BUILD.txt", "Manifest", "README.rdoc", "Rakefile", "features/manage_accounts.feature", "features/manage_assets.feature", "features/manage_categories.feature", "features/manage_flags.feature", "features/manage_group_assets.feature", "features/manage_groups.feature", "features/manage_metadata.feature", "features/manage_metrics.feature", "features/manage_sites.feature", "features/manage_tags.feature", "features/mange_rate_plan.feature", "features/step_definitions/manage_accounts_steps.rb", "features/step_definitions/manage_assets_steps.rb", "features/step_definitions/manage_categories_steps.rb", "features/step_definitions/manage_flags_steps.rb", "features/step_definitions/manage_group_assets_steps.rb", "features/step_definitions/manage_groups_steps.rb", "features/step_definitions/manage_metadata_steps.rb", "features/step_definitions/manage_metrics_steps.rb", "features/step_definitions/manage_sites_steps.rb", "features/step_definitions/manage_tags_steps.rb", "features/step_definitions/mange_rate_plan_steps.rb", "features/step_definitions/utility_steps.rb", "features/step_definitions/web_steps.rb", "features/support/document_steps.rb", "features/support/env.rb", "features/support/netrecorder.rb", "features/support/paths.rb", "lib/sorenson/services.rb", "lib/sorenson/services/account.rb", "lib/sorenson/services/array.rb", "lib/sorenson/services/asset.rb", "lib/sorenson/services/base.rb", "lib/sorenson/services/category.rb", "lib/sorenson/services/core_ext.rb", "lib/sorenson/services/core_ext/attribute_accessors.rb", "lib/sorenson/services/core_ext/hash.rb", "lib/sorenson/services/core_ext/object.rb", "lib/sorenson/services/event.rb", "lib/sorenson/services/flag.rb", "lib/sorenson/services/group.rb", "lib/sorenson/services/metric.rb", "lib/sorenson/services/
|
12
|
+
s.extra_rdoc_files = ["README.rdoc", "lib/sorenson/services.rb", "lib/sorenson/services/account.rb", "lib/sorenson/services/array.rb", "lib/sorenson/services/asset.rb", "lib/sorenson/services/base.rb", "lib/sorenson/services/category.rb", "lib/sorenson/services/core_ext.rb", "lib/sorenson/services/core_ext/attribute_accessors.rb", "lib/sorenson/services/core_ext/hash.rb", "lib/sorenson/services/core_ext/object.rb", "lib/sorenson/services/event.rb", "lib/sorenson/services/flag.rb", "lib/sorenson/services/group.rb", "lib/sorenson/services/metric.rb", "lib/sorenson/services/rate_plan.rb", "lib/sorenson/services/site.rb", "lib/sorenson/services/subaccount.rb", "lib/sorenson/services/tag.rb"]
|
13
|
+
s.files = ["HOW_TO_BUILD.txt", "Manifest", "README.rdoc", "Rakefile", "features/manage_accounts.feature", "features/manage_assets.feature", "features/manage_categories.feature", "features/manage_flags.feature", "features/manage_group_assets.feature", "features/manage_groups.feature", "features/manage_metadata.feature", "features/manage_metrics.feature", "features/manage_sites.feature", "features/manage_tags.feature", "features/mange_rate_plan.feature", "features/step_definitions/manage_accounts_steps.rb", "features/step_definitions/manage_assets_steps.rb", "features/step_definitions/manage_categories_steps.rb", "features/step_definitions/manage_flags_steps.rb", "features/step_definitions/manage_group_assets_steps.rb", "features/step_definitions/manage_groups_steps.rb", "features/step_definitions/manage_metadata_steps.rb", "features/step_definitions/manage_metrics_steps.rb", "features/step_definitions/manage_sites_steps.rb", "features/step_definitions/manage_tags_steps.rb", "features/step_definitions/mange_rate_plan_steps.rb", "features/step_definitions/utility_steps.rb", "features/step_definitions/web_steps.rb", "features/support/document_steps.rb", "features/support/env.rb", "features/support/netrecorder.rb", "features/support/paths.rb", "lib/sorenson/services.rb", "lib/sorenson/services/account.rb", "lib/sorenson/services/array.rb", "lib/sorenson/services/asset.rb", "lib/sorenson/services/base.rb", "lib/sorenson/services/category.rb", "lib/sorenson/services/core_ext.rb", "lib/sorenson/services/core_ext/attribute_accessors.rb", "lib/sorenson/services/core_ext/hash.rb", "lib/sorenson/services/core_ext/object.rb", "lib/sorenson/services/event.rb", "lib/sorenson/services/flag.rb", "lib/sorenson/services/group.rb", "lib/sorenson/services/metric.rb", "lib/sorenson/services/rate_plan.rb", "lib/sorenson/services/site.rb", "lib/sorenson/services/subaccount.rb", "lib/sorenson/services/tag.rb", "360_services.gemspec"]
|
14
14
|
s.homepage = %q{http://github.com/sorenson/360_services}
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "360_services", "--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
data/HOW_TO_BUILD.txt
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
(MAKE SURE YOU INCREMENT THE VERSION NUMBER in the Rakefile)
|
2
|
-
|
3
1
|
1. GET INTO THIS DIRECTORY
|
4
2
|
cd 360_services_gem
|
5
3
|
|
@@ -20,7 +18,7 @@ cd pkg
|
|
20
18
|
|
21
19
|
7. PUSH GEM TO GEMCUTTER (MAKE SURE GEMCUTTER GEM IS INSTALLED)
|
22
20
|
gem install gemcutter (IF NEEDED)
|
23
|
-
gem push 360_services-0.0.
|
21
|
+
gem push 360_services-0.0.1.gem (MAKE SURE VERSION NUMBER WAS INCREMENTED CORRECTLY)
|
24
22
|
|
25
23
|
8. INSTALL THE FINISHED GEM LOCALLY
|
26
24
|
gem install 360_services
|
data/Manifest
CHANGED
@@ -44,7 +44,6 @@ lib/sorenson/services/event.rb
|
|
44
44
|
lib/sorenson/services/flag.rb
|
45
45
|
lib/sorenson/services/group.rb
|
46
46
|
lib/sorenson/services/metric.rb
|
47
|
-
lib/sorenson/services/preset.rb
|
48
47
|
lib/sorenson/services/rate_plan.rb
|
49
48
|
lib/sorenson/services/site.rb
|
50
49
|
lib/sorenson/services/subaccount.rb
|
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ require 'cucumber'
|
|
3
3
|
require 'cucumber/rake/task'
|
4
4
|
require 'echoe'
|
5
5
|
|
6
|
-
Echoe.new('360_services', '0.0
|
6
|
+
Echoe.new('360_services', '1.0.0') do |p|
|
7
7
|
p.description = "Ruby bindings for Sorenson 360"
|
8
8
|
p.url = "http://github.com/sorenson/360_services"
|
9
9
|
p.author = "Sorenson Media"
|
@@ -2,12 +2,11 @@ module Sorenson
|
|
2
2
|
module Services
|
3
3
|
class Account < Base
|
4
4
|
attr_accessor :rate_plan, :username, :status, :customer_id, :id, :rate_plan_expiration_date, :date_last_modified,
|
5
|
-
:last_login_time, :date_retrieved, :total_asset_count, :token
|
5
|
+
:last_login_time, :date_retrieved, :total_asset_count, :token
|
6
6
|
cattr_accessor :account_token, :account_id
|
7
7
|
|
8
8
|
def self.login(username, password)
|
9
|
-
|
10
|
-
account = Account.new(data)
|
9
|
+
account = Account.new(JSON.parse(login_no_resource(username, password)))
|
11
10
|
self.account_token = account.token
|
12
11
|
self.account_id = account.id
|
13
12
|
return account if account.token
|
@@ -47,7 +46,6 @@ module Sorenson
|
|
47
46
|
self.status = data['status']
|
48
47
|
self.customer_id = data['id']
|
49
48
|
self.id = data['id']
|
50
|
-
self.subaccount_id = data['subaccountId']
|
51
49
|
self.rate_plan_expiration_date = data['rate_plan_expiration_date']
|
52
50
|
self.date_last_modified = data['date_last_modified']
|
53
51
|
self.last_login_time = data['last_login_time']
|
@@ -23,7 +23,7 @@ module Sorenson
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.host
|
26
|
-
host = ['development', 'test', 'cucumber'].include?(RAILS_ENV) ? 'http://localhost:3001' : 'http://360services.sorensonmedia.com'
|
26
|
+
host = ['development', 'test', 'cucumber'].include?(ENV['RAILS_ENV']) ? 'http://localhost:3001' : 'http://360services.sorensonmedia.com'
|
27
27
|
host
|
28
28
|
end
|
29
29
|
|
@@ -3,22 +3,11 @@ module Sorenson
|
|
3
3
|
class Group < Base
|
4
4
|
attr_accessor :name, :description, :account_id, :id, :guid
|
5
5
|
|
6
|
-
def self.presets(group_id)
|
7
|
-
get_from("/groups/#{group_id}/presets")
|
8
|
-
end
|
9
|
-
|
10
6
|
def self.create(name, attributes={})
|
11
7
|
data = post_to("/groups", :group => attributes.merge(:name => name))
|
12
8
|
new(data['group'])
|
13
9
|
end
|
14
10
|
|
15
|
-
def self.update(name, attributes={})
|
16
|
-
attributes[:preset_ids] = (attributes[:preset_ids] || []).join(",")
|
17
|
-
guid = attributes.delete(:group_id)
|
18
|
-
data = put_to("/groups/#{guid}", :group => attributes.merge({:name => name, :id => guid}))
|
19
|
-
new(data['group'])
|
20
|
-
end
|
21
|
-
|
22
11
|
def self.all
|
23
12
|
collection = Base.get_from("/groups")
|
24
13
|
collection.collect { |data| new(data['group'])}
|
data/lib/sorenson/services.rb
CHANGED
@@ -16,5 +16,4 @@ require(File.join(File.dirname(__FILE__), 'services', 'asset'))
|
|
16
16
|
require(File.join(File.dirname(__FILE__), 'services', 'array'))
|
17
17
|
require(File.join(File.dirname(__FILE__), 'services', 'site'))
|
18
18
|
require(File.join(File.dirname(__FILE__), 'services', 'subaccount'))
|
19
|
-
require(File.join(File.dirname(__FILE__), 'services', 'core_ext', 'object'))
|
20
|
-
require(File.join(File.dirname(__FILE__), 'services', 'preset'))
|
19
|
+
require(File.join(File.dirname(__FILE__), 'services', 'core_ext', 'object'))
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 360_services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sorenson Media
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-03-
|
12
|
+
date: 2010-03-07 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -74,7 +74,6 @@ extra_rdoc_files:
|
|
74
74
|
- lib/sorenson/services/flag.rb
|
75
75
|
- lib/sorenson/services/group.rb
|
76
76
|
- lib/sorenson/services/metric.rb
|
77
|
-
- lib/sorenson/services/preset.rb
|
78
77
|
- lib/sorenson/services/rate_plan.rb
|
79
78
|
- lib/sorenson/services/site.rb
|
80
79
|
- lib/sorenson/services/subaccount.rb
|
@@ -126,7 +125,6 @@ files:
|
|
126
125
|
- lib/sorenson/services/flag.rb
|
127
126
|
- lib/sorenson/services/group.rb
|
128
127
|
- lib/sorenson/services/metric.rb
|
129
|
-
- lib/sorenson/services/preset.rb
|
130
128
|
- lib/sorenson/services/rate_plan.rb
|
131
129
|
- lib/sorenson/services/site.rb
|
132
130
|
- lib/sorenson/services/subaccount.rb
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# Sorenson Namespace
|
2
|
-
module Sorenson
|
3
|
-
# Sorenson Services Namespace
|
4
|
-
module Services
|
5
|
-
# Allows you to access the resources associated with a sorenson services asset. An asset currently refers to video content.
|
6
|
-
class Preset < Base
|
7
|
-
def self.all
|
8
|
-
get_from('/presets')
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.find_by_name(name)
|
12
|
-
response = get_from("/presets/#{URI.encode(name)}")
|
13
|
-
if response.has_key?(:errors)
|
14
|
-
nil
|
15
|
-
else
|
16
|
-
response['url']
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|