Class: CypressRails::FindsBin

Inherits:
Object
  • Object
show all
Defined in:
lib/cypress-rails/finds_bin.rb

Constant Summary collapse

LOCAL_PATH =
"node_modules/.bin/cypress"

Instance Method Summary collapse

Instance Method Details

#call(cypress_dir = Dir.pwd) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/cypress-rails/finds_bin.rb', line 7

def call(cypress_dir = Dir.pwd)
  local_path = Pathname.new(cypress_dir).join(LOCAL_PATH)
  if File.exist?(local_path)
    local_path
  else
    "cypress"
  end
end