Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove the aasm dependency #14

Closed
wants to merge 1 commit into from
Closed

Conversation

yurivm
Copy link

@yurivm yurivm commented Feb 9, 2016

Hi,
first of all, thanks for the gem! I've noticed there was an issue open about AASM being the single dependency and how nice it would be to have none.
So I went ahead and removed it - the circuit_breaker doesn't have a lot of states or complex transitions, nor does it require a lot of callbacks or saving state via ActiveRecord.

I've kept the backwards compatibility by raising AASM::InvalidTransition if that exception is defined, but the check is cached, not sure if that affects performance.

Other than that, rspec was throwing a lot of warnings about the .should syntax so I went ahead and updated those to expect(..).

Thanks for taking a look!

@wsargent
Copy link
Owner

Thanks! I'm a little busy right now, but will take a closer look this weekend.

@emerleite
Copy link

Any news on this?

@frutik
Copy link

frutik commented Aug 2, 2016

(Y)

@yurivm
Copy link
Author

yurivm commented Aug 2, 2016

just rebased, @wsargent could you have a look?

@wsargent
Copy link
Owner

wsargent commented Aug 2, 2016

@yurivm okay, thanks!

@hellvinz
Copy link

👍

@victorhazbun
Copy link

@yurivm can you please fix the conflicts?

@wsargent wsargent self-requested a review July 23, 2018 16:57
@@ -59,8 +59,7 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = ["History.txt", "README.txt"]
s.rdoc_options = ["--main", "README.txt", "--charset=UTF-8"]

s.add_runtime_dependency "aasm"

s.add_development_dependency "aasm"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to only include dev deps in the gemspec when required to run tests. I'm thinking the tests should be run with asm and without, and the 'with' can be achieved using a BUNDLE_GEMFILE and eval_gemfile, or use the 'appraisals' gem

aasm.state :open

aasm.state :closed, :enter => :reset_failure_count
def trip
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine this is equivalent to what is generated by

aasm.event :trip do
    transitions :to => :open, :from => [:closed, :half_open]
eend

transitions :to => :closed, :from => [:open, :half_open]
# if AASM is required elsewhere it will call this method to get current state
def aasm(_)
OpenStruct.new(current_state: @state)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you may mean def aasm(*)

@bf4
Copy link

bf4 commented Dec 17, 2018

Other than that, rspec was throwing a lot of warnings about the .should syntax so I went ahead and updated those to expect(..).

should probably be its own commit

@bf4 bf4 mentioned this pull request Dec 17, 2018
@yurivm
Copy link
Author

yurivm commented Dec 17, 2018

It's been almost 3 years since I opened the original PR, so at this point I can't really remember what I did there or why - closing in favor of #22

@yurivm yurivm closed this Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants