Class: Frett::Config
- Inherits:
-
Object
- Object
- Frett::Config
- Defined in:
- lib/frett/config.rb
Class Method Summary collapse
- .config_path ⇒ Object
- .default_options ⇒ Object
- .index_path ⇒ Object
- .load_config(working_dir) ⇒ Object
- .method_missing(meth, *args, &block) ⇒ Object
- .mtime_path ⇒ Object
Class Method Details
.config_path ⇒ Object
33 34 35 |
# File 'lib/frett/config.rb', line 33 def config_path File.join(File.(self.working_dir), '.frett.yml') end |
.default_options ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/frett/config.rb', line 4 def { :exclude => "^tags$|log\/|tmp\/", :num_docs => 100000, :directory => ".frett", :log => true, :consider_mtime => true, :service_name => "frett_service", :search => { :use_wildcard => false, :escape => true, :use_or => false } } end |
.index_path ⇒ Object
25 26 27 |
# File 'lib/frett/config.rb', line 25 def index_path File.join(File.(self.working_dir), self.directory) end |
.load_config(working_dir) ⇒ Object
20 21 22 23 |
# File 'lib/frett/config.rb', line 20 def load_config(working_dir) @options = .merge(:working_dir => working_dir) @options.merge!(YAML.load(File.read(self.config_path))) if File.exists?(self.config_path) end |
.method_missing(meth, *args, &block) ⇒ Object
37 38 39 |
# File 'lib/frett/config.rb', line 37 def method_missing(meth, *args, &block) @options[meth] end |
.mtime_path ⇒ Object
29 30 31 |
# File 'lib/frett/config.rb', line 29 def mtime_path File.join(index_path, 'mtime') end |