Sha256: 2e888514f970264eba4fb153c7f4c9bbed58082f9415a0d2c38a66f5171f5a6d
Contents?: true
Size: 732 Bytes
Versions: 2
Compression:
Stored size: 732 Bytes
Contents
# frozen_string_literal: true require_relative "file_filter" module KeepUp # Filter to update dependency information in a Gemspec. class GemspecFilter < FileFilter def self.apply(contents, dependency) matcher = dependency_matcher(dependency) contents.each_line.map do |line| if line =~ matcher match = Regexp.last_match "#{match[1]}#{dependency.version}#{match[2]}" else line end end.join end def self.dependency_matcher(dependency) / ^(.*_dependency \s*(?:\(\s*)? (?:['"]|%q.)#{dependency.name}.(?:\.freeze)?, \s+\[?['"](?:~>|=)?\ *) [^'"]* (['"]\]?[^'"]*)$ /mx end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
keep_up-0.11.0 | lib/keep_up/gemspec_filter.rb |
keep_up-0.10.2 | lib/keep_up/gemspec_filter.rb |