rubygems-auto-rehash 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,20 +7,26 @@ module Rubygems
7
7
  end
8
8
 
9
9
  auto_rehash = -> installer do
10
- if has_rbenv?
11
- installer.say 'rbenv rehash'
12
- system 'rbenv', 'rehash'
13
- end
10
+ if has_executables?(installer.spec)
11
+ if has_rbenv?
12
+ installer.say 'rbenv rehash'
13
+ system 'rbenv', 'rehash'
14
+ end
14
15
 
15
- if in_zsh?
16
- installer.say 'rehash'
17
- system 'rehash'
16
+ if in_zsh?
17
+ installer.say 'rehash'
18
+ system 'rehash'
19
+ end
18
20
  end
19
21
  end
20
22
 
21
23
  Gem.post_install(&auto_rehash)
22
24
  Gem.post_uninstall(&auto_rehash)
23
25
 
26
+ def has_executables?(spec)
27
+ !spec.executables.empty?
28
+ end
29
+
24
30
  def has_rbenv?
25
31
  ENV['RBENV_ROOT'] || File.exist?(File.expand_path("~/.rbenv")) && `which rbenv`
26
32
  end
@@ -1,7 +1,7 @@
1
1
  module Rubygems
2
2
  module Auto
3
3
  module Rehash
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
7
7
  end
@@ -10,7 +10,6 @@ Gem::Specification.new do |s|
10
10
  s.homepage = ""
11
11
  s.summary = %q{run `rehash' command if rbenv or zsh installed}
12
12
  s.description = %q{run `rehash' command if rbenv or zsh installed}
13
- s.date = "2011-12-13"
14
13
 
15
14
  s.rubyforge_project = "rubygems-auto-rehash"
16
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-auto-rehash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-13 00:00:00.000000000 Z
12
+ date: 2011-12-11 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: run `rehash' command if rbenv or zsh installed
15
15
  email: