rubygems-auto-rehash 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in rubygems-auto-rehash.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,7 @@
1
+ module Rubygems
2
+ module Auto
3
+ module Rehash
4
+ VERSION = "0.0.1"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,30 @@
1
+ require "rubygems-auto-rehash/version"
2
+
3
+ module Rubygems
4
+ module Auto
5
+ module Rehash; end
6
+ end
7
+ end
8
+
9
+ auto_rehash = -> installer do
10
+ if has_rbenv?
11
+ installer.say 'rbenv rehash'
12
+ system 'rbenv', 'rehash'
13
+
14
+ if in_zsh?
15
+ installer.say 'rehash'
16
+ system 'rehash'
17
+ end
18
+ end
19
+ end
20
+
21
+ Gem.post_install(&auto_rehash)
22
+ Gem.post_uninstall(&auto_rehash)
23
+
24
+ def has_rbenv?
25
+ ENV['RBENV_ROOT'] || File.exist?(File.expand_path("~/.rbenv")) && `which rbenv`
26
+ end
27
+
28
+ def in_zsh?
29
+ ENV.has_key?('SHELL') && /zsh/i === ENV['SHELL']
30
+ end
@@ -0,0 +1,2 @@
1
+ require "rubygems/installer"
2
+ require "rubygems-auto-rehash"
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "rubygems-auto-rehash/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "rubygems-auto-rehash"
7
+ s.version = Rubygems::Auto::Rehash::VERSION
8
+ s.authors = ["aereal"]
9
+ s.email = ["aereal@kerare.org"]
10
+ s.homepage = ""
11
+ s.summary = %q{run `rehash' command if rbenv or zsh installed}
12
+ s.description = %q{run `rehash' command if rbenv or zsh installed}
13
+
14
+ s.rubyforge_project = "rubygems-auto-rehash"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ # specify any dependencies here; for example:
22
+ # s.add_development_dependency "rspec"
23
+ # s.add_runtime_dependency "rest-client"
24
+ end
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubygems-auto-rehash
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - aereal
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-12-11 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: run `rehash' command if rbenv or zsh installed
15
+ email:
16
+ - aereal@kerare.org
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - .gitignore
22
+ - Gemfile
23
+ - Rakefile
24
+ - lib/rubygems-auto-rehash.rb
25
+ - lib/rubygems-auto-rehash/version.rb
26
+ - lib/rubygems_plugin.rb
27
+ - rubygems-auto-rehash.gemspec
28
+ homepage: ''
29
+ licenses: []
30
+ post_install_message:
31
+ rdoc_options: []
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ none: false
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ requirements: []
47
+ rubyforge_project: rubygems-auto-rehash
48
+ rubygems_version: 1.8.12
49
+ signing_key:
50
+ specification_version: 3
51
+ summary: run `rehash' command if rbenv or zsh installed
52
+ test_files: []