Class: Loom::Shell::HarnessBlob
- Inherits:
-
Object
- Object
- Loom::Shell::HarnessBlob
- Defined in:
- lib/loom/shell/harness_blob.rb
Overview
A blob of commands fit for sending to the harness.
Instance Attribute Summary collapse
-
#cmd_blob ⇒ Object
readonly
Returns the value of attribute cmd_blob.
Instance Method Summary collapse
- #checksum ⇒ Object
- #encoded_script ⇒ Object
-
#initialize(cmd_blob) ⇒ HarnessBlob
constructor
A new instance of HarnessBlob.
Constructor Details
#initialize(cmd_blob) ⇒ HarnessBlob
Returns a new instance of HarnessBlob.
9 10 11 |
# File 'lib/loom/shell/harness_blob.rb', line 9 def initialize(cmd_blob) @cmd_blob = cmd_blob end |
Instance Attribute Details
#cmd_blob ⇒ Object (readonly)
Returns the value of attribute cmd_blob.
13 14 15 |
# File 'lib/loom/shell/harness_blob.rb', line 13 def cmd_blob @cmd_blob end |
Instance Method Details
#checksum ⇒ Object
22 23 24 |
# File 'lib/loom/shell/harness_blob.rb', line 22 def checksum Digest::SHA1.hexdigest encoded_script end |
#encoded_script ⇒ Object
15 16 17 18 19 20 |
# File 'lib/loom/shell/harness_blob.rb', line 15 def encoded_script # TODO: Fix this trailing newline hack, it is here to make encoding # consistent with the harness.sh script, which is a bit messy with how it # treats trailing newlines. Base64.encode64(cmd_blob + "\n") end |