fast_github 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/lib/fast_github.rb +6 -4
- data/lib/fast_github/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f174197a8dfb99d6e6d8e3684e07a414ac2d9d4
|
4
|
+
data.tar.gz: 0686458e0b9a586b32247482f2e7dd3f76d5db68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fec99bbb8209cba289dd9009f5f80e94b1cce31e8d3797af75ba36d91928e994b45c0da6e423f5cb3a098a59980003b13f635fd2902256d8ac38c7c0eaec06f3
|
7
|
+
data.tar.gz: 1a2fd197526d866f8997c4842d547af9e63a2da939e5f381b3722974dba74f7386e1738bda3e252524867149a2dabab04f1f448947c616944fa641bc8264d692
|
data/.gitignore
CHANGED
data/lib/fast_github.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require "fast_github/version"
|
2
|
+
require "io/console"
|
2
3
|
require "net/http"
|
3
4
|
require "uri"
|
4
5
|
require "json"
|
6
|
+
require 'yaml'
|
5
7
|
|
6
8
|
module FastGithub
|
7
9
|
class Auth
|
@@ -45,12 +47,12 @@ module FastGithub
|
|
45
47
|
print "Enter your Github username: "
|
46
48
|
user = gets.chomp
|
47
49
|
print "Enter your Github password: "
|
48
|
-
pass = gets.chomp
|
50
|
+
pass = STDIN.noecho(&:gets).chomp
|
51
|
+
puts ""
|
49
52
|
request.basic_auth(user.chomp, pass.chomp)
|
50
|
-
|
51
|
-
request.body = { "client_secret" => secret, "scopes" => [ "repo" ] }.to_json
|
53
|
+
request.body = { "client_secret" => "2e05ca092118ef4df3c5089717a0bf8cfe1192f1", "scopes" => [ "repo" ] }.to_json
|
52
54
|
response = http.request(request)
|
53
|
-
if response.code == 200 || response.code == 201
|
55
|
+
if response.code == "200" || response.code == "201"
|
54
56
|
json_response = JSON.parse(response.body)
|
55
57
|
save_oath(json_response['token'])
|
56
58
|
@token = json_response['token']
|
data/lib/fast_github/version.rb
CHANGED