merrow 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/Changelog.md +6 -0
- data/lib/merrow/configuration.rb +13 -4
- data/lib/merrow/version.rb +1 -1
- data/merrow.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d26239b80810e27abca70b395d51238ef555904d
|
4
|
+
data.tar.gz: 4dffdbb14e42a8695d0db9e382354845d9afe7c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a5b96f37d347cec213b8915d4fdc5a89cc0e28635ce5a5f669fa5d4cf659b7e4dcd84556cfe50acdff453052fc181701e64eb1a5d4cab898bff34b9d2062c40
|
7
|
+
data.tar.gz: f3a9f89eeb36091a9acaa92fbd930ae5050ec3d485a7e992cb009f2eb74f713af38eaad3cfcc49a6b4fa8e513e9ec129a921c72ce0c37a45222bbbb9dac08a29
|
data/Changelog.md
ADDED
data/lib/merrow/configuration.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#This class manages the configuration in the .merrow.yml file
|
2
2
|
require 'yaml'
|
3
3
|
require 'octokit'
|
4
|
+
require 'io/console'
|
4
5
|
|
5
6
|
class Configuration
|
6
7
|
FILENAME= '.merrow.yml'
|
@@ -14,7 +15,7 @@ class Configuration
|
|
14
15
|
end
|
15
16
|
|
16
17
|
def repos
|
17
|
-
data["repos"]
|
18
|
+
data["repos"] || []
|
18
19
|
end
|
19
20
|
|
20
21
|
|
@@ -26,8 +27,8 @@ class Configuration
|
|
26
27
|
puts "The username and password will not be stored anywhere"
|
27
28
|
puts "What is your username for Github?"
|
28
29
|
username = gets.chomp
|
29
|
-
puts "What is your password for Github?"
|
30
|
-
password = gets.chomp
|
30
|
+
puts "What is your password for Github? (your input is hidden)"
|
31
|
+
password = STDIN.noecho(&:gets).chomp
|
31
32
|
token_name = "Token used by Merrow"
|
32
33
|
client = Octokit::Client.new login: username, password: password
|
33
34
|
auth = client.create_authorization(scopes: ["repo", "public_repo", "user"], note: token_name)
|
@@ -36,6 +37,14 @@ class Configuration
|
|
36
37
|
rescue Octokit::Unauthorized => e
|
37
38
|
puts "Authourization failed, user or password wrong?"
|
38
39
|
exit(-1)
|
40
|
+
rescue Octokit::OneTimePasswordRequired => e
|
41
|
+
puts "Your account requires Two-factor authentication."
|
42
|
+
puts "Provide your two-factor token, you will need this only once (input hidden):"
|
43
|
+
token = STDIN.noecho(&:gets).chomp
|
44
|
+
auth = client.create_authorization(scopes: ["repo", "public_repo", "user"],
|
45
|
+
headers: { "X-GitHub-OTP" => token},
|
46
|
+
note: token_name)
|
47
|
+
auth[:token]
|
39
48
|
end
|
40
49
|
|
41
50
|
def save(data)
|
@@ -57,7 +66,7 @@ class Configuration
|
|
57
66
|
puts "(format is user/repo like rails/rails or JordiPolo/merrow):"
|
58
67
|
repo = gets.chomp
|
59
68
|
if repo.match(/.*\/.*/)
|
60
|
-
File.open(config_file,'w+'){|file| file.write( {
|
69
|
+
File.open(config_file,'w+'){|file| file.write( {repos: [*repo]}.to_yaml)}
|
61
70
|
config_file
|
62
71
|
else
|
63
72
|
puts "Repo format not valid, run the tool again, you need to provide username/reponame like JordiPolo/merrow"
|
data/lib/merrow/version.rb
CHANGED
data/merrow.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["mumismo@gmail.com"]
|
11
11
|
spec.summary = %q{Small tool to look at all you pending PR in Github.}
|
12
12
|
spec.description = %q{Small tool to look at all you pending PR in Github }
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/JordiPolo/merrow"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merrow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordi Polo
|
@@ -75,6 +75,7 @@ extensions: []
|
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
77
|
- ".gitignore"
|
78
|
+
- Changelog.md
|
78
79
|
- Gemfile
|
79
80
|
- LICENSE.txt
|
80
81
|
- README.md
|
@@ -84,7 +85,7 @@ files:
|
|
84
85
|
- lib/merrow/configuration.rb
|
85
86
|
- lib/merrow/version.rb
|
86
87
|
- merrow.gemspec
|
87
|
-
homepage:
|
88
|
+
homepage: https://github.com/JordiPolo/merrow
|
88
89
|
licenses:
|
89
90
|
- MIT
|
90
91
|
metadata: {}
|