360_services 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/360_services.gemspec CHANGED
@@ -2,20 +2,20 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{360_services}
5
- s.version = "1.0.1"
5
+ s.version = "1.0.2"
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-09}
9
+ s.date = %q{2010-03-10}
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/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"]
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/preset.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/preset.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"]
17
17
  s.rubyforge_project = %q{360_services}
18
- s.rubygems_version = %q{1.3.5}
18
+ s.rubygems_version = %q{1.3.6}
19
19
  s.summary = %q{Ruby bindings for Sorenson 360}
20
20
 
21
21
  if s.respond_to? :specification_version then
data/HOW_TO_BUILD.txt CHANGED
@@ -1,3 +1,5 @@
1
+ (MAKE SURE YOU INCREMENT THE VERSION NUMBER in the Rakefile)
2
+
1
3
  1. GET INTO THIS DIRECTORY
2
4
  cd 360_services_gem
3
5
 
@@ -18,7 +20,7 @@ cd pkg
18
20
 
19
21
  7. PUSH GEM TO GEMCUTTER (MAKE SURE GEMCUTTER GEM IS INSTALLED)
20
22
  gem install gemcutter (IF NEEDED)
21
- gem push 360_services-0.0.1.gem (MAKE SURE VERSION NUMBER WAS INCREMENTED CORRECTLY)
23
+ gem push 360_services-0.0.5.gem (MAKE SURE YOU INCREMENTED THE VERSION NUMBER in the Rakefile!!!)
22
24
 
23
25
  8. INSTALL THE FINISHED GEM LOCALLY
24
26
  gem install 360_services
data/Manifest CHANGED
@@ -44,6 +44,7 @@ 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
47
48
  lib/sorenson/services/rate_plan.rb
48
49
  lib/sorenson/services/site.rb
49
50
  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', '1.0.1') do |p|
6
+ Echoe.new('360_services', '1.0.2') 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"
@@ -16,4 +16,5 @@ 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'))
19
+ require(File.join(File.dirname(__FILE__), 'services', 'core_ext', 'object'))
20
+ require(File.join(File.dirname(__FILE__), 'services', 'preset'))
@@ -2,7 +2,7 @@ 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, :subaccount_id
5
+ :last_login_time, :date_retrieved, :total_asset_count, :token, :subaccount_id, :session_id
6
6
  cattr_accessor :account_token, :account_id
7
7
 
8
8
  def self.login(username, password)
@@ -35,7 +35,7 @@ module Sorenson
35
35
  end
36
36
 
37
37
  def get_subaccounts
38
- get_from("/subaccounts")
38
+ Base.get_from("/subaccounts")
39
39
  end
40
40
 
41
41
  def create_subaccount(username, email, password)
@@ -47,7 +47,8 @@ module Sorenson
47
47
  self.status = data['status']
48
48
  self.customer_id = data['id']
49
49
  self.id = data['id']
50
- self.subaccount_id = data['subaccountId']
50
+ self.subaccount_id = data['subaccount_id']
51
+ self.session_id = data['session_id']
51
52
  self.rate_plan_expiration_date = data['rate_plan_expiration_date']
52
53
  self.date_last_modified = data['date_last_modified']
53
54
  self.last_login_time = data['last_login_time']
@@ -3,11 +3,23 @@ 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
+
6
10
  def self.create(name, attributes={})
7
11
  data = post_to("/groups", :group => attributes.merge(:name => name))
8
12
  new(data['group'])
9
13
  end
10
14
 
15
+ def self.update(name, attributes={})
16
+ return nil if attributes[:preset_ids].nil?
17
+ attributes[:preset_ids] = attributes[:preset_ids].join(",")
18
+ guid = attributes.delete(:group_id)
19
+ data = put_to("/groups/#{guid}", :group => attributes.merge({:name => name, :id => guid}))
20
+ new(data['group'])
21
+ end
22
+
11
23
  def self.all
12
24
  collection = Base.get_from("/groups")
13
25
  collection.collect { |data| new(data['group'])}
@@ -0,0 +1,21 @@
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
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: 360_services
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 0
8
+ - 2
9
+ version: 1.0.2
5
10
  platform: ruby
6
11
  authors:
7
12
  - Sorenson Media
@@ -9,49 +14,57 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-03-09 00:00:00 -08:00
17
+ date: 2010-03-10 00:00:00 -07:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: echoe
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
23
29
  version: "0"
24
- version:
30
+ type: :development
31
+ version_requirements: *id001
25
32
  - !ruby/object:Gem::Dependency
26
33
  name: cucumber
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
34
+ prerelease: false
35
+ requirement: &id002 !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
39
+ segments:
40
+ - 0
33
41
  version: "0"
34
- version:
42
+ type: :development
43
+ version_requirements: *id002
35
44
  - !ruby/object:Gem::Dependency
36
45
  name: rspec
37
- type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
46
+ prerelease: false
47
+ requirement: &id003 !ruby/object:Gem::Requirement
40
48
  requirements:
41
49
  - - ">="
42
50
  - !ruby/object:Gem::Version
51
+ segments:
52
+ - 0
43
53
  version: "0"
44
- version:
54
+ type: :development
55
+ version_requirements: *id003
45
56
  - !ruby/object:Gem::Dependency
46
57
  name: netrecorder
47
- type: :development
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
58
+ prerelease: false
59
+ requirement: &id004 !ruby/object:Gem::Requirement
50
60
  requirements:
51
61
  - - ">="
52
62
  - !ruby/object:Gem::Version
63
+ segments:
64
+ - 0
53
65
  version: "0"
54
- version:
66
+ type: :development
67
+ version_requirements: *id004
55
68
  description: Ruby bindings for Sorenson 360
56
69
  email: video@sorensonmedia.com
57
70
  executables: []
@@ -74,6 +87,7 @@ extra_rdoc_files:
74
87
  - lib/sorenson/services/flag.rb
75
88
  - lib/sorenson/services/group.rb
76
89
  - lib/sorenson/services/metric.rb
90
+ - lib/sorenson/services/preset.rb
77
91
  - lib/sorenson/services/rate_plan.rb
78
92
  - lib/sorenson/services/site.rb
79
93
  - lib/sorenson/services/subaccount.rb
@@ -125,6 +139,7 @@ files:
125
139
  - lib/sorenson/services/flag.rb
126
140
  - lib/sorenson/services/group.rb
127
141
  - lib/sorenson/services/metric.rb
142
+ - lib/sorenson/services/preset.rb
128
143
  - lib/sorenson/services/rate_plan.rb
129
144
  - lib/sorenson/services/site.rb
130
145
  - lib/sorenson/services/subaccount.rb
@@ -148,18 +163,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
163
  requirements:
149
164
  - - ">="
150
165
  - !ruby/object:Gem::Version
166
+ segments:
167
+ - 0
151
168
  version: "0"
152
- version:
153
169
  required_rubygems_version: !ruby/object:Gem::Requirement
154
170
  requirements:
155
171
  - - ">="
156
172
  - !ruby/object:Gem::Version
173
+ segments:
174
+ - 1
175
+ - 2
157
176
  version: "1.2"
158
- version:
159
177
  requirements: []
160
178
 
161
179
  rubyforge_project: 360_services
162
- rubygems_version: 1.3.5
180
+ rubygems_version: 1.3.6
163
181
  signing_key:
164
182
  specification_version: 3
165
183
  summary: Ruby bindings for Sorenson 360