streamio 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.8.0 2011-11-22
2
+
3
+ * Player model
4
+ * Playlist model
5
+ * All models got .count action
6
+
1
7
  == 0.7.0 2011-06-17
2
8
 
3
9
  * Upload model
data/README.rdoc CHANGED
@@ -38,8 +38,11 @@ Use it.
38
38
  video.errors # {:file => ["can't be blank"]}
39
39
  video.file = File.new("my_awesome_video.mov")
40
40
  video.save # true
41
+
42
+ Video.count # 23
43
+ Video.count(:tags => "Awesome") # 12
41
44
 
42
- Same principles work for the other availible models (Streamio::Image and Streamio::EncodingProfile).
45
+ Same principles work for the other availible models (Image, EncodingProfile, Player, Playlist and Upload).
43
46
 
44
47
  == More Documentation
45
48
 
data/lib/streamio.rb CHANGED
@@ -6,6 +6,8 @@ require "streamio/version"
6
6
  require "streamio/model"
7
7
  require "streamio/video"
8
8
  require "streamio/image"
9
+ require "streamio/playlist"
10
+ require "streamio/player"
9
11
  require "streamio/encoding_profile"
10
12
  require "streamio/upload"
11
13
 
@@ -44,6 +44,18 @@ module Streamio
44
44
  model
45
45
  end
46
46
 
47
+ # Returns a count of number of models on your account filtered on the parameters your specify.
48
+ #
49
+ # @param [Hash] parameters The parameters will determine the conditions
50
+ # for the count. Refer to Streamio API reference for a list of valid
51
+ # parameters for each of the different models availible.
52
+ #
53
+ # @return [Integer] The number of models found.
54
+ def count(parameters = {})
55
+ sanitize_parameters(parameters)
56
+ JSON.parse(resource["count"].get(:params => parameters))["count"]
57
+ end
58
+
47
59
  def resource_name(name)
48
60
  define_singleton_method(:resource) do
49
61
  RestClient::Resource.new("#{Streamio.authenticated_api_base}/#{name}", :headers => {:accept => :json})
@@ -0,0 +1,8 @@
1
+ module Streamio
2
+ class Player < Model
3
+ resource_name "players"
4
+ creatable_attributes []
5
+ accessable_attributes %w(title tags width height skin loop autoplay enable_rtmp show_title show_play_pause_button show_elapsed_time show_seek_bar show_total_time show_volume_control show_full_screen_button google_analytics_property_id smartclip_preroll_url smartclip_html5_preroll_url playlist limit css)
6
+ readable_attributes %w(id created_at updated_at account_id playlist_ids)
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ module Streamio
2
+ class Playlist < Model
3
+ resource_name "playlists"
4
+ accessable_attributes %w(title tags order_by order_direction)
5
+ readable_attributes %w(id created_at updated_at account_id)
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Streamio
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
data/streamio.gemspec CHANGED
@@ -18,4 +18,5 @@ Gem::Specification.new do |s|
18
18
 
19
19
  s.add_development_dependency("rspec", "~> 2.6.0")
20
20
  s.add_development_dependency("webmock", "~> 1.6.4")
21
+ s.add_development_dependency("rake", "~> 0.9.2")
21
22
  end
metadata CHANGED
@@ -1,77 +1,86 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: streamio
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.0
4
5
  prerelease:
5
- version: 0.7.0
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - David Backeus
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-06-17 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2011-11-28 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: rest-client
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70225441866580 !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
18
+ requirements:
21
19
  - - ~>
22
- - !ruby/object:Gem::Version
20
+ - !ruby/object:Gem::Version
23
21
  version: 1.6.1
24
22
  type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: json
28
23
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70225441866580
25
+ - !ruby/object:Gem::Dependency
26
+ name: json
27
+ requirement: &70225441865500 !ruby/object:Gem::Requirement
30
28
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "1.4"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '1.4'
35
33
  - - <
36
- - !ruby/object:Gem::Version
37
- version: "1.6"
34
+ - !ruby/object:Gem::Version
35
+ version: '1.6'
38
36
  type: :runtime
39
- version_requirements: *id002
40
- - !ruby/object:Gem::Dependency
41
- name: rspec
42
37
  prerelease: false
43
- requirement: &id003 !ruby/object:Gem::Requirement
38
+ version_requirements: *70225441865500
39
+ - !ruby/object:Gem::Dependency
40
+ name: rspec
41
+ requirement: &70225441864700 !ruby/object:Gem::Requirement
44
42
  none: false
45
- requirements:
43
+ requirements:
46
44
  - - ~>
47
- - !ruby/object:Gem::Version
45
+ - !ruby/object:Gem::Version
48
46
  version: 2.6.0
49
47
  type: :development
50
- version_requirements: *id003
51
- - !ruby/object:Gem::Dependency
52
- name: webmock
53
48
  prerelease: false
54
- requirement: &id004 !ruby/object:Gem::Requirement
49
+ version_requirements: *70225441864700
50
+ - !ruby/object:Gem::Dependency
51
+ name: webmock
52
+ requirement: &70225441864100 !ruby/object:Gem::Requirement
55
53
  none: false
56
- requirements:
54
+ requirements:
57
55
  - - ~>
58
- - !ruby/object:Gem::Version
56
+ - !ruby/object:Gem::Version
59
57
  version: 1.6.4
60
58
  type: :development
61
- version_requirements: *id004
59
+ prerelease: false
60
+ version_requirements: *70225441864100
61
+ - !ruby/object:Gem::Dependency
62
+ name: rake
63
+ requirement: &70225441863560 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 0.9.2
69
+ type: :development
70
+ prerelease: false
71
+ version_requirements: *70225441863560
62
72
  description: Ruby wrapper for Streamios API.
63
- email:
73
+ email:
64
74
  - david@streamio.se
65
75
  executables: []
66
-
67
76
  extensions: []
68
-
69
77
  extra_rdoc_files: []
70
-
71
- files:
78
+ files:
72
79
  - lib/streamio/encoding_profile.rb
73
80
  - lib/streamio/image.rb
74
81
  - lib/streamio/model.rb
82
+ - lib/streamio/player.rb
83
+ - lib/streamio/playlist.rb
75
84
  - lib/streamio/upload.rb
76
85
  - lib/streamio/version.rb
77
86
  - lib/streamio/video.rb
@@ -82,31 +91,27 @@ files:
82
91
  - README.rdoc
83
92
  homepage: http://github.com/streamio/streamio-rb
84
93
  licenses: []
85
-
86
94
  post_install_message:
87
95
  rdoc_options: []
88
-
89
- require_paths:
96
+ require_paths:
90
97
  - lib
91
- required_ruby_version: !ruby/object:Gem::Requirement
98
+ required_ruby_version: !ruby/object:Gem::Requirement
92
99
  none: false
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: "0"
97
- required_rubygems_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
105
  none: false
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- version: "0"
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
103
110
  requirements: []
104
-
105
111
  rubyforge_project:
106
- rubygems_version: 1.7.2
112
+ rubygems_version: 1.8.10
107
113
  signing_key:
108
114
  specification_version: 3
109
115
  summary: Ruby wrapper for the Streamio API.
110
116
  test_files: []
111
-
112
117
  has_rdoc: