Class: Dependabot::Hex::FileUpdater::MixfileSanitizer
- Inherits:
-
Object
- Object
- Dependabot::Hex::FileUpdater::MixfileSanitizer
- Defined in:
- lib/dependabot/hex/file_updater/mixfile_sanitizer.rb
Constant Summary collapse
- FILE_READ =
/File.read\(.*?\)/- FILE_READ_BANG =
/File.read!\(.*?\)/- PIPE =
Regexp.escape("|>").freeze
- 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
rubocop:disable Performance/MethodObjectAsBlock.
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
rubocop:disable Performance/MethodObjectAsBlock
25 26 27 28 29 |
# File 'lib/dependabot/hex/file_updater/mixfile_sanitizer.rb', line 25 def sanitized_content mixfile_content. then(&method(:prevent_version_file_loading)). then(&method(:prevent_config_path_loading)) end |