Class: Abak::Flow::Repository
- Inherits:
-
Object
- Object
- Abak::Flow::Repository
- Extended by:
- Forwardable
- Includes:
- Ruler
- Defined in:
- lib/abak-flow/repository.rb
Defined Under Namespace
Classes: Remote
Constant Summary collapse
- REMOTES =
[:origin, :upstream].freeze
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #display_name ⇒ Object
-
#initialize(manager) ⇒ Repository
constructor
A new instance of Repository.
- #ready? ⇒ Boolean
Constructor Details
#initialize(manager) ⇒ Repository
Returns a new instance of Repository.
17 18 19 20 21 22 |
# File 'lib/abak-flow/repository.rb', line 17 def initialize(manager) @manager = manager @errors = [] configure! end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
15 16 17 |
# File 'lib/abak-flow/repository.rb', line 15 def errors @errors end |
Instance Method Details
#display_name ⇒ Object
38 39 40 |
# File 'lib/abak-flow/repository.rb', line 38 def display_name I18n.t("repository.name") end |
#ready? ⇒ Boolean
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/abak-flow/repository.rb', line 24 def ready? @errors = [] multi_ruleset do fact(:origin_not_setup) { origin.nil? } fact(:upstream_not_setup) { upstream.nil? } rule([:origin_not_setup]) { @errors << I18n.t("repository.errors.origin_not_setup") } rule([:upstream_not_setup]) { @errors << I18n.t("repository.errors.upstream_not_setup") } end @errors.empty? ? true : false end |