Module: Flick::Checker

Defined in:
lib/flick/checker.rb

Class Method Summary collapse

Class Method Details

.action(action) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/flick/checker.rb', line 19

def self.action action
  actions = ["start","stop"]
  unless actions.include? action
    puts "\nPlease specify a valid action #{actions}. e.g. flick <job> -a #{actions.sample} -p ios\n".red
    abort
  end
end

.format(format) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/flick/checker.rb', line 27

def self.format format
  formats = ["mp4","gif"]
  unless formats.include? format
    puts "\nPlease specify a valid format #{formats}. e.g. flick <job> -a stop -p ios -f #{formats.sample}\n".red
    abort
  end
end

.platform(platform) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/flick/checker.rb', line 11

def self.platform platform
  platforms = ["android","ios"]
  unless platforms.include? platform
    puts "\nPlease specify a valid platform #{platforms}. e.g. flick <job> -a start -p #{platforms.sample}\n".red
    abort
  end
end

.system_dependency(dep) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/flick/checker.rb', line 3

def self.system_dependency dep
  program = `which #{dep}`
  if program.empty?
    puts "\n#{dep} was not found. Please ensure you have installed #{dep} and it's in your $PATH\n".red
    abort
  end
end