summaryrefslogtreecommitdiff
path: root/lib/declarative_policy/runner.rb
Commit message (Collapse)AuthorAgeFilesLines
* Enable more frozen string in lib/**/*.rbgfyoung2018-10-061-0/+2
| | | | | | | | | | | | | Enables frozen for the following: * lib/*.rb * lib/banzai/**/*.rb * lib/bitbucket/**/*.rb * lib/constraints/**/*.rb * lib/container_registry/**/*.rb * lib/declarative_policy/**/*.rb Partially addresses #47424.
* Resolve Naming/UncommunicativeMethodLin Jen-Shin2018-07-091-1/+1
|
* Resolve "Make a Rubocop that forbids returning from a block"🙈 jacopo beschi 🙉2018-04-181-1/+1
|
* Adds Rubocop rule for line break after guard clauseJacopo2017-11-161-0/+1
| | | | Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
* Speed up DeclarativePolicy::Runner#steps_by_scoreSean McGivern2017-10-041-11/+20
| | | | | | | | | | | | | | | There were a couple of things here: 1. If the state was already enabled, we don't need to check all the remaining steps - only those that can prevent the state. (An enable followed by an enable is a no-op.) This logic is in `#run`, but we still did the work of scoring and sorting the steps. 2. The sorting is known to be inefficient, but we can make it slightly more efficient by stopping once we have a step with zero score, as that means it's free. Neither of these make this _fast_, especially when called lots of times - as we do when there is lots of activity on an issue - but they do help some.
* more eagerly bail when the state is preventedhttp://jneen.net/2017-08-071-4/+3
|
* reduce iterations by keeping a count of remaining enablershttp://jneen.net/2017-08-071-1/+4
| | | | | rather than iterating the whole remaining step set with .all?(&:prevent?)
* add a new DeclarativePolicy frameworkhttp://jneen.net/2017-06-271-0/+181