slim in ruby

26 July 2006   0 comments   Linux

Mind That Age!

This blog post is 12 years old! Most likely, its content is outdated. Especially if it's technical.

Just figured out how to call my slim web service via XML-RPC using Ruby. It's as easy as in Python.

Here's the code:

require "xmlrpc/client"
# Make an object to represent the XML-RPC server.
server = XMLRPC::Client.new( "www.peterbe.com", "/")
# Call the remote server and get our result
result = server.call("slim", "h1 { font-family: Arial;}","css")
puts result
result = server.call("slim", 
  "function add(var1, var2) { return var1 + var2; }","js")
puts result

And when you run this on the command line this is what you get:

$ ruby dummy.rb
h1{font-family:Arial}
function add(_0,_1){return _0 + _1;}

Comments

Your email will never ever be published


Related posts

Previous:
slim, a new free web service for white space optimisation 25 July 2006
Next:
Exploding Dell laptops 31 July 2006
Related by Keyword:
slim, a new free web service for white space optimisation 25 July 2006
Ruby and Python benchmarked 25 September 2005
Related by Text:
Be very careful with your add_header in Nginx! You might make your site insecure 11 February 2018
jQuery and Highslide JS 08 January 2008
I'm back! Peterbe.com has been renewed 05 June 2005
Anti-McCain propaganda videos 12 August 2008
I'm Prolog 01 May 2007