brewbygems 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,11 +4,6 @@ brewbygems
4
4
  Brewbygems is a RubyGems plugin that adds post-install and post-uninstall
5
5
  hooks to RubyGems that update the symlinks in your Homebrew /bin/. Yay.
6
6
 
7
- Todo
8
- ----
9
-
10
- Use the Gem::Installer instance to only run link or prune when the gem has files in bin/
11
-
12
7
  Requirements
13
8
  ------------
14
9
 
data/Rakefile CHANGED
@@ -1,15 +1,2 @@
1
- begin
2
- require 'jeweler'
3
- Jeweler::Tasks.new do |gem|
4
- gem.name = "brewbygems"
5
- gem.summary = "Makes sure RubyGems plays nice with Homebrew"
6
- gem.description = "Adds RubyGems post-install and post-uninstall hooks to update Homebrew bin/ symlinks"
7
-
8
- gem.authors = ["Andre Arko"]
9
- gem.email = "andre@arko.net"
10
- gem.homepage = "http://github.com/indirect/brewbygems"
11
- end
12
- Jeweler::GemcutterTasks.new
13
- rescue LoadError
14
- puts "Jeweler not available. Install it with: gem install jeweler"
15
- end
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -1,42 +1,31 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
1
  # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "brewbygems/version"
5
4
 
6
5
  Gem::Specification.new do |s|
7
6
  s.name = %q{brewbygems}
8
- s.version = "0.3.1"
7
+ s.version = Brewbygems::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Andre Arko"]
12
- s.date = %q{2010-01-26}
10
+ s.authors = ["André Arko"]
11
+ s.date = %q{2010-11-05}
12
+ s.summary = %q{Makes sure RubyGems plays nice with Homebrew}
13
13
  s.description = %q{Adds RubyGems post-install and post-uninstall hooks to update Homebrew bin/ symlinks}
