
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
DanaDanger-css_parser
Advanced tools
=== Ruby CSS Parser
Load, parse and cascade CSS rule sets in Ruby.
==== Setup
Install the gem from RubyGems.
gem install css_parser
Done.
==== An example require 'css_parser' include CssParser
parser = CssParser::Parser.new parser.load_file!('http://example.com/styles/style.css')
parser.find('#content') #=> 'font-size: 13px; line-height: 1.2;'
parser.find('#content', [:screen, :handheld])
parser.each_selector(:screen) do |selector, declarations, specificity| ... end
css = <<-EOT body { margin: 0 1em; } EOT
parser.add_block!(css)
parser.to_s => #content { font-size: 13px; line-height: 1.2; } body { margin: 0 1em; }
==== Testing
You can run the suite of unit tests using rake test.
The download/import tests require that WEBrick is installed. The tests set up a temporary server on port 12000 and pull down files from the test/fixtures/ directory.
==== Credits and code
By Alex Dunae (dunae.ca, e-mail 'code' at the same domain), 2007-08.
Project homepage: http://code.google.com/p/ruby-css-parser/
Made on Vancouver Island.
FAQs
Unknown package
We found that DanaDanger-css_parser 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.