mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 01:21:42 +00:00
no guardar el valor de saved en la configuracion
This commit is contained in:
parent
3a4f3918cf
commit
cb9fcfdfd8
1 changed files with 4 additions and 4 deletions
|
@ -8,7 +8,7 @@ class Site
|
|||
# Iniciar el OpenStruct con el sitio
|
||||
super(site: site)
|
||||
|
||||
self.saved = File.exist? path
|
||||
@saved = File.exist? path
|
||||
|
||||
read
|
||||
end
|
||||
|
@ -33,8 +33,8 @@ class Site
|
|||
def write
|
||||
return if persisted?
|
||||
|
||||
self.saved = Site::Writer.new(site: site, file: path,
|
||||
content: content.to_yaml).save
|
||||
@saved = Site::Writer.new(site: site, file: path,
|
||||
content: content.to_yaml).save
|
||||
# Actualizar el hash para no escribir dos veces
|
||||
@hash = content.hash
|
||||
end
|
||||
|
@ -42,7 +42,7 @@ class Site
|
|||
|
||||
# Detecta si la configuración cambió comparando con el valor inicial
|
||||
def persisted?
|
||||
(@hash == content.hash) && saved
|
||||
(@hash == content.hash) && @saved
|
||||
end
|
||||
|
||||
# Obtener el contenido de la configuración como un hash, sin el
|
||||
|
|
Loading…
Reference in a new issue