Class: FastIgnore::GitconfigParser
- Inherits:
-
Object
- Object
- FastIgnore::GitconfigParser
- Defined in:
- lib/fast_ignore/gitconfig_parser.rb
Overview
rubocop:disable Metrics/ClassLength
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path, root: Dir.pwd, nesting: 1) ⇒ GitconfigParser
constructor
A new instance of GitconfigParser.
- #parse ⇒ Object
Constructor Details
#initialize(path, root: Dir.pwd, nesting: 1) ⇒ GitconfigParser
Returns a new instance of GitconfigParser.
12 13 14 15 16 |
# File 'lib/fast_ignore/gitconfig_parser.rb', line 12 def initialize(path, root: Dir.pwd, nesting: 1) @path = path @root = root @nesting = nesting end |
Class Method Details
.parse(file, root: Dir.pwd, nesting: 1) ⇒ Object
8 9 10 |
# File 'lib/fast_ignore/gitconfig_parser.rb', line 8 def self.parse(file, root: Dir.pwd, nesting: 1) new(file, root: root, nesting: nesting).parse end |
Instance Method Details
#parse ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/fast_ignore/gitconfig_parser.rb', line 18 def parse raise ::FastIgnore::GitconfigParseError if nesting >= 10 read_file(path) return unless value value end |