socialcast-git-extensions 3.1.4 → 3.1.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -7,8 +7,10 @@ module Socialcast
|
|
7
7
|
module Github
|
8
8
|
private
|
9
9
|
# request github authorization token
|
10
|
+
# User-Agent is required
|
10
11
|
# store the token in ~/.socialcast/credentials.yml for future reuse
|
11
12
|
# @see http://developer.github.com/v3/oauth/#scopes
|
13
|
+
# @see http://developer.github.com/v3/#user-agent-required
|
12
14
|
def authorization_token
|
13
15
|
credentials = Socialcast.credentials
|
14
16
|
return credentials[:scgitx_token] if credentials[:scgitx_token]
|
@@ -18,7 +20,7 @@ module Socialcast
|
|
18
20
|
password = ask("Github password for #{username}: ") { |q| q.echo = false }
|
19
21
|
|
20
22
|
payload = {:scopes => ['repo'], :note => 'Socialcast Git eXtension', :note_url => 'https://github.com/socialcast/socialcast-git-extensions'}.to_json
|
21
|
-
response = RestClient::Request.new(:url => "https://api.github.com/authorizations", :method => "POST", :user => username, :password => password, :payload => payload, :headers => {:accept => :json, :content_type => :json}).execute
|
23
|
+
response = RestClient::Request.new(:url => "https://api.github.com/authorizations", :method => "POST", :user => username, :password => password, :payload => payload, :headers => {:accept => :json, :content_type => :json, :user_agent => 'socialcast-git-extensions'}).execute
|
22
24
|
data = JSON.parse response.body
|
23
25
|
token = data['token']
|
24
26
|
Socialcast.credentials = credentials.merge(:scgitx_token => token)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socialcast-git-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-05-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: grit
|
@@ -213,18 +213,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
213
213
|
- - ! '>='
|
214
214
|
- !ruby/object:Gem::Version
|
215
215
|
version: '0'
|
216
|
-
segments:
|
217
|
-
- 0
|
218
|
-
hash: 3351449510837020575
|
219
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
217
|
none: false
|
221
218
|
requirements:
|
222
219
|
- - ! '>='
|
223
220
|
- !ruby/object:Gem::Version
|
224
221
|
version: '0'
|
225
|
-
segments:
|
226
|
-
- 0
|
227
|
-
hash: 3351449510837020575
|
228
222
|
requirements: []
|
229
223
|
rubyforge_project: socialcast-git-extensions
|
230
224
|
rubygems_version: 1.8.24
|