
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
Miniparser is a Ruby gem that takes code as input (HTML, JavaScript, or CSS), determines the code language, validates it, and then minifies it. It returns whether the code is valid or not, and if valid, provides the minified code.
Add this line to your application's Gemfile:
gem 'Miniparser'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install Miniparser
Miniparser provides two main methods to process either a file or a string containing HTML, JavaScript, or CSS code.
You can process a file by calling the type_file
method and passing the file path as an argument:
result = Miniparser::Processor.type_file('path/to/yourfile.html')
You can process a string containing code by calling the type_string
method:
result = Miniparser::Processor.type_string('<html><head></head><body></body></html>')
Both methods return a hash containing the validation status, any errors, and the minified code if the input was valid:
{
valid: true or false,
errors: "Error message if any",
minified_code: "Minified code if valid"
}
Bug reports and pull requests are welcome. Please adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that Miniparser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.