lib/vx/builder/script_builder/cache.rb in vx-builder-0.5.1 vs lib/vx/builder/script_builder/cache.rb in vx-builder-0.5.2
- old
+ new
@@ -25,17 +25,13 @@
end
private
def enabled?(env)
- env.source.cache.enabled? && !cached_directories(env).empty?
+ env.source.cache.enabled? && !env.cached_directories.empty?
end
- def cached_directories(env)
- env.cached_directories + env.source.cached_directories
- end
-
def casher_cmd
"test -f #{CASHER_BIN} && #{config.casher_ruby} #{CASHER_BIN}"
end
def assign_url_to_env(env)
@@ -79,10 +75,10 @@
urls = env.cache_fetch_url.join(" ")
env.init << "#{casher_cmd} fetch #{urls} || true"
end
def add(env)
- cached_directories(env).each do |d|
+ env.cached_directories.each do |d|
env.init << "#{casher_cmd} add #{d} || true"
end
env.init << "unset CASHER_DIR"
end