git-pulls 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/git-pulls.rb +9 -2
  2. metadata +2 -2
data/lib/git-pulls.rb CHANGED
@@ -20,7 +20,9 @@ class GitPulls
20
20
 
21
21
  def run
22
22
  configure
23
- if @command && self.respond_to?(@command)
23
+ if not @user
24
+ not_a_github_repository
25
+ elsif @command && self.respond_to?(@command)
24
26
  # If the cache file doesn't exist, make sure we run update
25
27
  # before any other command. git-pulls will otherwise crash
26
28
  # with an exception.
@@ -42,6 +44,10 @@ class GitPulls
42
44
  puts "or call with '-h' for usage information"
43
45
  end
44
46
 
47
+ def not_a_github_repository
48
+ puts "No user informations found. Make sure you're in a Github's repository."
49
+ end
50
+
45
51
  def usage
46
52
  puts <<-USAGE
47
53
  Usage: git pulls update
@@ -284,7 +290,8 @@ Usage: git pulls update
284
290
 
285
291
  def github_insteadof_matching(c, u)
286
292
  first = c.collect {|k,v| [v, /url\.(.*github\.com.*)\.insteadof/.match(k)]}.
287
- find {|v,m| u.index(v) and m != nil}
293
+ find {|v,m| v and u.index(v) and m != nil}
294
+
288
295
  if first
289
296
  return first[0], first[1][1]
290
297
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-pulls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-12-19 00:00:00.000000000 Z
13
+ date: 2013-01-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json