Class: AppUtils

Inherits:
Object
  • Object
show all
Defined in:
lib/gito/app_utils.rb

Class Method Summary collapse

Class Method Details

.execute(command, should_exit = true) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/gito/app_utils.rb', line 5

def self.execute(command, should_exit=true)
  is_success = system command
  unless is_success
    puts "\n\n======================================================\n\n"
    puts ' Something went wrong while executing this:'.red
    puts "  $ #{command}\n".yellow
    puts "======================================================\n"
    exit 1 if should_exit
  end
end

.is_folder?(path) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/gito/app_utils.rb', line 16

def self.is_folder? (path)
  File.directory?(path)
end