All commits by Rob Yurkowski unless otherwise noted.
-
Extracts command behaviour to
Skywalker::Callable
andSkywalker::Transactional
.This simplifies the
Command
object, making it basically a combination ofCallable
andTransactional
mixins. It also allows for the reuse of the constituent parts on a larger scale. -
Remove dependency on
ActiveRecord
.We now do a check to see if ActiveRecord is defined. If not, we simply default to calling the passed block. This allows us to avoid having to require ActiveRecord, which lightens our dependencies and also makes us feel just a tiny bit less dirty.
-
Yields self to any block given to any object implementing
Skywalker::Acceptable
.This has a few ramifications; first, it allows some easy extension simply by passing a block to the constructor, as such:
a = MyObject.new(an_argument: :foo) { |instance| instance.an_argument = :bar } a.an_argument # => :bar
More importantly, it allows for simpler subclassing:
class MyCommand < Skywalker::Command def initialize(*args) super do a_symbol = :new_symbol end end end
- Refactors guts of commands to extract kwarg instantiation pattern into
Acceptable
module. - Improves inline documentation.
- Loosen restrictions on ActiveRecord version.
- Fix a bug where callbacks would be called even if they were nil.
- Add
required_args
, which allows marking certain attributes as required at initialization. Defaults to an empty list. - Add testing section of README.
- Add example files.
- Expanded documentation.
- Allow
on_success
andon_failure
callbacks to be optional. - Allow passing arbitrary values to command instantiation.
- Adds this changelog.
- Initial creation.