merrow 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/merrow/configuration.rb +18 -7
- data/lib/merrow/version.rb +2 -2
- data/merrow.gemspec +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: 083ad9adefba5cabb590be7dbf1923af07e6373f
|
4
|
+
data.tar.gz: be58c8c3595968607334418bb72fba283d472fda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65b442de0dcf7fc990702dc45ef3d5fb025582d4c621e75ed593587c9b9fcf1af6151f93f685af8f7f4f1959ad2070cc8aca8ce854217df4a495cd3d88e5e44d
|
7
|
+
data.tar.gz: 88d9181c093a885d97ddd84e5534e06361aadc7c9bbc5aae1ac6d6be2d89ba8c7c55f04a725cf807bb40cdf9438d1ad7532dd7088f09cc3afc4b4d153e0b057e
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# Merrow
|
2
2
|
|
3
3
|
A simple tool to list all the PRs available in certain repositories.
|
4
4
|
Saves you time when you are working on/has to be aware of several projects at the same time.
|
@@ -13,7 +13,7 @@ Install it yourself as:
|
|
13
13
|
|
14
14
|
## Configuration
|
15
15
|
|
16
|
-
|
16
|
+
Merrow reads a list of repositories and an access tocken from the ~/.merrow.yml file.
|
17
17
|
The file looks like this:
|
18
18
|
|
19
19
|
---
|
@@ -24,7 +24,7 @@ repos:
|
|
24
24
|
access_token: mylongaccesstokenwouldbewrittendowninhere
|
25
25
|
|
26
26
|
|
27
|
-
Add as many repos as you want, if you do not know how to make an access token, do not worry about that. Only add your repos,
|
27
|
+
Add as many repos as you want, if you do not know how to make an access token, do not worry about that. Only add your repos, Merrow will generate one and write it down in the config file for you the first time it is executed
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
data/lib/merrow/configuration.rb
CHANGED
@@ -16,23 +16,26 @@ class Configuration
|
|
16
16
|
def repos
|
17
17
|
data["repos"]
|
18
18
|
end
|
19
|
-
|
20
|
-
|
19
|
+
|
20
|
+
|
21
21
|
private
|
22
22
|
|
23
23
|
def create_access_token
|
24
|
-
puts "There is no access token configured in
|
24
|
+
puts "There is no access token configured in Merrow. You need to create one to access your repositories"
|
25
25
|
puts "You will need to provide your username and password. This will be only asked once to create the access token"
|
26
26
|
puts "The username and password will not be stored anywhere"
|
27
27
|
puts "What is your username for Github?"
|
28
28
|
username = gets.chomp
|
29
29
|
puts "What is your password for Github?"
|
30
30
|
password = gets.chomp
|
31
|
-
token_name = "Token used by
|
31
|
+
token_name = "Token used by Merrow"
|
32
32
|
client = Octokit::Client.new login: username, password: password
|
33
33
|
auth = client.create_authorization(scopes: ["repo", "public_repo", "user"], note: token_name)
|
34
34
|
puts "A new token has been created for your user with the name #{auth[:app][:name]}"
|
35
35
|
auth[:token]
|
36
|
+
rescue Octokit::Unauthorized => e
|
37
|
+
puts "Authourization failed, user or password wrong?"
|
38
|
+
exit(-1)
|
36
39
|
end
|
37
40
|
|
38
41
|
def save(data)
|
@@ -47,11 +50,19 @@ class Configuration
|
|
47
50
|
|
48
51
|
def configuration_file
|
49
52
|
config_file = File.join(Dir.home, FILENAME)
|
50
|
-
if File.
|
53
|
+
if File.exist?(config_file)
|
51
54
|
config_file
|
52
55
|
else
|
53
|
-
puts "Config file #{config_file}, not found.
|
54
|
-
|
56
|
+
puts "Config file #{config_file}, not found. You need at least add one repository, what repository are you interested in?"
|
57
|
+
puts "(format is user/repo like rails/rails or JordiPolo/merrow):"
|
58
|
+
repo = gets.chomp
|
59
|
+
if repo.match(/.*\/.*/)
|
60
|
+
File.open(config_file,'w+'){|file| file.write( {repo: [*repo]}.to_yaml)}
|
61
|
+
config_file
|
62
|
+
else
|
63
|
+
puts "Repo format not valid, run the tool again, you need to provide username/reponame like JordiPolo/merrow"
|
64
|
+
exit(-1)
|
65
|
+
end
|
55
66
|
end
|
56
67
|
end
|
57
68
|
end
|
data/lib/merrow/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = "0.0.
|
1
|
+
module Merrow
|
2
|
+
VERSION = "0.0.2"
|
3
3
|
end
|
data/merrow.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'merrow/version'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "merrow"
|
8
|
-
spec.version =
|
8
|
+
spec.version = Merrow::VERSION
|
9
9
|
spec.authors = ["Jordi Polo"]
|
10
10
|
spec.email = ["mumismo@gmail.com"]
|
11
11
|
spec.summary = %q{Small tool to look at all you pending PR in Github.}
|