Module: Mode::CLI::Helpers

Included in:
Base
Defined in:
lib/mode/cli/helpers.rb

Instance Method Summary collapse

Instance Method Details

#valid_file?(file) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/mode/cli/helpers.rb', line 4

def valid_file?(file)
  !file.nil? && File.exist?(file)
end

#valid_table?(table) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/mode/cli/helpers.rb', line 8

def valid_table?(table)
  table =~ /[\w\d\_\-]+\/[\w\d\_\-]+/
end