Class: Guard::Bosh
- Inherits:
-
Plugin
- Object
- Plugin
- Guard::Bosh
- Defined in:
- lib/guard/bosh.rb,
lib/guard/bosh/notifier.rb,
lib/guard/bosh/job_repository.rb,
lib/guard/bosh/change_assessor.rb,
lib/guard/bosh/package_resolver.rb,
lib/guard/bosh/template_checker.rb,
lib/guard/bosh/network_generator.rb,
lib/guard/bosh/template_renderer.rb,
lib/guard/bosh/apply_specification.rb,
lib/guard/bosh/job_properties_loader.rb,
lib/guard/bosh/global_properties_loader.rb,
lib/guard/bosh/job_default_properties_loader.rb,
lib/guard/bosh/effective_properties_calculator.rb
Overview
Guard BOSH Plugin
Defined Under Namespace
Classes: ApplySpecification, ChangeAssessor, EffectivePropertiesCalculator, GlobalPropertiesLoader, JobDefaultPropertiesLoader, JobPropertiesLoader, JobRepository, NetworkGenerator, Notifier, PackageResolver, TemplateChecker, TemplateRenderer
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Bosh
constructor
A new instance of Bosh.
- #run_all ⇒ Object
-
#run_on_modifications(paths) ⇒ Object
rubocop:disable Metrics/MethodLength.
- #start ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Bosh
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/guard/bosh.rb', line 22 def initialize( = {}) super unless .key?(:deployment_manifest) fail 'Please specify the deployment_manifest in your Guardfile' end @deployment_manifest = Pathname.new([:deployment_manifest]) @change_assessor = [:change_assessor] @job_repository = [:job_repository] @template_checker = [:template_checker] @notifier = [:notifier] end |
Instance Method Details
#run_all ⇒ Object
41 42 43 44 |
# File 'lib/guard/bosh.rb', line 41 def run_all errors = render_all_job_templates notify_errors(errors) end |
#run_on_modifications(paths) ⇒ Object
rubocop:disable Metrics/MethodLength
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/guard/bosh.rb', line 47 def run_on_modifications(paths) change_scope, job_name = @change_assessor.determine_scope(paths) errors = case change_scope when :all reload_deployment_manifest render_all_job_templates when :all_templates_for_job render_templates_for_job( job_name, @job_repository.template_paths(job_name)) when :single_template render_templates_for_job(job_name, paths) end notify_errors(errors) end |