Class: Solargraph::ApiMap::Config
- Inherits:
-
Object
- Object
- Solargraph::ApiMap::Config
- Defined in:
- lib/solargraph/api_map/config.rb
Instance Attribute Summary collapse
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
-
#workspace ⇒ Object
readonly
Returns the value of attribute workspace.
Instance Method Summary collapse
- #excluded ⇒ Object
- #extensions ⇒ Object
- #included ⇒ Object
-
#initialize(workspace = nil) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(workspace = nil) ⇒ Config
Returns a new instance of Config.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/solargraph/api_map/config.rb', line 9 def initialize workspace = nil @workspace = workspace include_globs = ['**/*.rb'] exclude_globs = ['spec/**/*', 'test/**/*'] unless @workspace.nil? sfile = File.join(@workspace, '.solargraph.yml') if File.file?(sfile) @raw_data = YAML.load(File.read(sfile)) end end @raw_data ||= {} @raw_data['include'] = @raw_data['include'] || include_globs @raw_data['exclude'] = @raw_data['exclude'] || exclude_globs @raw_data['extensions'] = @raw_data['extensions'] || [] end |
Instance Attribute Details
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
7 8 9 |
# File 'lib/solargraph/api_map/config.rb', line 7 def raw_data @raw_data end |
#workspace ⇒ Object (readonly)
Returns the value of attribute workspace.
6 7 8 |
# File 'lib/solargraph/api_map/config.rb', line 6 def workspace @workspace end |
Instance Method Details
#excluded ⇒ Object
29 30 31 |
# File 'lib/solargraph/api_map/config.rb', line 29 def excluded process_globs @raw_data['exclude'] end |
#extensions ⇒ Object
33 34 35 |
# File 'lib/solargraph/api_map/config.rb', line 33 def extensions @raw_data['extensions'] end |
#included ⇒ Object
25 26 27 |
# File 'lib/solargraph/api_map/config.rb', line 25 def included process_globs @raw_data['include'] end |