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/go.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/clojure.rb,
lib/vx/builder/script_builder/prepare.rb,
lib/vx/builder/script_builder/defaults.rb,
lib/vx/builder/script_builder/services.rb,
lib/vx/builder/script_builder/timeouts.rb

Defined Under Namespace

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task, source) ⇒ ScriptBuilder

Returns a new instance of ScriptBuilder.



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

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

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



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

def source
  @source
end

#taskObject (readonly)

Returns the value of attribute task.



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

def task
  @task
end

Instance Method Details

#imageObject



48
49
50
# File 'lib/vx/builder/script_builder.rb', line 48

def image
  source.image.first
end

#to_after_scriptObject



72
73
74
75
76
77
78
79
80
# File 'lib/vx/builder/script_builder.rb', line 72

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



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/vx/builder/script_builder.rb', line 52

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



82
83
84
85
86
87
88
89
90
91
92
# File 'lib/vx/builder/script_builder.rb', line 82

def to_script
  a = []

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

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

  a.join("\n")
end

#vexorObject



94
95
96
# File 'lib/vx/builder/script_builder.rb', line 94

def vexor
  source.vexor
end