audiosocket 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ require "autotest/restart"
2
+
3
+ Autotest.add_hook :initialize do |at|
4
+ at.testlib = "minitest/autorun"
5
+ end
@@ -0,0 +1,3 @@
1
+ === 0.0.0 / 2010-05-12
2
+
3
+ * Birthday!
data/Isolate ADDED
@@ -0,0 +1,7 @@
1
+ gem "configlet", "~> 1.2"
2
+ gem "rest-client", "~> 1.5"
3
+
4
+ env :development do
5
+ gem "fakeweb", "~> 1.2"
6
+ gem "minitest", "~> 1.6"
7
+ end
@@ -0,0 +1,9 @@
1
+ .autotest
2
+ CHANGELOG.rdoc
3
+ Isolate
4
+ Manifest.txt
5
+ README.rdoc
6
+ Rakefile
7
+ bin/audiosocket
8
+ lib/audiosocket.rb
9
+ test/test_audiosocket.rb
@@ -0,0 +1,38 @@
1
+ = Audiosocket Ruby Client
2
+
3
+ * http://github.com/audiosocket/ruby-client
4
+
5
+ == Description
6
+
7
+ Access to Audiosocket's music and media management API.
8
+
9
+ == Examples
10
+
11
+ FIX (code sample of usage)
12
+
13
+ == Installation
14
+
15
+ $ gem install audiosocket
16
+
17
+ == License
18
+
19
+ Copyright 2010 Audiosocket (it@audiosocket.com)
20
+
21
+ Permission is hereby granted, free of charge, to any person obtaining
22
+ a copy of this software and associated documentation files (the
23
+ 'Software'), to deal in the Software without restriction, including
24
+ without limitation the rights to use, copy, modify, merge, publish,
25
+ distribute, sublicense, and/or sell copies of the Software, and to
26
+ permit persons to whom the Software is furnished to do so, subject to
27
+ the following conditions:
28
+
29
+ The above copyright notice and this permission notice shall be
30
+ included in all copies or substantial portions of the Software.
31
+
32
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
33
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
35
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
36
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
37
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
38
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,12 @@
1
+ require "hoe"
2
+
3
+ Hoe.plugin :doofus, :git, :isolate
4
+
5
+ Hoe.spec "audiosocket" do
6
+ developer "Audiosocket", "it@audiosocket.com"
7
+
8
+ self.extra_rdoc_files = Dir["*.rdoc"]
9
+ self.history_file = "CHANGELOG.rdoc"
10
+ self.readme_file = "README.rdoc"
11
+ self.testlib = :minitest
12
+ end
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ abort "you need to write me"
@@ -0,0 +1,48 @@
1
+ require "configlet"
2
+ require "rest_client"
3
+
4
+ module Audiosocket
5
+ extend Configlet
6
+
7
+ # Duh.
8
+
9
+ VERSION = "0.0.0"
10
+
11
+ config :audiosocket do
12
+ default :token => "no-token-provided"
13
+ default :url => "http://audiosocket.com/api/v3"
14
+ end
15
+
16
+ RestClient.add_before_execution_proc do |req, params|
17
+ if params[:url].include? self[:url]
18
+ req["X-Audiosocket-Token"] = self[:token]
19
+ end
20
+
21
+ p :req => req, :params => params
22
+ end
23
+
24
+ def self.delete url, headers = {}, &block
25
+ RestClient.delete maybe_prefix(url), headers, &block
26
+ end
27
+
28
+ def self.get url, headers = {}, &block
29
+ RestClient.get maybe_prefix(url), headers, &block
30
+ end
31
+
32
+ def self.head url, headers = {}, &block
33
+ RestClient.head maybe_prefix(url), headers, &block
34
+ end
35
+
36
+ def self.post url, payload, headers = {}, &block
37
+ RestClient.post maybe_prefix(url), payload, headers, &block
38
+ end
39
+
40
+ def self.put url, payload, headers = {}, &block
41
+ RestClient.put maybe_prefix(url), payload, headers, &block
42
+ end
43
+
44
+ def self.maybe_prefix url #:nodoc:
45
+ return url if /^http/ =~ url
46
+ File.join self[:url], url
47
+ end
48
+ end
@@ -0,0 +1,10 @@
1
+ require "isolate/now"
2
+ require "minitest/autorun"
3
+ require "audiosocket"
4
+
5
+ class TestAudiosocket < MiniTest::Unit::TestCase
6
+ def test_self_config_defaults
7
+ assert_equal "no-token-provided", Audiosocket[:token]
8
+ assert_equal URI.parse("http://audiosocket.com/api/v3"), Audiosocket[:url]
9
+ end
10
+ end
metadata ADDED
@@ -0,0 +1,170 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: audiosocket
3
+ version: !ruby/object:Gem::Version
4
+ hash: 31
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 0
10
+ version: 0.0.0
11
+ platform: ruby
12
+ authors:
13
+ - Audiosocket
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-05-12 00:00:00 -07:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: configlet
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 11
30
+ segments:
31
+ - 1
32
+ - 2
33
+ version: "1.2"
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: rest-client
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ hash: 5
45
+ segments:
46
+ - 1
47
+ - 5
48
+ version: "1.5"
49
+ type: :runtime
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: rubyforge
53
+ prerelease: false
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ hash: 9
60
+ segments:
61
+ - 2
62
+ - 0
63
+ - 3
64
+ version: 2.0.3
65
+ type: :development
66
+ version_requirements: *id003
67
+ - !ruby/object:Gem::Dependency
68
+ name: fakeweb
69
+ prerelease: false
70
+ requirement: &id004 !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ hash: 11
76
+ segments:
77
+ - 1
78
+ - 2
79
+ version: "1.2"
80
+ type: :development
81
+ version_requirements: *id004
82
+ - !ruby/object:Gem::Dependency
83
+ name: minitest
84
+ prerelease: false
85
+ requirement: &id005 !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ~>
89
+ - !ruby/object:Gem::Version
90
+ hash: 3
91
+ segments:
92
+ - 1
93
+ - 6
94
+ version: "1.6"
95
+ type: :development
96
+ version_requirements: *id005
97
+ - !ruby/object:Gem::Dependency
98
+ name: hoe
99
+ prerelease: false
100
+ requirement: &id006 !ruby/object:Gem::Requirement
101
+ none: false
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ hash: 23
106
+ segments:
107
+ - 2
108
+ - 6
109
+ - 0
110
+ version: 2.6.0
111
+ type: :development
112
+ version_requirements: *id006
113
+ description: Access to Audiosocket's music and media management API.
114
+ email:
115
+ - it@audiosocket.com
116
+ executables:
117
+ - audiosocket
118
+ extensions: []
119
+
120
+ extra_rdoc_files:
121
+ - Manifest.txt
122
+ - CHANGELOG.rdoc
123
+ - README.rdoc
124
+ files:
125
+ - .autotest
126
+ - CHANGELOG.rdoc
127
+ - Isolate
128
+ - Manifest.txt
129
+ - README.rdoc
130
+ - Rakefile
131
+ - bin/audiosocket
132
+ - lib/audiosocket.rb
133
+ - test/test_audiosocket.rb
134
+ has_rdoc: true
135
+ homepage: http://github.com/audiosocket/ruby-client
136
+ licenses: []
137
+
138
+ post_install_message:
139
+ rdoc_options:
140
+ - --main
141
+ - README.rdoc
142
+ require_paths:
143
+ - lib
144
+ required_ruby_version: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ hash: 3
150
+ segments:
151
+ - 0
152
+ version: "0"
153
+ required_rubygems_version: !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ hash: 3
159
+ segments:
160
+ - 0
161
+ version: "0"
162
+ requirements: []
163
+
164
+ rubyforge_project: audiosocket
165
+ rubygems_version: 1.3.7.pre.1
166
+ signing_key:
167
+ specification_version: 3
168
+ summary: Access to Audiosocket's music and media management API.
169
+ test_files:
170
+ - test/test_audiosocket.rb