Skip to content

Releases: Betterment/uncruft

v0.4.0

02 Jan 22:54
b8bc9a7
Compare
Choose a tag to compare
Version 0.4.0

v0.3.1

26 Apr 21:18
531119f
Compare
Choose a tag to compare

Fixed

  • Some ruby warnings included gem paths that weren't being normalized by the
    regex matchers
  • Some ruby warnings included both gem paths and absolute paths and we were
    only normalizing one but not the other
  • Fixed some rubocop linter rules

A new `deprecate_attribute` helper!

29 Oct 18:23
cf694ed
Compare
Choose a tag to compare

If you would like to deprecate an attribute by applying a ActiveSupport::Deprecation warning on the deprecated attribute's getters and setters then look no further, we have a tool for that! Simply include Uncruft::Deprecatable in your class, identify the attribute you would like deprecated and provide a message you would like applied to the deprecation warning.

class Customer
  include Uncruft::Deprecatable
  attr_accessor :first_name
  def initialize(first_name)
    @first_name = first_name
  end
  deprecate_attribute(:first_name,
                      message: "Please stop using first_name it is deprecated, please use legal_first_name instead!")
end

Within the Uncruft::Deprecatable module there is also a .deprecate_method method that can be used to apply a deprecation warning to an identified method, much like the deprecate_attribute method described above.

From there you can use Uncruft's deprecation recording tools to generate ingorefiles and manage your deprecation backlog in an organized manner.