rbenv-rehash 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemspec +1 -2
- data/lib/rubygems_plugin.rb +22 -5
- metadata +2 -3
- data/lib/rbenv-rehash.rb +0 -11
data/.gemspec
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
require 'rubygems' unless Object.const_defined?(:Gem)
|
2
|
-
require File.dirname(__FILE__) + "/lib/rbenv-rehash"
|
3
2
|
|
4
3
|
Gem::Specification.new do |s|
|
5
4
|
s.name = "rbenv-rehash"
|
6
|
-
s.version =
|
5
|
+
s.version = '0.2'
|
7
6
|
s.authors = ["Ryan Souza"]
|
8
7
|
s.email = "ryan@ryansouza.net"
|
9
8
|
s.summary = "Rubygems plugin to automatically rehash rbenv"
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -1,12 +1,29 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
|
3
|
+
module RbenvRehash
|
4
|
+
@do_rehash = false
|
5
|
+
|
6
|
+
def self.queue_rehash
|
7
|
+
@do_rehash = true
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.rehash?
|
11
|
+
if @do_rehash
|
12
|
+
system("rbenv rehash")
|
13
|
+
@do_rehash = false
|
14
|
+
return true
|
15
|
+
end
|
16
|
+
|
17
|
+
return false
|
18
|
+
end
|
19
|
+
end
|
5
20
|
|
6
21
|
Gem.post_install { |inst|
|
7
|
-
|
22
|
+
RbenvRehash.queue_rehash unless inst.spec.executables.empty?
|
8
23
|
}
|
9
24
|
|
10
25
|
Gem.post_uninstall { |uninst|
|
11
|
-
|
26
|
+
RbenvRehash.queue_rehash unless uninst.spec.executables.empty?
|
12
27
|
}
|
28
|
+
|
29
|
+
at_exit { RbenvRehash.rehash? }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbenv-rehash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.2'
|
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-09-
|
12
|
+
date: 2011-09-22 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: Rubygems plugin to automatically run 'rbenv rehash' after (un)installing
|
15
15
|
gems with executables
|
@@ -18,7 +18,6 @@ executables: []
|
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
-
- lib/rbenv-rehash.rb
|
22
21
|
- lib/rubygems_plugin.rb
|
23
22
|
- Rakefile
|
24
23
|
- .gemspec
|