twitch 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/twitch.rb +9 -9
  2. metadata +61 -43
@@ -16,9 +16,7 @@ class Twitch
16
16
 
17
17
  def getLink
18
18
  scope = ""
19
- @scope.each do |s|
20
- scope += s + " "
21
- end
19
+ @scope.each { |s| scope += s + '+' }
22
20
  link = "https://api.twitch.tv/kraken/oauth2/authorize?response_type=code&client_id=#{@client_id}&redirect_uri=#{@redirect_uri}&scope=#{scope}"
23
21
  end
24
22
 
@@ -194,9 +192,11 @@ class Twitch
194
192
  end
195
193
 
196
194
  def post(url, data)
197
- JSON.parse(Curl.post(url, data).body_str)
198
- c = Curl.post(url, data)
199
- {:body => JSON.parse(c.body_str), :response => c.response_code}
195
+ response_data = Curl.post(url, data)
196
+ {
197
+ :body => JSON.parse(response_data.body_str),
198
+ :response => response_data.response_code
199
+ }
200
200
  end
201
201
 
202
202
  def get(url)
@@ -206,9 +206,9 @@ class Twitch
206
206
 
207
207
  def put(url, data)
208
208
  c = Curl.put(url,data.to_json) do |curl|
209
- curl.headers['Accept'] = 'application/json'
210
- curl.headers['Content-Type'] = 'application/json'
211
- curl.headers['Api-Version'] = '2.2'
209
+ curl.headers['Accept'] = 'application/json'
210
+ curl.headers['Content-Type'] = 'application/json'
211
+ curl.headers['Api-Version'] = '2.2'
212
212
  end
213
213
  {:body => JSON.parse(c.body_str), :response => c.response_code}
214
214
  end
metadata CHANGED
@@ -1,75 +1,93 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: twitch
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
4
5
  prerelease:
5
- version: 0.0.2
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Dustin Lakin
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2013-01-30 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2014-08-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: curb
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
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: !ruby/object:Gem::Requirement
30
25
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "0"
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: json
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
35
38
  type: :runtime
36
- version_requirements: *id002
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rspec
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
37
62
  description: Simplify Twitch's API for Ruby
38
63
  email: dustin.lakin@gmail.com
39
64
  executables: []
40
-
41
65
  extensions: []
42
-
43
66
  extra_rdoc_files: []
44
-
45
- files:
67
+ files:
46
68
  - lib/twitch.rb
47
69
  homepage: https://github.com/dustinlakin/twitch-rb
48
70
  licenses: []
49
-
50
71
  post_install_message:
51
72
  rdoc_options: []
52
-
53
- require_paths:
73
+ require_paths:
54
74
  - lib
55
- required_ruby_version: !ruby/object:Gem::Requirement
75
+ required_ruby_version: !ruby/object:Gem::Requirement
56
76
  none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: "0"
61
- required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ! '>='
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
82
  none: false
63
- requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: "0"
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
67
87
  requirements: []
68
-
69
88
  rubyforge_project:
70
- rubygems_version: 1.8.24
89
+ rubygems_version: 1.8.23
71
90
  signing_key:
72
91
  specification_version: 3
73
92
  summary: Twitch API
74
93
  test_files: []
75
-