makers_toolbelt 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0550cb7a18e908947104a2b0effb194d72cf87c8
4
- data.tar.gz: 26ce84994fba73b9cc764bb7118f9dfd16410ce6
3
+ metadata.gz: 5db714852529340c296b3e477d60997bdb0eaae2
4
+ data.tar.gz: 6eeb92d2416e707edfc7403b9efc7d6a7d3a9479
5
5
  SHA512:
6
- metadata.gz: 0440beb2d5831f3ec6adf6f2524be4165a4bacd0a57b4f89e70ab2e20ede9e9b018b7c4624a111a6f5bfa61dade5fdc4d59c414ca0e09c0b9d32d6d533e3ae57
7
- data.tar.gz: e3d2614f1a92f86b3c15aa32f80c28f1db50286dd084cd09d758db429c4aba5174ad572586de1d14ece4b2b59956305f314ecc0e7df11f5cf3856e7021850cda
6
+ metadata.gz: 9065f2fae4f856f20f7d2c7b163c3eaa8e195552fca263eb5bb20d06e212d1bf4e25f32a95a492bee0287b6a1589225ce575a1bfa9298708406cbac1679006f6
7
+ data.tar.gz: d2d5de3a8a6826a778f739abff5d73a0fdc4941b0d1a76243f046d6bd9259659a3b2de4ee006c0cb9a218373afd73dc6948f213172330e06972a2cd44d98c3a1
@@ -5,6 +5,8 @@ module MakersToolbelt
5
5
  OPEN_SWITCHES = ['-a', '--all', '-o', '--open']
6
6
  CLOSED_SWITCHES = ['-a', '--all', '-c', '--closed']
7
7
 
8
+ GITHUB_REMOTE_REGEX = /github\.com(?::|\/)?(.+\/[\w\-]+)(?:\.git|\/)?\n/
9
+
8
10
  attr_reader :options, :filter
9
11
 
10
12
  def initialize(options = {})
@@ -19,7 +21,6 @@ module MakersToolbelt
19
21
 
20
22
  pulls.flatten!.select! {|p| p.head.repo }
21
23
 
22
- puts pulls
23
24
  pulls.map { |p| [p.head.repo.owner.login, p.head.repo.html_url] }.each do |name, url|
24
25
  puts "adding #{name}"
25
26
  `git remote add #{name} #{url}`
@@ -33,8 +34,10 @@ module MakersToolbelt
33
34
  end
34
35
 
35
36
  def repo_from_remote_path(path)
36
- @regex ||= /\s*(?:Fetch URL: )?(?:https:\/\/|git@)github\.com(?::|\/)?(.*\/.*).git/
37
+ @regex ||= GITHUB_REMOTE_REGEX
37
38
  @regex.match(path).captures.first
39
+ rescue
40
+ fail NotFoundError.new('Could not find remote origin')
38
41
  end
39
42
 
40
43
  def include_open?
@@ -1,2 +1,6 @@
1
1
  require 'yaml'
2
2
  require 'makers_toolbelt/fetch_pull_requests'
3
+
4
+ module MakersToolbelt
5
+ class NotFoundError < StandardError; end
6
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: makers_toolbelt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Forrest