Module: Zonesync

Defined in:
lib/zonesync.rb,
lib/zonesync/cli.rb,
lib/zonesync/diff.rb,
lib/zonesync/http.rb,
lib/zonesync/record.rb,
lib/zonesync/version.rb,
lib/zonesync/provider.rb,
lib/zonesync/zonefile.rb,
lib/zonesync/cloudflare.rb

Defined Under Namespace

Modules: Zonefile Classes: CLI, Cloudflare, Diff, Filesystem, Generate, HTTP, Memory, Provider, Record, Sync

Constant Summary collapse

VERSION =
"0.7.0"

Class Method Summary collapse

Class Method Details

.call(zonefile: "Zonefile", credentials: default_credentials, dry_run: false) ⇒ Object



8
9
10
# File 'lib/zonesync.rb', line 8

def self.call zonefile: "Zonefile", credentials: default_credentials, dry_run: false
  Sync.new({ provider: "Filesystem", path: zonefile }, credentials).call(dry_run: dry_run)
end

.default_credentialsObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/zonesync.rb', line 16

def self.default_credentials
  require "active_support"
  require "active_support/encrypted_configuration"
  require "active_support/core_ext/hash/keys"
  ActiveSupport::EncryptedConfiguration.new(
    config_path: "config/credentials.yml.enc",
    key_path: "config/master.key",
    env_key: "RAILS_MASTER_KEY",
    raise_if_missing_key: true,
  ).zonesync
end

.default_providerObject



28
29
30
# File 'lib/zonesync.rb', line 28

def self.default_provider
  Provider.from(default_credentials)
end

.generate(zonefile: "Zonefile", credentials: default_credentials) ⇒ Object



12
13
14
# File 'lib/zonesync.rb', line 12

def self.generate zonefile: "Zonefile", credentials: default_credentials
  Generate.new({ provider: "Filesystem", path: zonefile }, credentials).call
end