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