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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8ad7147c9e9f4debea198f7bf7e0a38d46b6bea
4
- data.tar.gz: 43a2eb892c3f5e5be2cd3e2761faad1de3e21ce3
3
+ metadata.gz: 083ad9adefba5cabb590be7dbf1923af07e6373f
4
+ data.tar.gz: be58c8c3595968607334418bb72fba283d472fda
5
5
  SHA512:
6
- metadata.gz: 8ca36b4ee2485e53bbdb89ae6006388778f3cbb3e4772463ad36c96695320fe29f98f128ec5896bd2f9391e1ded915ff5e0695aa2f634313a281d4f49fcc17ba
7
- data.tar.gz: 621ac183648734043e29fd9ae72c3cf7869aab35ea27f1ca886e14c46ac89a3f23104e03c8876144578d55157ae612b2a7e6b337851085b32c3fd0bf1b74fe2f
6
+ metadata.gz: 65b442de0dcf7fc990702dc45ef3d5fb025582d4c621e75ed593587c9b9fcf1af6151f93f685af8f7f4f1959ad2070cc8aca8ce854217df4a495cd3d88e5e44d
7
+ data.tar.gz: 88d9181c093a885d97ddd84e5534e06361aadc7c9bbc5aae1ac6d6be2d89ba8c7c55f04a725cf807bb40cdf9438d1ad7532dd7088f09cc3afc4b4d153e0b057e
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Jackal
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
- Jackal reads a list of repositories and an access tocken from the ~/.merrow.yml file.
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, Jackal will generate one and write it down in the config file for you the first time it is executed
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
 
@@ -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 Jackal. You need to create one to access your repositories"
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 Jackal"
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.exists?(config_file)
53
+ if File.exist?(config_file)
51
54
  config_file
52
55
  else
53
- puts "Config file #{config_file}, not found. Please create a configuration file following the instructions in the README"
54
- exit(-1)
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
@@ -1,3 +1,3 @@
1
- module Jackal
2
- VERSION = "0.0.1"
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 = Jackal::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.}
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.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordi Polo