
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
tm_syntax_highlighting
Advanced tools
** NOTE: You must install ultraviolet before installing this plugin. Follow the instructions below.
This plugin allows you to add TextMate themed syntax highlighting to your views.
It requires the Ultraviolet gem, which requires TextPow, which requires oniguruma (both the gem and the system library).
Oniguruma is a regular expression library used by TextPow in order to properly parse TextMate syntax/language files. It's relatively easy to install, here is the URL for the library: http://www.geocities.jp/kosako3/oniguruma/
Then you need to do
$ gem install ultraviolet
which should install ultraviolet, textpow, and oniguruma.
Lastly, in order for this plugin to properly copy the syntax CSS files from ultraviolet, ultraviolet must already be installed. In other words, you need to install ultraviolet before installing this plugin.
The plugin comes with a generator for the stylesheets for the different themes.
$ script/generate syntax_css list
$ script/generate syntax_css all
$ script/generate syntax_css theme_name
The plugin adds 2 view helper methods: code and syntax_css
code(some_ruby_code, :theme => "twilight", :lang => "ruby", :line_numbers => true)
lang and line_numbers are optional. lang will default to plain_text and line_numbers will default to true. It is HIGHLY recommended that you fragment_cache or some other type of caching for code fragments (TextPow and/or Ultraviolet have some speed issues).
theme can be an array, and one will be chosen at random.
you can set defaults in an initializer:
TmSyntaxHighlighting.defaults = {:theme => "sunburst", :line_numbers => true, :lang => "ruby"}
again, theme can be an array and will be chosen at random.
lastly, the syntax_css method will include the stylesheet tags for the themes
you can call it with a theme name
syntax_css("twilight")
or if you call it with no options, it will include all the css files for the themes used in this request
code(some_ruby_code, :theme => "twilight") code(some_more_ruby_code, :theme => "sunburst") ... syntax_css # yields stylesheet tags for both twilight and sunburst
FAQs
Unknown package
We found that tm_syntax_highlighting 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.