Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
= {project-name} Ted Nyman ted@ted.io; Aman Gupta aman@tmm1.net; Marat Radchenko marat@slonopotamus.org :project-name: pygments.rb :slug: pygments/{project-name} :uri-project: https://github.com/{slug} :uri-ci: {uri-project}/actions?query=branch%3Amaster :uri-gem: https://rubygems.org/gems/{project-name} :uri-pygments: https://pygments.org/
image:https://img.shields.io/gem/v/{project-name}.svg[Latest Release,link={uri-gem}] image:{uri-project}/workflows/CI/badge.svg?branch=master[Build Status,link={uri-ci}]
== Introduction
{project-name} is a Ruby wrapper for {uri-pygments}[Pygments] syntax highlighter.
{project-name} works by talking over a simple pipe to a long-lived Python child process. This library replaces https://github.com/github/albino[github/albino], as well as an older version of {project-name} that used an embedded Python interpreter.
Each Ruby process that runs has its own 'personal Python'; for example, 4 Unicorn workers will have one Python process each. If a Python process dies, a new one will be spawned on the next pygments.rb request.
== System Requirements
== Installation
Add this line to your application's Gemfile:
And then execute:
Or install pygments.rb gem yourself as:
== Usage
Require pygments.rb module:
Highlight a file:
Optionally, pass encoding and other lexer/formatter options via an :options
hash:
pygments.rb uses HTML formatter by default.
To use a different formatter, specify it via :formatter
parameter:
To generate CSS for HTML formatted code, use the Pygments.css
method:
To use a specific pygments style, pass the :style
option to the Pygments.css
method:
Other Pygments high-level API methods are also available. These methods return arrays detailing all the available lexers, formatters, and styles:
To use a custom pygments installation, specify the path to
Pygments.start
:
If you'd like logging, set the environmental variable MENTOS_LOG
to a file path for your logfile.
You can apply a timeout to pygments.rb calls by specifying number of seconds in MENTOS_TIMEOUT
environmental variable or by passing the :timeout
argument (takes precedence over MENTOS_TIMEOUT
):
== Benchmarks
== Development
After checking out the repo, run bundle install
to install dependencies.
Then, run bundle exec rake test
to run the tests.
== Copyright
Copyright (C) Ted Nyman, Aman Gupta, Marat Radchenko, 2012-2021. Free use of this software is granted under the terms of the MIT License.
For the full text of the license, see the link:LICENSE[] file.
FAQs
Unknown package
We found that pygments.rb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.