lib/xray/config.rb in xray-rails-0.1.21 vs lib/xray/config.rb in xray-rails-0.1.22
- old
+ new
@@ -6,12 +6,18 @@
class Config
attr_accessor :editor
CONFIG_FILE = ".xrayconfig"
- DEFAULT_EDITOR = '/usr/local/bin/subl'
+ def default_editor
+ ENV['GEM_EDITOR'] ||
+ ENV['VISUAL'] ||
+ ENV['EDITOR'] ||
+ '/usr/local/bin/subl'
+ end
+
def editor
load_config[:editor]
end
def editor=(new_editor)
@@ -51,10 +57,9 @@
rescue
{}
end
def default_config
- { editor: DEFAULT_EDITOR }
+ { editor: default_editor }
end
-
end
end