Method: Licensed::Sources::Cabal#cabal_file_regex
- Defined in:
- lib/licensed/sources/cabal.rb
#cabal_file_regex ⇒ Object
Find ‘build-depends` lists from specified targets in a cabal file
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/licensed/sources/cabal.rb', line 190 def cabal_file_regex # this will match 0 or more occurences of # match[0] - specifier, e.g. executable, library, etc # match[1] - full list of matched dependencies # match[2] - first matched dependency (required) # match[3] - remainder of matched dependencies (not required) @cabal_file_regex ||= / # match a specifier, e.g. library or executable ^(#{cabal_file_targets.join("|")}) .*? # stuff # match a list of 1 or more dependencies build-depends:(#{DEPENDENCY_REGEX}(,#{DEPENDENCY_REGEX})*)\n /xmi end |