soundcloud 0.2.3 → 0.2.4
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/README.md +4 -3
- data/lib/soundcloud.rb +5 -4
- data/lib/soundcloud/version.rb +1 -1
- metadata +4 -30
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Soundcloud API Wrapper
|
2
|
-
##
|
2
|
+
## Description
|
3
3
|
The Soundcloud gem is a thin wrapper for the Soundcloud API based of the httparty gem.
|
4
4
|
It is providing simple methods to handle authorization and to execute HTTP calls.
|
5
5
|
|
@@ -94,8 +94,9 @@ Stores the passed options and try to exchange tokens if no access_token is prese
|
|
94
94
|
- client_id, client_secret, redirect_uri, code is present
|
95
95
|
|
96
96
|
#### Soundcloud#authorize_url(options={})
|
97
|
-
Stores the passed options and return an authorize url.
|
98
|
-
The client_id and redirect_uri options need to present to generate the authorize url.
|
97
|
+
Stores the passed options except for ``state`` and ``display`` and return an authorize url.
|
98
|
+
The ``client_id`` and ``redirect_uri`` options need to present to generate the authorize url.
|
99
|
+
The ``state`` and ``display`` options can be used to set the parameters accordingly in the authorize url.
|
99
100
|
|
100
101
|
#### Soundcloud#get, Soundcloud#post, Soundcloud#put, Soundcloud#delete, Soundcloud#head
|
101
102
|
These methods expose all available HTTP methods. They all share the signature (path_or_uri, query={}, options={}).
|
data/lib/soundcloud.rb
CHANGED
@@ -14,8 +14,7 @@ class Soundcloud
|
|
14
14
|
|
15
15
|
include HTTMultiParty
|
16
16
|
|
17
|
-
|
18
|
-
CLIENT_ID_PARAM_NAME = :consumer_key
|
17
|
+
CLIENT_ID_PARAM_NAME = :client_id
|
19
18
|
API_SUBHOST = 'api'
|
20
19
|
AUTHORIZE_PATH = '/connect'
|
21
20
|
TOKEN_PATH = '/oauth2/token'
|
@@ -39,7 +38,7 @@ class Soundcloud
|
|
39
38
|
def get (path, query={}, options={}); handle_response { self.class.get *construct_query_arguments(path, options.merge(:query => query)) } end
|
40
39
|
def post (path, body={}, options={}); handle_response { self.class.post *construct_query_arguments(path, options.merge(:body => body), :body) } end
|
41
40
|
def put (path, body={}, options={}); handle_response { self.class.put *construct_query_arguments(path, options.merge(:body => body), :body) } end
|
42
|
-
def delete(path, query={}, options={});
|
41
|
+
def delete(path, query={}, options={}); handle_response { self.class.delete *construct_query_arguments(path, options.merge(:query => query)) } end
|
43
42
|
def head (path, query={}, options={}); handle_response { self.class.head *construct_query_arguments(path, options.merge(:query => query)) } end
|
44
43
|
|
45
44
|
# accessors for options
|
@@ -65,9 +64,11 @@ class Soundcloud
|
|
65
64
|
|
66
65
|
def authorize_url(options={})
|
67
66
|
display = options.delete(:display)
|
67
|
+
state = options.delete(:state)
|
68
68
|
store_options(options)
|
69
69
|
url = "https://#{host}#{AUTHORIZE_PATH}?response_type=code_and_token&client_id=#{client_id}&redirect_uri=#{URI.escape redirect_uri}"
|
70
|
-
url << "&display=#{display}" if display
|
70
|
+
url << "&display=#{CGI.escape display}" if display
|
71
|
+
url << "&state=#{CGI.escape state}" if state
|
71
72
|
url
|
72
73
|
end
|
73
74
|
|
data/lib/soundcloud/version.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soundcloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 2
|
8
|
-
- 3
|
9
|
-
version: 0.2.3
|
4
|
+
prerelease:
|
5
|
+
version: 0.2.4
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Johannes Wagener
|
@@ -14,7 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-
|
13
|
+
date: 2011-06-28 00:00:00 +02:00
|
18
14
|
default_executable:
|
19
15
|
dependencies:
|
20
16
|
- !ruby/object:Gem::Dependency
|
@@ -25,10 +21,6 @@ dependencies:
|
|
25
21
|
requirements:
|
26
22
|
- - ~>
|
27
23
|
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 0
|
30
|
-
- 7
|
31
|
-
- 3
|
32
24
|
version: 0.7.3
|
33
25
|
type: :runtime
|
34
26
|
version_requirements: *id001
|
@@ -40,10 +32,6 @@ dependencies:
|
|
40
32
|
requirements:
|
41
33
|
- - ~>
|
42
34
|
- !ruby/object:Gem::Version
|
43
|
-
segments:
|
44
|
-
- 0
|
45
|
-
- 3
|
46
|
-
- 0
|
47
35
|
version: 0.3.0
|
48
36
|
type: :runtime
|
49
37
|
version_requirements: *id002
|
@@ -55,8 +43,6 @@ dependencies:
|
|
55
43
|
requirements:
|
56
44
|
- - ">="
|
57
45
|
- !ruby/object:Gem::Version
|
58
|
-
segments:
|
59
|
-
- 0
|
60
46
|
version: "0"
|
61
47
|
type: :runtime
|
62
48
|
version_requirements: *id003
|
@@ -68,10 +54,6 @@ dependencies:
|
|
68
54
|
requirements:
|
69
55
|
- - ~>
|
70
56
|
- !ruby/object:Gem::Version
|
71
|
-
segments:
|
72
|
-
- 2
|
73
|
-
- 5
|
74
|
-
- 0
|
75
57
|
version: 2.5.0
|
76
58
|
type: :development
|
77
59
|
version_requirements: *id004
|
@@ -83,8 +65,6 @@ dependencies:
|
|
83
65
|
requirements:
|
84
66
|
- - ">="
|
85
67
|
- !ruby/object:Gem::Version
|
86
|
-
segments:
|
87
|
-
- 0
|
88
68
|
version: "0"
|
89
69
|
type: :development
|
90
70
|
version_requirements: *id005
|
@@ -117,23 +97,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
97
|
requirements:
|
118
98
|
- - ">="
|
119
99
|
- !ruby/object:Gem::Version
|
120
|
-
segments:
|
121
|
-
- 0
|
122
100
|
version: "0"
|
123
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
102
|
none: false
|
125
103
|
requirements:
|
126
104
|
- - ">="
|
127
105
|
- !ruby/object:Gem::Version
|
128
|
-
segments:
|
129
|
-
- 1
|
130
|
-
- 3
|
131
|
-
- 6
|
132
106
|
version: 1.3.6
|
133
107
|
requirements: []
|
134
108
|
|
135
109
|
rubyforge_project: soundcloud
|
136
|
-
rubygems_version: 1.
|
110
|
+
rubygems_version: 1.6.2
|
137
111
|
signing_key:
|
138
112
|
specification_version: 3
|
139
113
|
summary: A simple Soundcloud API wrapper
|