gem_patching 0.0.1

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.
Files changed (2) hide show
  1. data/lib/gem_patching.rb +12 -0
  2. metadata +62 -0
@@ -0,0 +1,12 @@
1
+ require 'rubygems'
2
+
3
+ module Gem
4
+ def self.patching(gem_name, targeted_gem_version, &block)
5
+ active_gem = Gem.loaded_specs[gem_name]
6
+ if active_gem && active_gem.version.to_s != targeted_gem_version
7
+ raise "Attempt to apply patch targeting version '#{targeted_gem_version}' of '#{gem_name}', but active version is '#{active_gem.version}'"
8
+ else
9
+ yield if block_given?
10
+ end
11
+ end
12
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gem_patching
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Ingo Weiss
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-06-10 00:00:00 +02:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: gem_patching provides a mechanism for marking code as a patch for a specific version of a gem in order to get notified when that gem is updated
22
+ email: ingo@ingoweiss.com
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files: []
28
+
29
+ files:
30
+ - lib/gem_patching.rb
31
+ has_rdoc: true
32
+ homepage: http://github.com/ingoweiss/gem_patching
33
+ licenses: []
34
+
35
+ post_install_message:
36
+ rdoc_options: []
37
+
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ segments:
52
+ - 0
53
+ version: "0"
54
+ requirements: []
55
+
56
+ rubyforge_project:
57
+ rubygems_version: 1.3.6
58
+ signing_key:
59
+ specification_version: 3
60
+ summary: Better management of patches for specific versions of other gems
61
+ test_files: []
62
+