Class: Dependabot::Hex::FileUpdater::MixfileSanitizer
- Inherits:
-
Object
- Object
- Dependabot::Hex::FileUpdater::MixfileSanitizer
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/hex/file_updater/mixfile_sanitizer.rb
Constant Summary collapse
- FILE_READ =
/File.read\(.*?\)/
- FILE_READ_BANG =
/File.read!\(.*?\)/
- PIPE =
T.let(Regexp.escape("|>").freeze, String)
- VERSION_FILE =
/"VERSION"/i
- NESTED_VERSION_FILE_READ =
/String\.trim\(#{FILE_READ}\)/
- NESTED_VERSION_FILE_READ_BANG =
/String\.trim\(#{FILE_READ_BANG}\)/
- PIPED_VERSION_FILE_READ =
/#{VERSION_FILE}[[:space:]]+#{PIPE}[[:space:]]+#{FILE_READ}/
- PIPED_VERSION_FILE_READ_BANG =
/#{VERSION_FILE}[[:space:]]+#{PIPE}[[:space:]]+#{FILE_READ_BANG}/
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.
14 15 16 |
# File 'lib/dependabot/hex/file_updater/mixfile_sanitizer.rb', line 14 def initialize(mixfile_content:) @mixfile_content = mixfile_content end |
Instance Method Details
#sanitized_content ⇒ Object
29 30 31 32 33 |
# File 'lib/dependabot/hex/file_updater/mixfile_sanitizer.rb', line 29 def sanitized_content @mixfile_content .then { |content| prevent_version_file_loading(content) } .then { |content| prevent_config_path_loading(content) } end |