Class: KuberKit::Shell::Commands::BashCommands
- Defined in:
- lib/kuber_kit/shell/commands/bash_commands.rb
Instance Method Summary collapse
- #cp(shell, source_path, dest_path) ⇒ Object
- #cp_r(shell, source_path, dest_path) ⇒ Object
- #ctime(shell, path) ⇒ Object
- #mkdir(shell, path) ⇒ Object
- #mkdir_p(shell, path) ⇒ Object
- #rm(shell, path) ⇒ Object
- #rm_rf(shell, path) ⇒ Object
Instance Method Details
#cp(shell, source_path, dest_path) ⇒ Object
11 12 13 |
# File 'lib/kuber_kit/shell/commands/bash_commands.rb', line 11 def cp(shell, source_path, dest_path) shell.exec!(%Q{cp "#{source_path}" "#{dest_path}"}, merge_stderr: true) end |
#cp_r(shell, source_path, dest_path) ⇒ Object
15 16 17 |
# File 'lib/kuber_kit/shell/commands/bash_commands.rb', line 15 def cp_r(shell, source_path, dest_path) shell.exec!(%Q{cp -r "#{source_path}" "#{dest_path}"}, merge_stderr: true) end |
#ctime(shell, path) ⇒ Object
27 28 29 30 |
# File 'lib/kuber_kit/shell/commands/bash_commands.rb', line 27 def ctime(shell, path) result = shell.exec!(%Q{date -r "#{path}"}) Time.parse(result) end |
#mkdir(shell, path) ⇒ Object
19 20 21 |
# File 'lib/kuber_kit/shell/commands/bash_commands.rb', line 19 def mkdir(shell, path) shell.exec!(%Q{mkdir "#{path}"}, merge_stderr: true) end |
#mkdir_p(shell, path) ⇒ Object
23 24 25 |
# File 'lib/kuber_kit/shell/commands/bash_commands.rb', line 23 def mkdir_p(shell, path) shell.exec!(%Q{mkdir -p "#{path}"}, merge_stderr: true) end |
#rm(shell, path) ⇒ Object
3 4 5 |
# File 'lib/kuber_kit/shell/commands/bash_commands.rb', line 3 def rm(shell, path) shell.exec!(%Q{rm "#{path}"}, merge_stderr: true) end |
#rm_rf(shell, path) ⇒ Object
7 8 9 |
# File 'lib/kuber_kit/shell/commands/bash_commands.rb', line 7 def rm_rf(shell, path) shell.exec!(%Q{rm -rf "#{path}"}, merge_stderr: true) end |