From 907f9b8bc699e36a14282ab85b5bbc1aa92df0df Mon Sep 17 00:00:00 2001 From: f Date: Sat, 13 May 2023 17:41:00 -0300 Subject: [PATCH] BREAKING CHANGE: deprecar Deploy#gems_dir por Site#bundle_path #13428 --- app/models/deploy.rb | 5 ----- app/models/deploy_local.rb | 4 ++-- app/models/site.rb | 5 +++++ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/deploy.rb b/app/models/deploy.rb index a92708c0..573fe2f0 100644 --- a/app/models/deploy.rb +++ b/app/models/deploy.rb @@ -50,11 +50,6 @@ class Deploy < ApplicationRecord site.path end - # XXX: Ver DeployLocal#bundle - def gems_dir - @gems_dir ||= Rails.root.join('_storage', 'gems', site.name) - end - # Corre un comando, lo registra en la base de datos y devuelve el # estado. # diff --git a/app/models/deploy_local.rb b/app/models/deploy_local.rb index d3d81d9a..ec583bb0 100644 --- a/app/models/deploy_local.rb +++ b/app/models/deploy_local.rb @@ -55,7 +55,7 @@ class DeployLocal < Deploy # # @return [nil] def cleanup! - FileUtils.rm_rf(gems_dir) + FileUtils.rm_rf(site.bundle_path) FileUtils.rm_rf(yarn_cache_dir) FileUtils.rm_rf(File.join(site.path, 'node_modules')) FileUtils.rm_rf(File.join(site.path, '.sass-cache')) @@ -141,7 +141,7 @@ class DeployLocal < Deploy # XXX: Desde que ya no compartimos el directorio de gemas, tenemos # que hacer limpieza después de instalar. - run %(bundle install --deployment --no-cache --path="#{gems_dir}" --clean --without test development), output: output + run %(bundle install --deployment --no-cache --path="#{site.bundle_path}" --clean --without test development), output: output end def jekyll_build(output: false) diff --git a/app/models/site.rb b/app/models/site.rb index c6a57830..eda37905 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -453,6 +453,11 @@ class Site < ApplicationRecord @docs = nil end + # @return [Pathname] + def bundle_path + @bundle_path ||= Rails.root.join('_storage', 'gems', name) + end + private # Asegurarse que el sitio tenga una llave privada