Class: Vx::Builder::Script

Inherits:
Object
  • Object
show all
Includes:
Common::Helper::Middlewares
Defined in:
lib/vx/builder/script.rb,
lib/vx/builder/script/env.rb,
lib/vx/builder/script/java.rb,
lib/vx/builder/script/ruby.rb,
lib/vx/builder/script/cache.rb,
lib/vx/builder/script/scala.rb,
lib/vx/builder/script/script.rb,
lib/vx/builder/script/clojure.rb,
lib/vx/builder/script/prepare.rb,
lib/vx/builder/script/services.rb

Defined Under Namespace

Classes: Cache, Clojure, Env, Java, Prepare, Ruby, Scala, Script, Services

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task, source) ⇒ Script

Returns a new instance of Script.



34
35
36
37
# File 'lib/vx/builder/script.rb', line 34

def initialize(task, source)
  @source = source
  @task   = task
end

Instance Attribute Details

#source ⇒ Object (readonly)

Returns the value of attribute source.



32
33
34
# File 'lib/vx/builder/script.rb', line 32

def source
  @source
end

#task ⇒ Object (readonly)

Returns the value of attribute task.



32
33
34
# File 'lib/vx/builder/script.rb', line 32

def task
  @task
end

Instance Method Details

#image ⇒ Object



39
40
41
# File 'lib/vx/builder/script.rb', line 39

def image
  source.image.first
end

#to_after_script ⇒ Object



62
63
64
65
66
67
# File 'lib/vx/builder/script.rb', line 62

def to_after_script
  a = []
  a << "\n# after script"
  a += env.after_script
  a.join("\n")
end

#to_before_script ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/vx/builder/script.rb', line 43

def to_before_script
  a = []
  a << "\n# init"
  a += env.init

  a << "\n# before install"
  a += env.before_install

  a << "\n# announce"
  a += env.announce

  a << "\n# install"
  a += env.install

  a << "\n# before script"
  a += env.before_script
  a.join("\n")
end

#to_script ⇒ Object



69
70
71
72
73
74
# File 'lib/vx/builder/script.rb', line 69

def to_script
  a = []
  a << "\n# script"
  a += env.script
  a.join("\n")
end