mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-20 03:36:21 +00:00
fix: deprecar Site#run_in_path #13428
ya no es necesario y Dir.chdir no es concurrente, con lo que nos ahorramos posibles bugs.
This commit is contained in:
parent
491b5f0b3a
commit
b50cca1d75
1 changed files with 4 additions and 14 deletions
|
@ -212,10 +212,8 @@ class Site < ApplicationRecord
|
|||
# Trae los datos del directorio _data dentro del sitio
|
||||
def data
|
||||
unless jekyll.data.present?
|
||||
run_in_path do
|
||||
jekyll.reader.read_data
|
||||
jekyll.data['layouts'] ||= {}
|
||||
end
|
||||
jekyll.reader.read_data
|
||||
jekyll.data['layouts'] ||= {}
|
||||
end
|
||||
|
||||
jekyll.data
|
||||
|
@ -225,9 +223,7 @@ class Site < ApplicationRecord
|
|||
# colecciones.
|
||||
def collections
|
||||
unless @read
|
||||
run_in_path do
|
||||
jekyll.reader.read_collections
|
||||
end
|
||||
jekyll.reader.read_collections
|
||||
|
||||
@read = true
|
||||
end
|
||||
|
@ -322,9 +318,7 @@ class Site < ApplicationRecord
|
|||
#
|
||||
# @return [Hash]
|
||||
def theme_layouts
|
||||
run_in_path do
|
||||
jekyll.reader.read_layouts
|
||||
end
|
||||
jekyll.reader.read_layouts
|
||||
end
|
||||
|
||||
# Trae todos los valores disponibles para un campo
|
||||
|
@ -550,10 +544,6 @@ class Site < ApplicationRecord
|
|||
I18n.t('activerecord.errors.models.site.attributes.design_id.layout_incompatible.error'))
|
||||
end
|
||||
|
||||
def run_in_path(&block)
|
||||
Dir.chdir path, &block
|
||||
end
|
||||
|
||||
# Instala las gemas cuando es necesario:
|
||||
#
|
||||
# * El sitio existe
|
||||
|
|
Loading…
Reference in a new issue