Class: Vx::Builder::Script
- Inherits:
-
Object
- Object
- Vx::Builder::Script
- 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,
lib/vx/builder/script/artifacts.rb
Defined Under Namespace
Classes: Artifacts, Cache, Clojure, Env, Java, Prepare, Ruby, Scala, Script, Services
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Instance Method Summary collapse
- #image ⇒ Object
-
#initialize(task, source) ⇒ Script
constructor
A new instance of Script.
- #to_after_script ⇒ Object
- #to_before_script ⇒ Object
- #to_script ⇒ Object
Constructor Details
#initialize(task, source) ⇒ Script
Returns a new instance of Script.
36 37 38 39 |
# File 'lib/vx/builder/script.rb', line 36 def initialize(task, source) @source = source @task = task end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
34 35 36 |
# File 'lib/vx/builder/script.rb', line 34 def source @source end |
#task ⇒ Object (readonly)
Returns the value of attribute task.
34 35 36 |
# File 'lib/vx/builder/script.rb', line 34 def task @task end |
Instance Method Details
#image ⇒ Object
41 42 43 |
# File 'lib/vx/builder/script.rb', line 41 def image source.image.first end |
#to_after_script ⇒ Object
64 65 66 67 68 69 70 71 |
# File 'lib/vx/builder/script.rb', line 64 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_script ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/vx/builder/script.rb', line 45 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
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/vx/builder/script.rb', line 73 def to_script a = [] a << "\n# script" a += env.script a << "\n# after success" a += env.after_success a.join("\n") end |