Class: Xray::Config
- Inherits:
-
Object
- Object
- Xray::Config
- Defined in:
- lib/xray/config.rb
Constant Summary collapse
- CONFIG_FILE =
".xrayconfig"
Instance Attribute Summary collapse
-
#editor ⇒ Object
Returns the value of attribute editor.
Instance Method Summary collapse
Instance Attribute Details
#editor ⇒ Object
Returns the value of attribute editor.
8 9 10 |
# File 'lib/xray/config.rb', line 8 def editor @editor end |
Instance Method Details
#config_file ⇒ Object
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_editor ⇒ Object
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_yaml ⇒ Object
32 33 34 |
# File 'lib/xray/config.rb', line 32 def to_yaml {editor: editor}.to_yaml end |