Class: Conjure::Swap
- Inherits:
-
Object
- Object
- Conjure::Swap
- Defined in:
- lib/conjure/swap.rb
Instance Method Summary collapse
-
#initialize(server) ⇒ Swap
constructor
A new instance of Swap.
- #install ⇒ Object
- #pending_files ⇒ Object
Constructor Details
#initialize(server) ⇒ Swap
3 4 5 |
# File 'lib/conjure/swap.rb', line 3 def initialize(server) @server = server end |
Instance Method Details
#install ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/conjure/swap.rb', line 7 def install if exists? puts "Swap space detected." else puts "Swap space not detected, installing..." @server.run "dd if=/dev/zero of=/root/swapfile bs=4096 count=524288" @server.run "mkswap /root/swapfile; swapon /root/swapfile" puts "Swap space installed." end end |
#pending_files ⇒ Object
18 19 20 |
# File 'lib/conjure/swap.rb', line 18 def pending_files [] end |