Module: Sabre::Base
- Included in:
- Command
- Defined in:
- lib/sabre/base.rb
Instance Method Summary collapse
- #cd(directory) ⇒ Object
- #cp(source, target) ⇒ Object
- #echo(string) ⇒ Object
- #mv(source, target) ⇒ Object
- #set(name, value) ⇒ Object
- #synchronize ⇒ Object
Instance Method Details
#cd(directory) ⇒ Object
6 7 8 |
# File 'lib/sabre/base.rb', line 6 def cd(directory) run %{ cd "#{ directory }" } end |
#cp(source, target) ⇒ Object
10 11 12 |
# File 'lib/sabre/base.rb', line 10 def cp(source, target) run %{ cp -R "#{ source }" "#{ target }" } end |
#echo(string) ⇒ Object
2 3 4 |
# File 'lib/sabre/base.rb', line 2 def echo(string) run %{ echo "#{ string }" } end |
#mv(source, target) ⇒ Object
14 15 16 |
# File 'lib/sabre/base.rb', line 14 def mv(source, target) run %{ mv "#{ source }" "#{ target }" } end |
#set(name, value) ⇒ Object
18 19 20 |
# File 'lib/sabre/base.rb', line 18 def set(name, value) run %{ #{ name }="#{ value }" } end |
#synchronize ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/sabre/base.rb', line 22 def synchronize run %{ read -n1 -p "Continue? (y/n) " && echo && [[ $REPLY == "y" ]] } end |