
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.