Class: Xray::Config

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

Constant Summary collapse

CONFIG_FILE =
".xrayconfig"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#editorObject

Returns the value of attribute editor.



8
9
10
# File 'lib/xray/config.rb', line 8

def editor
  @editor
end

Instance Method Details

#config_fileObject



36
37
38
39
40
41
42
# File 'lib/xray/config.rb', line 36

def config_file
  if File.exists?("#{Dir.pwd}/#{CONFIG_FILE}")
    "#{Dir.pwd}/#{CONFIG_FILE}"
  else
    "#{Dir.home}/#{CONFIG_FILE}"
  end
end

#default_editorObject



12
13
14
15
16
17
# File 'lib/xray/config.rb', line 12

def default_editor
  ENV['GEM_EDITOR'] ||
    ENV['VISUAL'] ||
    ENV['EDITOR'] ||
    '/usr/local/bin/subl'
end

#to_yamlObject



32
33
34
# File 'lib/xray/config.rb', line 32

def to_yaml
  {editor: editor}.to_yaml
end