Class: Vx::Builder::Script::Cache

Inherits:
Struct
  • Object
show all
Includes:
Helper::Config
Defined in:
lib/vx/builder/script/cache.rb

Constant Summary collapse

CASHER_URL =
"https://raw2.github.com/dima-exe/casher/master/bin/casher"
CASHER_BIN =
"$HOME/.casher/bin/casher"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper::Config

#config

Instance Attribute Details

#appObject

Returns the value of attribute app

Returns:

  • (Object)

    the current value of app



5
6
7
# File 'lib/vx/builder/script/cache.rb', line 5

def app
  @app
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/vx/builder/script/cache.rb', line 12

def call(env)
  rs = app.call env

  if env.task.cache_url_prefix && enabled?(env)
    assign_url_to_env(env)
    prepare(env)
    fetch(env)
    add(env)
    push(env)
  end

  rs
end