Module: RecordStore

Defined in:
lib/record_store.rb,
lib/record_store/cli.rb,
lib/record_store/zone.rb,
lib/record_store/record.rb,
lib/record_store/version.rb,
lib/record_store/provider.rb,
lib/record_store/record/a.rb,
lib/record_store/changeset.rb,
lib/record_store/record/mx.rb,
lib/record_store/record/ns.rb,
lib/record_store/record/spf.rb,
lib/record_store/record/srv.rb,
lib/record_store/record/txt.rb,
lib/record_store/record/aaaa.rb,
lib/record_store/zone/config.rb,
lib/record_store/record/alias.rb,
lib/record_store/record/cname.rb,
lib/record_store/provider/dynect.rb,
lib/record_store/provider/dnsimple.rb,
lib/record_store/zone/yaml_definitions.rb

Defined Under Namespace

Classes: CLI, Changeset, Provider, Record, Zone

Constant Summary collapse

MAXIMUM_REMOVALS =
20
VERSION =
'3.1.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.secrets_pathObject



40
41
42
# File 'lib/record_store.rb', line 40

def secrets_path
  @secrets_path ||= File.expand_path(config.fetch('secrets_path'), File.dirname(config_path))
end

.zones_pathObject



44
45
46
# File 'lib/record_store.rb', line 44

def zones_path
  @zones_path ||= Pathname.new(File.expand_path(config.fetch('zones_path'), File.dirname(config_path))).realpath.to_s
end

Class Method Details

.configObject



57
58
59
# File 'lib/record_store.rb', line 57

def config
  @config ||= YAML.load_file(config_path)
end

.config_pathObject



48
49
50
# File 'lib/record_store.rb', line 48

def config_path
  @config_path ||= File.expand_path('config.yml', Dir.pwd)
end

.config_path=(config_path) ⇒ Object



52
53
54
55
# File 'lib/record_store.rb', line 52

def config_path=(config_path)
  @config = @zones_path = @secrets_path = nil
  @config_path = config_path
end

.defined_zonesObject



61
62
63
# File 'lib/record_store.rb', line 61

def defined_zones
  @defined_zones ||= Zone.all.map(&:name)
end

.expected_zonesObject



65
66
67
# File 'lib/record_store.rb', line 65

def expected_zones
  config.fetch('zones')
end