Class: Vx::Builder::ScriptBuilder

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

Defined Under Namespace

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task, source) ⇒ ScriptBuilder

Returns a new instance of ScriptBuilder.



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

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

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



37
38
39
# File 'lib/vx/builder/script_builder.rb', line 37

def source
  @source
end

#taskObject (readonly)

Returns the value of attribute task.



37
38
39
# File 'lib/vx/builder/script_builder.rb', line 37

def task
  @task
end

Instance Method Details

#imageObject



44
45
46
# File 'lib/vx/builder/script_builder.rb', line 44

def image
  source.image.first
end

#to_after_scriptObject



68
69
70
71
72
73
74
75
76
# File 'lib/vx/builder/script_builder.rb', line 68

def to_after_script
  a = []
  a << "\n# after script init"
  a += env.after_script_init

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

#to_before_scriptObject



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/vx/builder/script_builder.rb', line 48

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_scriptObject



78
79
80
81
82
83
84
85
86
87
88
# File 'lib/vx/builder/script_builder.rb', line 78

def to_script
  a = []

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

  a << "\n# after success"
  a += env.after_success

  a.join("\n")
end

#vexorObject



90
91
92
# File 'lib/vx/builder/script_builder.rb', line 90

def vexor
  source.vexor
end