mirror of
https://github.com/cmur2/dyndnsd.git
synced 2025-08-08 18:48:38 +02:00
gem: add solargraph support
This commit is contained in:
@@ -7,10 +7,12 @@ module Dyndnsd
|
||||
|
||||
def_delegators :@db, :[], :[]=, :each, :has_key?
|
||||
|
||||
# @param db_file [String]
|
||||
def initialize(db_file)
|
||||
@db_file = db_file
|
||||
end
|
||||
|
||||
# @return [void]
|
||||
def load
|
||||
if File.file?(@db_file)
|
||||
@db = JSON.parse(File.open(@db_file, 'r', &:read))
|
||||
@@ -20,6 +22,7 @@ module Dyndnsd
|
||||
@db_hash = @db.hash
|
||||
end
|
||||
|
||||
# @return [void]
|
||||
def save
|
||||
Helper.span('database_save') do |_span|
|
||||
File.open(@db_file, 'w') { |f| JSON.dump(@db, f) }
|
||||
@@ -27,6 +30,7 @@ module Dyndnsd
|
||||
end
|
||||
end
|
||||
|
||||
# @return [Boolean]
|
||||
def changed?
|
||||
@db_hash != @db.hash
|
||||
end
|
||||
|
Reference in New Issue
Block a user