Class: ZeroDeploy::Processor
- Inherits:
-
Object
- Object
- ZeroDeploy::Processor
- Defined in:
- lib/zero_deploy/processor.rb
Instance Attribute Summary collapse
-
#time_spent ⇒ Object
readonly
Returns the value of attribute time_spent.
Instance Method Summary collapse
- #assets_precompile ⇒ Object
- #bundle_install ⇒ Object
- #checkout_code ⇒ Object
- #finalize ⇒ Object
-
#initialize(cmd) ⇒ Processor
constructor
A new instance of Processor.
- #run_migrations ⇒ Object
Constructor Details
#initialize(cmd) ⇒ Processor
Returns a new instance of Processor.
7 8 9 10 |
# File 'lib/zero_deploy/processor.rb', line 7 def initialize(cmd) @cmd = cmd @time_spent = 0 end |
Instance Attribute Details
#time_spent ⇒ Object (readonly)
Returns the value of attribute time_spent.
5 6 7 |
# File 'lib/zero_deploy/processor.rb', line 5 def time_spent @time_spent end |
Instance Method Details
#assets_precompile ⇒ Object
22 23 24 25 |
# File 'lib/zero_deploy/processor.rb', line 22 def assets_precompile action "Running: rake assets:precompile" action "Asset precompilation completed (0.0000001s)" end |
#bundle_install ⇒ Object
16 17 18 19 20 |
# File 'lib/zero_deploy/processor.rb', line 16 def bundle_install action "Installing dependencies using Bundler version 1.4.13" action "Running: bundle install --without development:test:jokes" action "Your bundle is complete! It was installed into ./vendor/bundle" end |
#checkout_code ⇒ Object
12 13 14 |
# File 'lib/zero_deploy/processor.rb', line 12 def checkout_code action "Checkout fresh source code" end |
#finalize ⇒ Object
32 33 34 35 |
# File 'lib/zero_deploy/processor.rb', line 32 def finalize deploy = fork { Open3.popen3(@cmd) } Process.detach(deploy) end |
#run_migrations ⇒ Object
27 28 29 30 |
# File 'lib/zero_deploy/processor.rb', line 27 def run_migrations action "Executing deploy:migrate" action "No pending migrations" end |