Module: Applitools::EyesUniversal::UniversalServerGemFinder

Extended by:
UniversalServerGemFinder
Included in:
UniversalServerGemFinder
Defined in:
lib/applitools/eyes_universal/executable_finder.rb

Constant Summary collapse

SERVER_GEM_NAME =
'eyes_universal'

Instance Method Summary collapse

Instance Method Details

#executable_filepathObject



18
19
20
21
22
23
24
# File 'lib/applitools/eyes_universal/executable_finder.rb', line 18

def executable_filepath
  raise 'Universal server not Found' if server_lib.nil?
  return filepath if valid_file?(filepath)
  core_path = other_filepaths.find {|path| valid_file?(path) }
  return core_path if core_path
  raise 'Universal server unrecognized'
end

#filepathObject



9
10
11
# File 'lib/applitools/eyes_universal/executable_finder.rb', line 9

def filepath
  server_lib ? File.join(server_lib.gem_dir, 'ext', 'eyes-universal', filename) : ''
end

#other_filepathsObject



13
14
15
16
# File 'lib/applitools/eyes_universal/executable_finder.rb', line 13

def other_filepaths
  in_gem_path = File.join('gems', server_lib.full_name, 'ext', 'eyes-universal', filename)
  Gem.path.map {|path| File.expand_path(in_gem_path, path) }
end