Class: Roadworker::Client
- Inherits:
-
Object
- Object
- Roadworker::Client
- Includes:
- Log, Utils::Helper
- Defined in:
- lib/roadworker/client.rb
Instance Method Summary collapse
- #apply(file) ⇒ Object
- #export ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #test(file) ⇒ Object
Methods included from Utils::Helper
Methods included from Log
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 12 13 14 |
# File 'lib/roadworker/client.rb', line 6 def initialize( = {}) @options = OpenStruct.new() @options.logger ||= Logger.new($stdout) Roadworker::StringHelper.colorize = @options.color @options.route53 = Aws::Route53::Client.new @health_checks = HealthCheck.health_checks(@options.route53, :extended => true) @options.health_checks = @health_checks @route53 = Route53Wrapper.new(@options) end |
Instance Method Details
#apply(file) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/roadworker/client.rb', line 16 def apply(file) dsl = load_file(file) updated = false if dsl.hosted_zones.empty? and not @options.force log(:warn, "Nothing is defined (pass `--force` if you want to remove)", :yellow) else updated = walk_hosted_zones(dsl) end if updated and @options.health_check_gc HealthCheck.gc(@options.route53, :logger => @options.logger) end return updated end |