Class: Shippy::Builder
- Inherits:
-
Object
- Object
- Shippy::Builder
- Defined in:
- lib/shippy/builder.rb
Instance Attribute Summary collapse
-
#archive_path ⇒ Object
readonly
Returns the value of attribute archive_path.
Instance Method Summary collapse
- #archive ⇒ Object
- #cleanup ⇒ Object
- #compile ⇒ Object
-
#initialize(app) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(app) ⇒ Builder
Returns a new instance of Builder.
9 10 11 12 |
# File 'lib/shippy/builder.rb', line 9 def initialize(app) @app = app @archive_path = "/tmp/v#{Time.now.to_i}.tar.gz" end |
Instance Attribute Details
#archive_path ⇒ Object (readonly)
Returns the value of attribute archive_path.
7 8 9 |
# File 'lib/shippy/builder.rb', line 7 def archive_path @archive_path end |
Instance Method Details
#archive ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/shippy/builder.rb', line 18 def archive FileUtils.cd("builds/apps") do File.open(@archive_path, "wb") do |file| zlib = Zlib::GzipWriter.new(file) Minitar.pack(@app.name, zlib) end end @archive_path end |
#cleanup ⇒ Object
28 29 30 |
# File 'lib/shippy/builder.rb', line 28 def cleanup FileUtils.rm_f(@archive_path) end |