class Cbradeps::GemfileScraper::NonBlockOptionParser
Public Class Methods
new(options)
click to toggle source
# File lib/cobradeps/gemfile_scraper.rb, line 82 def initialize(options) @options = options end
Public Instance Methods
parse()
click to toggle source
# File lib/cobradeps/gemfile_scraper.rb, line 86 def parse {}.merge(path).merge(direct) end
Private Instance Methods
direct()
click to toggle source
# File lib/cobradeps/gemfile_scraper.rb, line 97 def direct match = @options.match(/group(?:\s*=>|:)\s+:direct/) match ? {direct: true} : {} end
path()
click to toggle source
# File lib/cobradeps/gemfile_scraper.rb, line 92 def path match = @options.match(/path(?:\s*=>|:)\s+["']([^'"]+)["']/) match ? {path: match[1]} : {} end