Class: Roadworker::Client
- Inherits:
-
Object
- Object
- Roadworker::Client
- Includes:
- Log
- 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 Log
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
13 14 15 16 17 18 19 20 21 |
# File 'lib/roadworker/client.rb', line 13 def initialize( = {}) = OpenStruct.new() .logger ||= Logger.new($stdout) String.colorize = .color .route53 = AWS::Route53.new @health_checks = HealthCheck.health_checks(.route53, :extended => true) .health_checks = @health_checks @route53 = Route53Wrapper.new() end |
Instance Method Details
#apply(file) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/roadworker/client.rb', line 23 def apply(file) dsl = load_file(file) updated = false if dsl.hosted_zones.empty? and not .force log(:warn, "Nothing is defined (pass `--force` if you want to remove)", :yellow) else AWS.memoize { walk_hosted_zones(dsl) updated = .updated } end if updated and not .no_health_check_gc HealthCheck.gc(.route53, :logger => .logger) end return updated end |
#export ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/roadworker/client.rb', line 43 def export exported = AWS.memoize { @route53.export } if block_given? yield(exported, DSL.method(:convert)) else DSL.convert(exported) end end |
#test(file) ⇒ Object
53 54 55 56 |
# File 'lib/roadworker/client.rb', line 53 def test(file) dsl = load_file(file) DSL.test(dsl, ) end |