Module: Kernel
- Defined in:
- lib/chefspec/deprecations.rb
Instance Method Summary collapse
-
#deprecated(*messages) ⇒ Object
Kernel extension to print deprecation notices.
Instance Method Details
#deprecated(*messages) ⇒ Object
Kernel extension to print deprecation notices.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/chefspec/deprecations.rb', line 8 def deprecated(*) .each do || calling_spec = caller.find { |line| line =~ %r{(/spec)|(_spec\.rb)} } if calling_spec calling_spec = "spec/" + calling_spec.split("/spec/").last warn "[DEPRECATION] #{} (called from #{calling_spec})" else warn "[DEPRECATION] #{}" end end end |