-
Add
:except
option to filter out unwanted methods -
Require at least Ruby 2.7 and use keyword args for
usable
-
3.9.2 (2/1/2018) =================
-
Fix :only option with superclass methods, allowing them to be removed correctly (#17)
- Fix issue with overriding default usable defined with a block, when mounting with an options hash (#16)
- Add
Usables#include?
to check whether the config has a requested key - Add
Usable::Persistence
module to turn a class/mod into a usable struct backed by a YAML file - Fix bug when calling an unknown attribute on a frozen usable results in an exception (e.g. "can't modify frozen OpenStruct")
- Fix bug in
Usable::Struct
with string vs symbol keys - Add
Usable.define_usable_accessors
to define class level accessors for the underlying usables - Improve
Usable::Struct
to also define class accessors for the usables and behave like a hash with[]
accessors - Add
usables.merge! another: 'hash'
to easily update usables with hashes or other objects that respond to:each
- Fix segfault when extending module that extends self
- Usable modules will extend child modules with Usable and then copy their
usables
over (viaextended
andincluded
hooks) - Slim down files bundled into gem to only core files required
- Update Railtie to always freeze Usable after
Rails.application.eager_load!
- Add
Usable.logger
to help debugging (default level:Logger::ERROR
)
- Fix issue with trying to modify Usable.extended_constants when freezing Usable because it may eager-load subclasses of a class that extends Usable
- NEW - Add Rails setting
usable_config.frozen
to freeze Usable in a after initialize Railtie - NEW - Add inherited hook to copy usable config to subclasses
- FIX - Can marshal Usable configs
- NEW - Track extended modules and constants so they can be eagerloaded and frozen in certain environments
- FIX - Copying usable attributes from a module to class/module works as expected
- NEW - Pass
only: :constants
when mounting a module to import just the constants from a module
- FIX -
Usable::ModExtender
doesn't require the target to be "usable" - NEW -
Usable::Struct(a: :b)
creates value classes with defaults (optionalrequire 'usable/struct'
) - NEW -
usables.merge
converts usables to a hash and merges w/ the other - NEW - Usable::Config#initialize takes a hash to set the initial attributes
- NEW - Usable politely defines
.config(&block)
- FIX -
usables.freeze
to also freeze@spec
so errors are raised when modifying
- Improve performance of reads by defining usable attributes as methods
usables._spec
is nowusables.spec
- Convert +usables+ to a hash with +to_h+
- Multiple mods can be given to +usable+ simultaneously
- The +usables+ method no longer accepts a block (for performance reasons)
- Fix bug in Config#method_missing that was swallowing errors
- Fix bug in scoping Instance and Class method mods to the target module
- Usable config is copied correctly when extending a usable module