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 75ea8b1c..b8885509 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')) @@ -138,7 +138,7 @@ class DeployLocal < Deploy end def bundle(output: false) - 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 fb790fe8..754f9df1 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