brewbygems 0.2.0 → 0.3.0

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
data/brewbygems.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{brewbygems}
8
- s.version = "0.2.0"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andre Arko"]
12
- s.date = %q{2009-12-07}
12
+ s.date = %q{2010-01-25}
13
13
  s.description = %q{Adds RubyGems post-install and post-uninstall hooks to update Homebrew bin/ symlinks}
14
14
  s.email = %q{andre@arko.net}
15
15
  s.extra_rdoc_files = [
@@ -1,11 +1,21 @@
1
1
  Gem::post_install do |installer|
2
+ cellar_glob = File.join(`brew --prefix`.chomp, "Cellar/*")
3
+ # Augh RubyGems why is installer.gem_home a Pathname here
4
+ installing_to_cellar = Pathname.new(installer.gem_home).fnmatch(cellar_glob)
5
+ has_binary = installer.spec.executables.any?
6
+
2
7
  unless system("brew link gems")
3
8
  puts "brewbygems: Sorry, you don't seem to have Homebrew installed."
4
- end if installer.spec.executables.any?
9
+ end if has_binary && installing_to_cellar
5
10
  end
6
11
 
7
12
  Gem::post_uninstall do |installer|
13
+ cellar_glob = File.join(`brew --prefix`.chomp, "Cellar/*")
14
+ # Augh RubyGems why is installer.gem_home a String here
15
+ installing_to_cellar = Pathname.new(installer.gem_home).fnmatch(cellar_glob)
16
+ has_binary = installer.spec.executables.any?
17
+
8
18
  unless system("brew prune")
9
19
  puts "brewbygems: Sorry, you don't seem to have Homebrew installed."
10
- end if installer.spec.executables.any?
20
+ end if has_binary && installing_to_cellar
11
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brewbygems
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andre Arko
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-07 00:00:00 -08:00
12
+ date: 2010-01-25 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15