Class: Kompo::Fs

Inherits:
Object
  • Object
show all
Defined in:
lib/kompo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFs

Returns a new instance of Fs.



398
399
400
401
# File 'lib/kompo.rb', line 398

def initialize
  @komop_cli = local_komop_cli || ENV['KOMPO_CLI']
  @lib_kompo_dir = local_lib_kompo_dir || ENV['LIB_KOMPO_DIR']
end

Instance Attribute Details

#komop_cliObject (readonly)

Returns the value of attribute komop_cli.



396
397
398
# File 'lib/kompo.rb', line 396

def komop_cli
  @komop_cli
end

#lib_kompo_dirObject (readonly)

Returns the value of attribute lib_kompo_dir.



396
397
398
# File 'lib/kompo.rb', line 396

def lib_kompo_dir
  @lib_kompo_dir
end

Instance Method Details

#local_komop_cliObject



403
404
405
406
407
408
409
410
411
412
# File 'lib/kompo.rb', line 403

def local_komop_cli
  return nil if `which brew`.empty?

  path = `brew --prefix kompo-vfs`.chomp + '/bin/kompo-cli'
  if File.exist?(path)
    path
  else
    nil
  end
end

#local_lib_kompo_dirObject



414
415
416
417
418
419
420
421
422
423
# File 'lib/kompo.rb', line 414

def local_lib_kompo_dir
  return nil if `which brew`.empty?

  path = `brew --prefix kompo-vfs`.chomp + '/lib'
  if File.exist?(path)
    path
  else
    nil
  end
end