Ralphy is a Ruby SVG library, built on Nokogiri.
Future:
svg = Ralphy::Image.new(:width => 300, :height => 200) circle = Ralphy::Circle.new(:cx => svg.width/2, :cy => svg.height/2) circle << Ralphy::CSS.new(:fill => '#aeb619') # Neatly define your CSS. Separate your style from your content. svg << circle svg.to_svg # ArgumentError: no radius! circle.r = 100 svg.to_svg # Awesome SVG + CSS one-file image
Present:
svg = Ralphy::BasicImage.new(:width => 300, :height => 200) circle = Ralphy::BasicCircle.new(:r => 100, :cx => svg[:width].to_i/2, :cy => svg[:height].to_i/2) rect = Ralphy::BasicRect.new(:x => 20, :y => 30, :width => 40, :height => 50) svg << circle << rect For more informations, check lib/ralphy/wrapper and its specs
-
Fork the project.
-
Make your feature addition or bug fix.
-
Add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-
Send me a pull request. Bonus points for topic branches.
Copyright © 2010 Othmane Benkirane. See LICENSE for details.