duck_puncher 4.3.1 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cbd23d94e9226e4007a4ae66433d07175d3d5db5
4
- data.tar.gz: 78e17b9243c50df9ba3b9e1e6223b912f563ff66
3
+ metadata.gz: 4b2bedc79e336e70d3b4fb60c14b2d80e21928cc
4
+ data.tar.gz: 378563cdbd57904e2ee40d04d03dfc61aa46ccea
5
5
  SHA512:
6
- metadata.gz: eeedcfed8b3b1aaf96bd390d5f5d9df269dfafc9efed2626e8b4e8a889ddfb294cee42260969dccbee2889063181af9def04b6291dc0c374295f312a6148697d
7
- data.tar.gz: 233c693fdd39980861e21d62621c31d838d4c3190edf1d01c4e45d6da53eac1031b9ef6e5c36a4811b7d69cdc95af77268850f52fce61d3672eafeaebc739658
6
+ metadata.gz: 5c546b1afdb926ac913ce522ffd1215540cbc92bc09a48c7dd26a4d832d3a0faaebdf533ab6c12a72e25013b4fd1e9a39e1f842cec95cdbd8b3349d9d8e04360
7
+ data.tar.gz: b00c933d0ac6cc512a1b60a26e8d59c5e030f6aab143c65b35e37eb4a16ed28de58ea273a4525f6e371de72047add75b21dea5ed59c762408bbfa153f5b35d5c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 4.4.0 (12/4/2016)
2
+ =================
3
+
4
+ * Target objects are no longer extended with the [Usable](https://github.com/ridiculous/usable) module
5
+
1
6
  4.3.0 (10/10/2016)
2
7
  ==================
3
8
 
data/duck_puncher.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.required_ruby_version = ">= 2.0.0"
22
22
 
23
- spec.add_runtime_dependency "usable", ">= 1.3"
23
+ spec.add_runtime_dependency "usable", ">= 3.3"
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.3"
26
26
  spec.add_development_dependency "rake", '~> 10.1'
@@ -3,12 +3,15 @@ DuckPuncher.logger = Logger.new(STDOUT).tap do |config|
3
3
  config.level = Logger::ERROR
4
4
  end
5
5
 
6
+ # [Target, Extensions]
6
7
  ducks = [
7
8
  [String, DuckPuncher::Ducks::String],
8
9
  [Enumerable, DuckPuncher::Ducks::Enumerable, {
9
- # Re-include Enumerable in these classes to pick up the new extensions
10
- after: proc {
11
- [Array, Set, Range, Enumerator].each do |k|
10
+ after: proc { |target|
11
+ # Re-include Enumerable in these classes to pick up the new extensions
12
+ hosts = [Array, Set, Range, Enumerator]
13
+ hosts = [target] if hosts.include?(target)
14
+ hosts.each do |k|
12
15
  DuckPuncher.logger.debug("Sending include to #{k} with Enumerable") and k.send(:include, Enumerable)
13
16
  end
14
17
  }
@@ -25,8 +25,9 @@ module DuckPuncher
25
25
  options[:before].call(target) if options[:before]
26
26
  punches = Array(opts[:only] || Ducks::Module.instance_method(:local_methods).bind(mod).call)
27
27
  DuckPuncher.logger.info %Q(#{target}#{" <-- #{mod.name}#{punches}" if punches.any?})
28
- target.extend Usable
29
- target.usable mod, only: opts[:only], method: opts[:method]
28
+ extender = Usable::ModExtender.new(mod, only: options.delete(:only), method: options.delete(:method))
29
+ extender.call target
30
+ extender = nil
30
31
  options[:after].call(target) if options[:after]
31
32
  end
32
33
  targets
@@ -1,3 +1,3 @@
1
1
  module DuckPuncher
2
- VERSION = '4.3.1'.freeze
2
+ VERSION = '4.4.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duck_puncher
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.1
4
+ version: 4.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Buckley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-23 00:00:00.000000000 Z
11
+ date: 2016-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: usable
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '3.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '3.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement