Class: SearchConfPath
- Inherits:
-
Object
- Object
- SearchConfPath
- Defined in:
- lib/qiita_org/search_conf_path.rb
Instance Method Summary collapse
-
#initialize(dir, home) ⇒ SearchConfPath
constructor
A new instance of SearchConfPath.
- #search_conf_path ⇒ Object
Constructor Details
#initialize(dir, home) ⇒ SearchConfPath
2 3 4 5 6 |
# File 'lib/qiita_org/search_conf_path.rb', line 2 def initialize(dir, home) @dir = dir @home = home search_conf_path() end |
Instance Method Details
#search_conf_path ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/qiita_org/search_conf_path.rb', line 8 def search_conf_path() while @dir != @home if File.exists?(File.join(@dir, ".qiita.conf")) return @dir else @dir = @dir.match(/(.+)\//)[1] end end return @dir end |