14
- s.email = %q{andre@arko.net}
15
- s.extra_rdoc_files = [
16
- "README.md"
17
- ]
14
+ s.email = %q{andre@arko.net}
15
+ s.homepage = %q{http://github.com/indirect/brewbygems}
16
+
17
+ s.rubyforge_project = "brewbygems"
18
+
18
19
  s.files = [
19
- ".gitignore",
20
- "README.md",
21
- "Rakefile",
22
- "VERSION",
23
- "brewbygems.gemspec",
24
- "lib/rubygems_plugin.rb"
20
+ "brewbygems.gemspec",
21
+ "lib/brewbygems.rb",
22
+ "lib/brewbygems/version.rb",
23
+ "lib/rubygems_plugin.rb",
24
+ "Rakefile",
25
+ "README.md"
25
26
  ]
26
- s.homepage = %q{http://github.com/indirect/brewbygems}
27
- s.rdoc_options = ["--charset=UTF-8"]
28
27
  s.require_paths = ["lib"]
29
- s.rubygems_version = %q{1.3.5}
30
- s.summary = %q{Makes sure RubyGems plays nice with Homebrew}
31
-
32
- if s.respond_to? :specification_version then
33
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
34
- s.specification_version = 3
35
28
 
36
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
37
- else
38
- end
39
- else
40
- end
29
+ s.add_development_dependency "bundler", "~>1.0"
41
30
  end
42
31
 
@@ -0,0 +1,46 @@
1
+ module Brewbygems
2
+ class << self
3
+ attr_accessor :loaded_version
4
+
5
+ def link
6
+ puts "brewbygems: running command `brew link gems`" if Gem.configuration.verbose == 1
7
+ system("brew link gems #{silence}")
8
+ end
9
+
10
+ def prune
11
+ puts "brewbygems: running command `brew prune`" if Gem.configuration.verbose == 1
12
+ system("brew prune #{silence}")
13
+ end
14
+
15
+ private
16
+
17
+ def silence
18
+ Gem.configuration.verbose == 1 ? "" : "> /dev/null"
19
+ end
20
+
21
+ end
22
+ end
23
+
24
+ Gem::post_install do |installer|
25
+ cellar = File.join(`brew --prefix`.chomp, "Cellar")
26
+ # Augh RubyGems why is installer.gem_home a String here
27
+ installing_to_cellar = installer.gem_home.to_s.include?(cellar)
28
+ has_binary = installer.spec.executables.any?
29
+
30
+ if has_binary && installing_to_cellar
31
+ success = Brewbygems.link
32
+ puts "brewbygems: Sorry, you don't seem to have Homebrew installed." unless success
33
+ end
34
+ end
35
+
36
+ Gem::post_uninstall do |installer|
37
+ cellar = File.join(`brew --prefix`.chomp, "Cellar")
38
+ # Augh RubyGems why is installer.gem_home a String here
39
+ installing_to_cellar = installer.gem_home.to_s.include?(cellar)
40
+ has_binary = installer.spec.executables.any?
41
+
42
+ if has_binary && installing_to_cellar
43
+ success = Brewbygems.prune
44
+ puts "brewbygems: Sorry, you don't seem to have Homebrew installed." unless success
45
+ end
46
+ end
@@ -0,0 +1,3 @@
1
+ module Brewbygems
2
+ VERSION = "0.4.0"
3
+ end
@@ -1,21 +1,7 @@
1
- Gem::post_install do |installer|
2
- cellar = File.join(`brew --prefix`.chomp, "Cellar")
3
- # Augh RubyGems why is installer.gem_home a Pathname here
4
- installing_to_cellar = installer.gem_home.to_s.include?(cellar)
5
- has_binary = installer.spec.executables.any?
1
+ this_version = "0.4.0"
2
+ loaded_version = defined?(Brewbygems) && Gem::Version.new(Brewbygems.loaded_version)
6
3
 
7
- unless system("brew link gems")
8
- puts "brewbygems: Sorry, you don't seem to have Homebrew installed."
9
- end if has_binary && installing_to_cellar
4
+ unless loaded_version && loaded_version > Gem::Version.new(this_version)
5
+ require File.expand_path('../brewbygems', __FILE__)
6
+ Brewbygems.loaded_version = this_version
10
7
  end
11
-
12
- Gem::post_uninstall do |installer|
13
- cellar = File.join(`brew --prefix`.chomp, "Cellar")
14
- # Augh RubyGems why is installer.gem_home a String here
15
- installing_to_cellar = installer.gem_home.to_s.include?(cellar)
16
- has_binary = installer.spec.executables.any?
17
-
18
- unless system("brew prune")
19
- puts "brewbygems: Sorry, you don't seem to have Homebrew installed."
20
- end if has_binary && installing_to_cellar
21
- end
metadata CHANGED
@@ -1,58 +1,84 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brewbygems
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ hash: 15
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
5
11
  platform: ruby
6
12
  authors:
7
- - Andre Arko
13
+ - "Andr\xC3\xA9 Arko"
8
14
  autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-01-26 00:00:00 -08:00
18
+ date: 2010-11-05 00:00:00 -07:00
13
19
  default_executable:
14
- dependencies: []
15
-
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: bundler
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 15
30
+ segments:
31
+ - 1
32
+ - 0
33
+ version: "1.0"
34
+ type: :development
35
+ version_requirements: *id001
16
36
  description: Adds RubyGems post-install and post-uninstall hooks to update Homebrew bin/ symlinks
17
37
  email: andre@arko.net
18
38
  executables: []
19
39
 
20
40
  extensions: []
21
41
 
22
- extra_rdoc_files:
23
- - README.md
42
+ extra_rdoc_files: []
43
+
24
44
  files:
25
- - .gitignore
26
- - README.md
27
- - Rakefile
28
- - VERSION
29
45
  - brewbygems.gemspec
46
+ - lib/brewbygems.rb
47
+ - lib/brewbygems/version.rb
30
48
  - lib/rubygems_plugin.rb
49
+ - Rakefile
50
+ - README.md
31
51
  has_rdoc: true
32
52
  homepage: http://github.com/indirect/brewbygems
33
53
  licenses: []
34
54
 
35
55
  post_install_message:
36
- rdoc_options:
37
- - --charset=UTF-8
56
+ rdoc_options: []
57
+
38
58
  require_paths:
39
59
  - lib
40
60
  required_ruby_version: !ruby/object:Gem::Requirement
61
+ none: false
41
62
  requirements:
42
63
  - - ">="
43
64
  - !ruby/object:Gem::Version
65
+ hash: 3
66
+ segments:
67
+ - 0
44
68
  version: "0"
45
- version:
46
69
  required_rubygems_version: !ruby/object:Gem::Requirement
70
+ none: false
47
71
  requirements:
48
72
  - - ">="
49
73
  - !ruby/object:Gem::Version
74
+ hash: 3
75
+ segments:
76
+ - 0
50
77
  version: "0"
51
- version:
52
78
  requirements: []
53
79
 
54
- rubyforge_project:
55
- rubygems_version: 1.3.5
80
+ rubyforge_project: brewbygems
81
+ rubygems_version: 1.3.7
56
82
  signing_key:
57
83
  specification_version: 3
58
84
  summary: Makes sure RubyGems plays nice with Homebrew
data/.gitignore DELETED
@@ -1 +0,0 @@
1
- pkg/
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.3.1