compat_resource 12.5.6 → 12.5.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 023e60fae3bb30c80e46dbdb81917e4fe21bcc26
4
- data.tar.gz: 660f1552cf93ff8066d31c01113c3eea57d3f175
3
+ metadata.gz: 25e72c39ecf18932dea010bcf587acf785ccbe8d
4
+ data.tar.gz: e017d091bb638f0e5ee752b1256ed3f930f1c912
5
5
  SHA512:
6
- metadata.gz: e443f906279246ad2b0079ff7528fff2ce380b798496bef5e7f266ba9d70763d7cda990c206c74ec0816e48da4702f1b5327406b556e8277106e189900ca88d8
7
- data.tar.gz: 9762d35f9b5f2c7c4e04ebc72898b1616f6d095bd576e96db392b81ed7e4b6f2d86f8ca06b9b6da1ca8b028b1d13e723b9401951a48728b35d4111fbd7adccf2
6
+ metadata.gz: d33c75da3765cdab6ab48d487b8e4445e7513063e967ee528a845e4220888bce91954140b502edd771346e3c0f5a5847ce622e33c9cf84364e192fce8e31843e
7
+ data.tar.gz: 33d70dd15a3ec91d176a6df06f73f2f0395c09db26ba2217e579c8659cffb99330fafe56dd87492244c6d8319210092c236c87c7fef4d8cf23a08b31bb5f598f
@@ -1,9 +1,30 @@
1
1
  class Chef
2
2
  NOT_PASSED = Object.new if !defined?(NOT_PASSED)
3
3
  # Earlier versions of Chef didn't have this message
4
- if !respond_to?(:log_deprecation)
5
- def self.log_deprecation(message)
6
- Chef::Log.warn(message)
4
+ module ChefCompatDeprecation
5
+ def log_deprecation(message, location=nil)
6
+ if superclass.respond_to?(:log_deprecation)
7
+ if !location
8
+ # Pick the first caller that is *not* part of the Chef or ChefCompat gem,
9
+ # that's the thing the user wrote.
10
+ chef_compat_gem_path = File.expand_path("../../..", __FILE__)
11
+ chef_gem_path = File.expand_path("../..",::Chef::Resource.instance_method(:initialize).source_location[0])
12
+ caller(0..10).each do |c|
13
+ if !c.start_with?(chef_gem_path) && !c.start_with?(chef_compat_gem_path)
14
+ location = c
15
+ break
16
+ end
17
+ end
18
+ end
19
+
20
+ super
21
+ else
22
+ Chef::Log.warn(message)
23
+ end
7
24
  end
8
25
  end
26
+
27
+ class<<self
28
+ prepend ChefCompatDeprecation
29
+ end
9
30
  end
@@ -1,3 +1,3 @@
1
1
  module ChefCompat
2
- VERSION = '12.5.6' if !defined?(VERSION)
2
+ VERSION = '12.5.7' if !defined?(VERSION)
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compat_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.5.6
4
+ version: 12.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-05 00:00:00.000000000 Z
11
+ date: 2015-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake