Class: GitLab::CI::Lint::System

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/ci/lint/system.rb

Instance Method Summary collapse

Instance Method Details

#file_exist?(file, message) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
9
10
# File 'lib/gitlab/ci/lint/system.rb', line 5

def file_exist? file, message
  unless file
    $stderr.puts("#{message}")
    return 1
  end
end

#file_is_readable?(file, message) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
# File 'lib/gitlab/ci/lint/system.rb', line 12

def file_is_readable? file, message
  unless File.readable?(file)
    $stderr.puts("#{message}")
    return 1
  end
end