Class: Vx::Builder::ScriptBuilderV2::Base

Inherits:
Struct
  • Object
show all
Defined in:
lib/vx/builder/script_builder_v2/base.rb

Direct Known Subclasses

Cache, Clojure, Defaults, Deploy, Env, Go, Java, Nodejs, Python, Ruby, Rust, Scala, Services

Instance Attribute Summary collapse

Instance Method Summary collapse

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_builder_v2/base.rb', line 5

def app
  @app
end

Instance Method Details

#deploy?(env) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/vx/builder/script_builder_v2/base.rb', line 59

def deploy?(env)
  env.source.deploy_modules?
end

#do_after_deploy(env) ⇒ Object



53
54
55
56
57
# File 'lib/vx/builder/script_builder_v2/base.rb', line 53

def do_after_deploy(env)
  if deploy?(env)
    yield
  end
end

#do_before_deploy(env) ⇒ Object



47
48
49
50
51
# File 'lib/vx/builder/script_builder_v2/base.rb', line 47

def do_before_deploy(env)
  if deploy?(env)
    yield
  end
end

#do_before_script(env) ⇒ Object



29
30
31
32
33
# File 'lib/vx/builder/script_builder_v2/base.rb', line 29

def do_before_script(env)
  if env.source.before_script.empty? && !deploy?(env)
    yield
  end
end

#do_cache_key(env) {|env.cache_key| ... } ⇒ Object

Yields:



7
8
9
# File 'lib/vx/builder/script_builder_v2/base.rb', line 7

def do_cache_key(env)
  yield env.cache_key
end

#do_cached_directories(env) ⇒ Object



11
12
13
14
15
# File 'lib/vx/builder/script_builder_v2/base.rb', line 11

def do_cached_directories(env)
  if env.source.cached_directories != false
    yield env.source.cached_directories
  end
end

#do_database(env) ⇒ Object



35
36
37
38
39
# File 'lib/vx/builder/script_builder_v2/base.rb', line 35

def do_database(env)
  if env.source.database.empty? && env.source.database?
    yield
  end
end

#do_deploy_script(env) ⇒ Object



41
42
43
44
45
# File 'lib/vx/builder/script_builder_v2/base.rb', line 41

def do_deploy_script(env)
  if deploy?(env)
    yield
  end
end

#do_install(env) ⇒ Object



23
24
25
26
27
# File 'lib/vx/builder/script_builder_v2/base.rb', line 23

def do_install(env)
  if env.source.install.empty?
    yield
  end
end

#do_script(env) ⇒ Object



17
18
19
20
21
# File 'lib/vx/builder/script_builder_v2/base.rb', line 17

def do_script(env)
  if env.source.script.empty? && !env.source.deploy_modules?
    yield
  end
end