<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Viamentis Blog &#187; Ruby</title>
	<atom:link href="http://blog.viamentis.com/articles/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.viamentis.com</link>
	<description>Curious About Everything</description>
	<lastBuildDate>Mon, 12 Jul 2010 11:16:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Neat Ruby Guide</title>
		<link>http://blog.viamentis.com/articles/2008/10/18/neat-ruby-guide/</link>
		<comments>http://blog.viamentis.com/articles/2008/10/18/neat-ruby-guide/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 17:12:48 +0000</pubDate>
		<dc:creator>Vamsee</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[irb]]></category>

		<guid isPermaLink="false">http://blog.viamentis.com/?p=202</guid>
		<description><![CDATA[A pretty basic but interesting ruby guide. There are some surprises too. I didn&#8217;t know irb has such a cool tab-completion feature. Neat.]]></description>
			<content:encoded><![CDATA[<p>A pretty basic but interesting <a href="http://www.caliban.org/ruby/rubyguide.shtml">ruby guide</a>. There are some surprises too. I didn&#8217;t know irb has such a cool tab-completion feature. Neat.</p>
<div id="pfButton"><a href="http://blog.viamentis.com/articles/2008/10/18/neat-ruby-guide/?pfstyle=wp" title="Print an optimized version of this web page"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-button-both.gif" alt="Print"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.viamentis.com/articles/2008/10/18/neat-ruby-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BackgrounDRb a ruby library along with rails</title>
		<link>http://blog.viamentis.com/articles/2008/04/25/backgroundrb-a-ruby-library-along-with-rails/</link>
		<comments>http://blog.viamentis.com/articles/2008/04/25/backgroundrb-a-ruby-library-along-with-rails/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 11:30:29 +0000</pubDate>
		<dc:creator>divya</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[backgroundrb]]></category>
		<category><![CDATA[mutitask]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.viamentis.com/articles/2008/04/25/backgroundrb-a-ruby-library-along-with-rails/</guid>
		<description><![CDATA[Since Rails is single threaded and can&#8217;t handle multiple requests at a time , when I need such functionality I was helpless.Then I came to know about BackgrounDRb a ruby library which will help us to make &#8220;RAILS&#8221; handle multiple requests at the same time.To make use of this library is pretty simple. Following steps [...]]]></description>
			<content:encoded><![CDATA[<p>Since Rails is single threaded and can&#8217;t handle multiple requests at a time , when I need such functionality I was helpless.Then I came to know about <a href="http://backgroundrb.rubyforge.org/index.html">BackgrounDRb</a>  a ruby library which will help us to make &#8220;RAILS&#8221; handle multiple requests at the same time.To make use of this library is pretty simple. Following steps will help you to do so.BackgrounDRb depends on chronic and packet gems. Thus lets get started by installing these two gems first</p>
<p><code>sudo gem install chronic packet</code></p>
<p>Now we are ready to install backgroundrb , for this we need to do</p>
<p><code>script/plugin install svn://rubyforge.org//var/svn/backgroundrb</code></p>
<p>Now backgroundrb plugin is installed on our application, now set it up using the command</p>
<p><code>rake backgroundrb:setup</code>  :this will create three files on our application</p>
<p><code>creates a config file backgroundrb.yml in config directory of your rails application.<br />
Creates RAILS_ROOT/lib/workers directory for keeping BackgrounDRb workers in one place.<br />
Creates RAILS_ROOT/test/bdrb_test_helper.rb as a test helper for your workers</code></p>
<p><code></code><br />
How this helps to balance the load is very interesting. Here we have one class called &#8220;<strong>worker</strong>&#8220;. Using this worker class we can make our time-consuming tasks run in the background of application, instead of running in controller.Now we can create our  worker using the command</p>
<p><code>./script/generate worker &lt;classname&gt;</code> which will generate your worker class and there you can write your time taking process.</p>
<p>Now we can invoke the worker on request using</p>
<p><code>MiddleMan.new_worker :class =&gt; :name_of_your_worker, :args =&gt; {arguments to pass}</code></p>
<p>Before you start your web server do start backgroundrb, you can start and stop this by</p>
<p><code>./script/backgroundrb/start<br />
./script/backgroundrb/stop</code></p>
<p><code></code><br />
Now our app will act as multi threaded. Try an example given below</p>
<p>Let me first thank my colleague Mr.Unni for his code on &#8220;downloading the song from YouTube using a ruby script&#8221;, I am borrowing few parts of it. So in the sample app you can download a song from YouTube using the URL of that particular song. Here Backgroundrb plays well to download multiple songs at same time by running it on background. Run this app on clicking the link below:<br />
<a href="http://blog.viamentis.com/wp-content/uploads/2008/04/background.zip">Download and run me</a></p>
<div id="pfButton"><a href="http://blog.viamentis.com/articles/2008/04/25/backgroundrb-a-ruby-library-along-with-rails/?pfstyle=wp" title="Print an optimized version of this web page"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-button-both.gif" alt="Print"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.viamentis.com/articles/2008/04/25/backgroundrb-a-ruby-library-along-with-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shoes &#8211; a ruby GUI toolkit</title>
		<link>http://blog.viamentis.com/articles/2008/04/04/shoes-a-ruby-gui-toolkit/</link>
		<comments>http://blog.viamentis.com/articles/2008/04/04/shoes-a-ruby-gui-toolkit/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 10:25:59 +0000</pubDate>
		<dc:creator>divya</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[shoes]]></category>

		<guid isPermaLink="false">http://blog.viamentis.com/articles/2008/04/04/shoes-a-ruby-gui-toolkit/</guid>
		<description><![CDATA[Ruby is not only showing its power in Rails but also applications like &#8220;shoes&#8221; ,&#8221;shoes&#8221; is graphics and windowing toolkit. It will run on all platforms like Windows, Mac OS X and Linux , which help you to build desktop applications easily.Its creating GUI components some what similar to web applications.shoes library making our task [...]]]></description>
			<content:encoded><![CDATA[<p>Ruby is not only showing its power in Rails but also applications like &#8220;<strong>shoes</strong>&#8221; ,&#8221;shoes&#8221; is graphics and windowing toolkit. It will run on all platforms like Windows, Mac OS X and Linux , which help you to build desktop applications easily.Its creating GUI components some what similar to web applications.shoes library making our task easier by providing lots of methods to build a desktop item.Ruby <strong>Shoes</strong> is  written in C and uses Ruby native extensions to allow interaction with Ruby code.<br />
First of all you need to install ruby &#8220;shoes&#8221; ,available here <a href="http://code.whytheluckystiff.net/shoes/wiki/DownloadShoes">download </a></p>
<p>1.Download source</p>
<p>2.Extract(unzip)</p>
<p>3.Install</p>
<p>Now run</p>
<p><code>$ shoes</code></p>
<p>Which will give take you to a graphical mode there you can choose your ruby file for shoes.Or run your shoes file by</p>
<p><code>$ shoes &lt;filename.rb&gt;</code></p>
<p>Here is  examples to show the simplicity and elegance of ruby shoes.Start with a small ones</p>
<p>Example for a button click<br />
<code>Shoes.app {<br />
button("Hello") { alert("You have clicked on hello") }<br />
}</code><br />
example for drop down box<br />
<code>shape = nil<br />
Shoes.app do<br />
shape = list_box :items =&gt; ["Square", "Oval", "Rectangle"]<br />
button "Report" do<br />
Shoes.p [shape.text]<br />
end<br />
end</code></p>
<p>You can see all the methods available for shoes &#8220;<a href="http://code.whytheluckystiff.net/entirety/">CLICK ME</a>&#8221; or type on command line<br />
<code>$ shoes --manual - you can see a helper.</code></p>
<p>Ideal example to see the power of shoes is given below , in those few lines its doing a big job !!<br />
<code>Shoes.app :width =&gt; 500, :height =&gt; 100, :margin =&gt; 10 do<br />
def answer(v)<br />
@answer.replace v.inspect<br />
end<br />
button "Ask" do<br />
answer ask("Enter your name")<br />
end<br />
button "Confirm" do<br />
answer confirm("Like to proceed??")<br />
end<br />
button "Open File" do<br />
answer ask_open_file<br />
end<br />
button "Save File" do<br />
answer ask_save_file<br />
end<br />
button "Select Your Color" do<br />
answer ask_color("Select yours")<br />
end<br />
@answer = para "Answers appear here"<br />
end</code></p>
<div id="pfButton"><a href="http://blog.viamentis.com/articles/2008/04/04/shoes-a-ruby-gui-toolkit/?pfstyle=wp" title="Print an optimized version of this web page"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-button-both.gif" alt="Print"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.viamentis.com/articles/2008/04/04/shoes-a-ruby-gui-toolkit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ramaze Ruby is amazing !!!</title>
		<link>http://blog.viamentis.com/articles/2008/03/01/ramaze-ruby-is-amazing/</link>
		<comments>http://blog.viamentis.com/articles/2008/03/01/ramaze-ruby-is-amazing/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 04:55:39 +0000</pubDate>
		<dc:creator>divya</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[amaze]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[ramaze]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.viamentis.com/articles/2008/03/01/ramaze-ruby-is-amazing/</guid>
		<description><![CDATA[Ramaze-means Ruby Amaze , light and modular open-source web application framework written in Ruby.Which is more easy to work with and no complexities for a new user.Ramaze is claiming to have more advantages than ruby on rails in speed , safety , user friendliness etc. Installation is very simple $ gem install ramaze installing as [...]]]></description>
			<content:encoded><![CDATA[<p>Ramaze-means Ruby Amaze , light and modular open-source web application framework written in Ruby.Which is more easy to work with and no complexities for a new user.Ramaze is claiming to have more advantages than ruby on rails in speed , safety , user friendliness etc.</p>
<p>Installation is very simple</p>
<p><code>$ gem install ramaze installing as rubygem</code></p>
<p>Now your ramaze is ready to use.You can build ur applications by saying</p>
<p><code>$ ramaze --create my_app</code></p>
<p>Which will give u the basic format and you can edit and build your application in the way you want.Ramaze follows MVC architecture , unlike Rails it can work on a single ruby program also.You can run your ramaze application like</p>
<p><code>$ramaze or<br />
$ruby start.rb</code></p>
<p>Or if u want to run a single script just run<br />
<code>$ ruby yourscript.rb</code></p>
<p><a href="http://ramaze.net/">Ramaze</a> is well documented with basic examples and easy to use even for a newbie.Ramaze stays close to the ruby&#8217;s principles such as simplicity n elegance.Basically Ramaze contains a controller called MainController and which maps to &#8216;/&#8217;. Here data is getting saved in a &#8216;.yaml&#8217; file instead of database.</p>
<p><code>class MainController &lt; Ramaze::Controller<br />
end</code></p>
<p>Also we can map to other URL s if we want.Its pretty simpler than Rails i guess.</p>
<p><code>class AnotherController &lt; Ramaze::Controller<br />
map '/another'<br />
end</code><br />
You will get the basic <a href="http://ramaze.net/getting-started#examples">examples</a> to run your application from here.</p>
<p>Ramaze supports a lot of templating engines and such as Haml, Erubis,Markaby an d Ezmar.Also includes support for several adapters, including Mongrel, Evented Mongrel and FastCGIetc.<br />
In the homepage of Ramaze you can see the <a href="http://ramaze.net/tutorials:todolist">tutorials</a> ,just give a try you will understand more.</p>
<div id="pfButton"><a href="http://blog.viamentis.com/articles/2008/03/01/ramaze-ruby-is-amazing/?pfstyle=wp" title="Print an optimized version of this web page"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-button-both.gif" alt="Print"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.viamentis.com/articles/2008/03/01/ramaze-ruby-is-amazing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
