Module: Autils

Included in:
AgMultiEditor, DirProjects, FilesHistrory, RubyDebug
Defined in:
lib/a-commons.rb

Instance Method Summary collapse

Instance Method Details

#full_in_path_command(_command = nil) ⇒ Object



418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/a-commons.rb', line 418

def full_in_path_command(_command=nil)
  return nil if _command.nil?
	_ret = nil
	RUBY_PLATFORM.include?('win32') ? _sep = ';':_sep=':'
	ENV['PATH'].split(_sep).each{|_path|
		_file = File.join(_path, _command)
		if FileTest.exist?(_file)
  			_ret = _file
		end
	}
	_ret
end

#is_windows?Boolean

Returns:

  • (Boolean)


431
432
433
434
# File 'lib/a-commons.rb', line 431

def is_windows?
  !(RUBY_PLATFORM =~ /(win|w)32$/).nil?
  #RUBY_PLATFORM.include?('win')
end