Class: KubsCLI::CLI
- Inherits:
-
Thor
- Object
- Thor
- KubsCLI::CLI
- Defined in:
- lib/kubs_cli/cli.rb
Instance Method Summary collapse
- #copy ⇒ Object
- #git_pull ⇒ Object
- #git_push(message = nil) ⇒ Object
- #git_status ⇒ Object
- #init ⇒ Object
- #install_dependencies ⇒ Object
- #install_packages ⇒ Object
- #pull ⇒ Object
- #version ⇒ Object
Instance Method Details
#copy ⇒ Object
25 26 27 |
# File 'lib/kubs_cli/cli.rb', line 25 def copy run_command { KubsCLI::Copy.new.copy_all } end |
#git_pull ⇒ Object
62 63 64 65 66 |
# File 'lib/kubs_cli/cli.rb', line 62 def git_pull swap_dir { Rake.sh('git pull') } rescue RuntimeError => e KubsCLI.add_error(e: e, msg: 'Ran into an error pulling down your repo') end |
#git_push(message = nil) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/kubs_cli/cli.rb', line 48 def git_push( = nil) ||= 'auto push files' swap_dir do Rake.sh('git add -A') Rake.sh("git commit -m \"#{}\"") Rake.sh('git push') rescue RuntimeError => e KubsCLI.add_error(e: e, msg: 'Something went wrong pushing your repo') end end |
#git_status ⇒ Object
69 70 71 |
# File 'lib/kubs_cli/cli.rb', line 69 def git_status swap_dir { Rake.sh('git status') } end |
#init ⇒ Object
18 19 20 21 |
# File 'lib/kubs_cli/cli.rb', line 18 def init puts "Adding .kubs to #{Dir.home}..." KubsCLI.create_config_dir end |
#install_dependencies ⇒ Object
36 37 38 39 |
# File 'lib/kubs_cli/cli.rb', line 36 def install_dependencies run_command { KubsCLI::Install.new.install_dependencies } Rake.sh('echo "Restart your shell"') end |
#install_packages ⇒ Object
42 43 44 |
# File 'lib/kubs_cli/cli.rb', line 42 def install_packages run_command { KubsCLI::Install.new.install_packages } end |