Module: Quartz::Validations

Defined in:
lib/quartz/validations.rb

Class Method Summary collapse

Class Method Details

.check_for_goObject



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

def self.check_for_go
  go_exists = ENV['PATH'].split(File::PATH_SEPARATOR).any? do |directory|
    File.exist?(File.join(directory, 'go'))
  end

  raise 'Go not installed' unless go_exists
end

.check_go_quartz_versionObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/quartz/validations.rb', line 11

def self.check_go_quartz_version
  current_pulse = File.read(File.join(File.dirname(__FILE__), '../../go/quartz/quartz.go'))
  installed_pulse = File.read(File.join(ENV['GOPATH'],
                                        'src/github.com/DavidHuie/quartz/go/quartz/quartz.go'))

  if current_pulse != installed_pulse
    STDERR.write <<-EOS
Warning: the version of Quartz in $GOPATH does not match
the version packaged with the gem. Please update the Go
Quartz package.
EOS
  end
end