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/caa.rb,
lib/record_store/record/ptr.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/provider/ns1.rb,
lib/record_store/record/alias.rb,
lib/record_store/record/cname.rb,
lib/record_store/record/sshfp.rb,
lib/record_store/provider/dnsimple.rb,
lib/record_store/provider/cloudflare.rb,
lib/record_store/provider/ns1/client.rb,
lib/record_store/zone/yaml_definitions.rb,
lib/record_store/provider/google_cloud_dns.rb,
lib/record_store/provider/oracle_cloud_dns.rb,
lib/record_store/zone/config/ignore_pattern.rb,
lib/record_store/zone/config/implicit_record_template.rb,
lib/record_store/provider/dynect.rb

Defined Under Namespace

Classes: CLI, Changeset, Provider, Record, Zone

Constant Summary collapse

MAXIMUM_REMOVALS =
20
VERSION =
'8.0.5'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.implicit_records_templates_pathObject



67
68
69
70
71
72
73
74
# File 'lib/record_store.rb', line 67

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

.secrets_pathObject



50
51
52
# File 'lib/record_store.rb', line 50

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

.zones_pathObject



54
55
56
57
58
59
60
61
# File 'lib/record_store.rb', line 54

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



82
83
84
# File 'lib/record_store.rb', line 82

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

.config_pathObject



63
64
65
# File 'lib/record_store.rb', line 63

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

.config_path=(config_path) ⇒ Object



76
77
78
79
80
# File 'lib/record_store.rb', line 76

def config_path=(config_path)
  @config = @zones_path = @secrets_path = nil
  @config_path = config_path
  Zone.reset
end

.defined_zonesObject



86
87
88
# File 'lib/record_store.rb', line 86

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

.expected_zonesObject



90
91
92
# File 'lib/record_store.rb', line 90

def expected_zones
  config.fetch('zones')
end