Module: ThecoreSettings::Dumper

Defined in:
lib/thecore_settings/dumper.rb

Class Method Summary collapse

Class Method Details

.dump(path) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/thecore_settings/dumper.rb', line 3

def self.dump(path)
  ns = {}
  ThecoreSettings::Setting.each do |s|
    ns[s.ns] = {} if ns[s.ns].nil?
    ns[s.ns][s.key] = s.as_yaml
  end
  File.write(path, ns.to_yaml)
end