Class: LicenseFinder::License::HeaderMatcher
- Inherits:
-
Struct
- Object
- Struct
- LicenseFinder::License::HeaderMatcher
- Defined in:
- lib/license_finder/license/header_matcher.rb
Instance Attribute Summary collapse
-
#base_matcher ⇒ Object
Returns the value of attribute base_matcher.
-
#first_n_lines ⇒ Object
Returns the value of attribute first_n_lines.
Instance Method Summary collapse
Instance Attribute Details
#base_matcher ⇒ Object
Returns the value of attribute base_matcher
5 6 7 |
# File 'lib/license_finder/license/header_matcher.rb', line 5 def base_matcher @base_matcher end |
#first_n_lines ⇒ Object
Returns the value of attribute first_n_lines
5 6 7 |
# File 'lib/license_finder/license/header_matcher.rb', line 5 def first_n_lines @first_n_lines end |
Instance Method Details
#matches_text?(text) ⇒ Boolean
6 7 8 9 10 11 12 13 14 |
# File 'lib/license_finder/license/header_matcher.rb', line 6 def matches_text?(text) n = if first_n_lines.nil? 1 else first_n_lines end header = text.lines.first(n).join || '' base_matcher.matches_text?(header) end |