Class: Dependabot::Hex::FileUpdater::MixfileSanitizer
- Inherits:
-
Object
- Object
- Dependabot::Hex::FileUpdater::MixfileSanitizer
- Defined in:
- lib/dependabot/hex/file_updater/mixfile_sanitizer.rb
Instance Method Summary collapse
-
#initialize(mixfile_content:) ⇒ MixfileSanitizer
constructor
A new instance of MixfileSanitizer.
- #sanitized_content ⇒ Object
Constructor Details
#initialize(mixfile_content:) ⇒ MixfileSanitizer
Returns a new instance of MixfileSanitizer.
10 11 12 |
# File 'lib/dependabot/hex/file_updater/mixfile_sanitizer.rb', line 10 def initialize(mixfile_content:) @mixfile_content = mixfile_content end |
Instance Method Details
#sanitized_content ⇒ Object
14 15 16 17 18 19 |
# File 'lib/dependabot/hex/file_updater/mixfile_sanitizer.rb', line 14 def sanitized_content mixfile_content. gsub(/File\.read!\(.*?\)/, '"0.0.1"'). gsub(/File\.read\(.*?\)/, '{:ok, "0.0.1"}'). gsub(/^\s*config_path:.*(?:,|$)/, "") end |