<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>RubyLearning Blog</title>
	
	<link>http://rubylearning.com/blog</link>
	<description>Ruby helps programmers have more fun!</description>
	<lastBuildDate>Mon, 06 Jul 2009 05:37:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/LearningRubyBlog" type="application/rss+xml" /><item>
		<title>How do I learn and master Sinatra?</title>
		<link>http://rubylearning.com/blog/2009/07/06/how-do-i-learn-and-master-sinatra/</link>
		<comments>http://rubylearning.com/blog/2009/07/06/how-do-i-learn-and-master-sinatra/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 03:48:06 +0000</pubDate>
		<dc:creator>Satish Talim</dc:creator>
				<category><![CDATA[Beginners]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[Corey Donohoe]]></category>
		<category><![CDATA[ruby programming]]></category>

		<guid isPermaLink="false">http://rubylearning.com/blog/?p=2547</guid>
		<description><![CDATA[
Welcome to the first installment on the RL blog, of a mini series &#8211; &#8220;How do I learn and master Sinatra?&#8221; &#8211; by top Rubyists using Sinatra. The interview series will provide insight and commentary from these notable Sinatra developers, with the goal of facilitating and providing answers to the questions Ruby beginners face on [...]]]></description>
			<content:encoded><![CDATA[<p></p><div>
<p class="update">Welcome to the <b>first</b> installment on the <abbr title="RubyLearning">RL</abbr> blog, of a mini series &#8211; &#8220;<strong>How do I learn and master Sinatra?</strong>&#8221; &#8211; by top Rubyists using <em>Sinatra</em>. The interview series will provide insight and commentary from these notable <em>Sinatra</em> developers, with the goal of facilitating and providing answers to the questions Ruby beginners face on <em>how to learn and master Sinatra</em>.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> Corey Donohoe, could you tell us something about yourself &#8211; your background, where you are based?</span></p>
<p class="block"><img class="alignright" title="Corey Donohoe" src="http://rubylearning.com/images/CoreyDonohoe.jpg" alt="Corey Donohoe" /><strong>Corey Donohoe&gt;&gt;</strong> I&#8217;m <a href="http://atmos.org/">Corey Donohoe</a>. I&#8217;m based out of Boulder, Colorado &#8211; USA. My background is in computer science and system administration though I prefer hacking to either of those labels. I&#8217;m a pretty normal dude, I enjoy cycling, music, coffee, micro brews, and all the other awesomeness that my home state has to offer. I&#8217;ve been working for <a href="http://www.engineyard.com/">Engine Yard</a> since March of &#8216;07 doing everything from app support to internal development. I&#8217;m currently 1/2 of our internal integrations team.</p>
<blockquote class="right"><p>Sinatra&#8217;s greatest strength is its flexibility</p>
</blockquote>
<p><span style="color:#CC3333;"><strong>Satish>></strong> Are there any pre-requisites for a person to start learning Sinatra</span></p>
<p><strong>Corey>></strong> There aren&#8217;t any hardcore prerequisites per se; Ruby and experience in a Ruby web framework is a plus. HTTP verbs play a huge role in Sinatra, as well as things like query and post params. If you get those concepts you can hit the ground running.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> How should one start learning Sinatra?</span></p>
<p><strong>Corey>></strong> Learn Sinatra incrementally. If you have new business requirements try to think about things like &#8220;how would i implement this in Sinatra?&#8221; Take the time to figure that requirement out in Sinatra then throw the solution out! When the time comes to use Sinatra for something you&#8217;ll have a much more broad understanding of the framework and you&#8217;ll hit fewer blockers.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> Which area of Sinatra should a beginner pay particular attention to?</span></p>
<p><strong>Corey>></strong> Understanding the difference between <b>Sinatra::Base</b> and <b>Sinatra::Default</b> is definitely something a Sinatra beginner should focus on early. <b>Sinatra::Base</b> is for writing Rack middleware, and <b>Sinatra::Default</b> is normally for writing Rack applications. Learning the modular style app development is really useful as well as using the register method to include pieces of functionality. Getting a handle on those concepts will expose you to the rest of Sinatra, which is relatively intuitive.</p>
<p><img class="alignright" src="http://rubylearning.com/images/sinatralogo.jpg" alt="Sinatra Icon" title="Sinatra micro-framework" /></p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> Is the official documentation on Sinatra good enough for a beginner? Are there areas which need improvement or need to be re-written</span></p>
<p><strong>Corey&gt;&gt;</strong> The Sinatra documentation is well done and I can generally find answers to my questions just by referencing the docs. There&#8217;s always #sinatra on freenode or the Sinatra book on github if you need additional help too. There&#8217;s plenty of pretty well tested examples on github using Sinatra, hancock and integrity come to mind.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> Sequel, DataMapper, ActiveRecord &#8211; which one would you recommend to use with Sinatra and why?</span></p>
<p><strong>Corey&gt;&gt;</strong> I use DataMapper exclusively. It was a bumpy ride a year ago but these days it&#8217;s acceptable for production use. We interface with more than just relational databases and the ability to keep a consistent model syntax across various data sources is really attractive to us. Realistically I feel like I spend less time fighting my framework when I&#8217;m using DataMapper so it&#8217;s the clear choice. The one place I wouldn&#8217;t use dm in would be a join heavy relational environment; ActiveRecord is way better at that.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> Is an understanding of Rack important while learning Sinatra? Why? Which area of Rack should one be really comfortable with?</span></p>
<p><strong>Corey&gt;&gt;</strong> You don&#8217;t need a solid understanding of Rack to get a Sinatra up and running, but you&#8217;ll be missing out on a lot of the power. It&#8217;s extremely beneficial to take the time to learn how the <b>Rack::Builder</b> works as well as the usage of the <b>use/map/run</b> commands in that context. The modularity of Rack really becomes apparent and you&#8217;ll find yourself using Sinatra more effectively.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> How should one hone one&#8217;s skills in Sinatra?</span></p>
<p><strong>Corey&gt;&gt;</strong> Read code, write test code, write code. All of the awesome testing frameworks available for Ruby are available to Sinatra. If you don&#8217;t write tests it might be a good way to familiarize yourself with testing best practices without the overheard of a larger framework.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> What type of projects should a beginner work on to gain more expertise in Sinatra?</span></p>
<p><strong>Corey&gt;&gt;</strong> <span style="background-color: #FFFFCC;">A beginner would benefit from writing something completely API driven as a first project</span>. So many people couple databases with dynamic web applications but it&#8217;s kind of liberating to just be an intermediary service. Twitter apps are pretty trivial to implement and can teach you a lot. They also expose you to a pretty large userbase to solicit feedback.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> Could you suggest some web services that a Sinatra beginner could develop himself / herself?</span></p>
<p><strong>Corey&gt;&gt;</strong> <span style="background-color: #FFFFCC;">Web services are great targets for introducing Sinatra into your workplace</span>. Identify a pain point in your organization and put a small app in front of it. It doesn&#8217;t have to replace something overnight but it&#8217;s a great way to sneak functionality in at work. Once you have a few of these built you start to reap the benefits of microapps and web services.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> Anything else you would like to add?</span></p>
<p><strong>Corey&gt;&gt;</strong> <span style="background-color: #FFFFCC;">Learning Sinatra is the best thing you can do while we all wait for Rails 3 to land</span>. The middleware you write will be able to be dropped right into your Rails 3 applications so it&#8217;s not like you&#8217;re wasting time. We&#8217;re starting to build really modular systems using Sinatra by building APIs into those systems. I think a lot of people would benefit from breaking their monolith apps down into microapps and Sinatra is a great way to do it.</p>
<p>People looking for a template might want to investigate the singem gem. It has basic templates for twitter apps or regular webservices. All of them are bootstrapped for testing with cucumber+rspec.</p>
<p><span style="color:#CC3333;"><em>Thank you Corey. In case you have any queries and/or questions, kindly post your questions here (as comments to this blog post) and Corey would be glad to answer.</em></span></p>
</div>
<p>Technorati Tags: <a href="http://technorati.com/tag/Corey+Donohoe" rel="tag">Corey Donohoe</a>, <a href="http://technorati.com/tag/Sinatra" rel="tag">Sinatra</a>, <a href="http://technorati.com/tag/Ruby+programming" rel="tag">Ruby programming</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=AXPlXkWLyMY:d_3rj36vbBs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LearningRubyBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=AXPlXkWLyMY:d_3rj36vbBs:MclgosYkiZA"><img src="http://feeds.feedburner.com/~ff/LearningRubyBlog?i=AXPlXkWLyMY:d_3rj36vbBs:MclgosYkiZA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://rubylearning.com/blog/2009/07/06/how-do-i-learn-and-master-sinatra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interview: Author Paolo Perrotta</title>
		<link>http://rubylearning.com/blog/2009/07/01/interview-author-paolo-perrotta/</link>
		<comments>http://rubylearning.com/blog/2009/07/01/interview-author-paolo-perrotta/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 03:00:07 +0000</pubDate>
		<dc:creator>Satish Talim</dc:creator>
				<category><![CDATA[Interview]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Paolo Perrotta]]></category>
		<category><![CDATA[Ruby Metaprogramming]]></category>
		<category><![CDATA[ruby programming]]></category>

		<guid isPermaLink="false">http://rubylearning.com/blog/?p=2525</guid>
		<description><![CDATA[
The trial batch of our new course &#8220;Ruby Metaprogramming&#8221; started recently. On this occasion, RubyLearning caught up with author Paolo Perrotta (who is writing the book &#8220;Metaprogramming Ruby&#8220;) and chatted with him.

Satish>> Paolo, could you tell us something about yourself &#8211; your background, where you are based?
Paolo>> I&#8217;m an Italian developer entering his 40s. I [...]]]></description>
			<content:encoded><![CDATA[<p></p><div>
<p class="alert">The trial batch of our new course &#8220;<strong>Ruby Metaprogramming</strong>&#8221; started recently. On this occasion, RubyLearning caught up with author <b>Paolo Perrotta</b> (who is writing the book &#8220;<strong>Metaprogramming Ruby</strong>&#8220;) and chatted with him.</p>
<p><img class="alignright" title="Paolo Perrotta" src="http://rubylearning.com/images/PaoloPerrotta.jpg" alt="Paolo Perrotta" /></p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> Paolo, could you tell us something about yourself &#8211; your background, where you are based?</span></p>
<p><strong>Paolo>></strong> I&#8217;m an Italian developer entering his 40s. I always worked as a freelancer, so I have a pretty colorful curriculum by now. Amongst other things I worked on computer games for Valve, I was on the Hibernate Object-Relation Mapper team, and I came very early to the agile methodologies party. At the moment, I&#8217;m coaching agile teams at Yoox, a wonderful Internet fashion boutique. I&#8217;m based in Bologna, Italy &#8211; roughly halfway between Florence and Venice.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> How did you learn and get into Ruby Metaprogramming?</span></p>
<p><strong>Paolo>></strong> At first, I got into metaprogramming for the tricks. After years of Java, Ruby kept surprising and delighting me. &#8220;I can catch all the calls to this object, add this parameter and route them to this other object&#8230; all in a single line of code! Cool!&#8221; So that&#8217;s what got me into metaprogramming at first: the power to refactor complex, duplicated pieces of logic into a few lines of elegant code.</p>
<p>When I grew more experienced, I started to see patterns emerge out of Ruby. I realized that <span style="background-color: #FFFFCC;">metaprogramming sits at the very heart of the language, and when you understand metaprogramming, that&#8217;s the moment when you start &#8220;thinking in Ruby&#8221;</span>. So I&#8217;d say that I got into metaprogramming for the cool tricks, and I stayed there because I realized that you need to know and use metaprogramming if you want to be a native Ruby speaker.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> Why did you choose the topic of &#8220;Ruby Metaprogramming&#8221; for your first book?</span></p>
<p><strong>Paolo>></strong> When I got past the initial &#8220;falling in love&#8221; stage, I found that Ruby could trip me up sometimes. On the surface, it looks like a dynamic version of Java or other object-oriented languages. But dig a tad deeper, and you find so many differences, so many questions. How does the &#8220;private&#8221; keyword work? What happens when you include multiple modules? Why can&#8217;t I ever get scopes right? And so on.</p>
<p>After fighting with these questions for a while, I found that I could answer all of them by understanding the principles behind the language. If you &#8220;get&#8221; the Ruby object model, then there is no question about &#8220;private&#8221; or modules anymore &#8211; everything suddenly looks obvious and elegant. But there was no single source I could tap into to learn this kind of information. To piece the Ruby puzzle together, I had to hunt around for blog posts, articles and pieces of source code.</p>
<p>So, this is the book I wish I could read when I was learning Ruby. It gathers that knowledge together in a single place, and gives names to techniques that don&#8217;t have any common name yet.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> Why did you write this book &#8211; what was your motivation?</span></p>
<p><strong>Paolo>></strong> All programmers know how satisfying it is to deploy something big and complicated. After focusing on the minute details for so long, you step back, and you see the system as a whole, finally complete and useful. That&#8217;s also the reason why I wrote a book. Now that it&#8217;s in review, it&#8217;s nice to step back and see people reading it, and telling you it&#8217;s useful to them.</p>
<p>And then, of course, there&#8217;s the obscene amount of money! (Just kidding).</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> Who’s the audience for your book &#8211; Metaprogramming Ruby?</span></p>
<p><strong>Paolo&gt;&gt;</strong> It&#8217;s billed as an advanced book for Ruby experts, but the reviewers are telling me that anyone with working knowledge of Ruby can read it and learn the techniques. I had Ruby beginners read it and enjoy it a lot.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> I know that it is too early to say, but looking back are there some topics that you now wish should have been covered or dropped from the book?</span></p>
<p><strong>Paolo&gt;&gt;</strong> As you write, you learn that the more you cut away, the better is the final result. It&#8217;s the same with code: the shorter the better, as long as it&#8217;s still as clear as it can be. I dropped a lot of unnecessary details, but I wouldn&#8217;t look back. If I had more time, I&#8217;d make it even shorter.</p>
<p><span style="color:#CC3333;"><strong>Satish>></strong> Anything else you would like to add?</span></p>
<p><strong>Paolo&gt;&gt;</strong> Just one thing: <span style="background-color: #FFFFCC;">Remember that as cool as metaprogramming is, it&#8217;s just a tool, with its own set of trade-offs. Sometimes it makes your code clearer and more concise, sometimes it makes it more rigid and obscure. You should really know about metaprogramming, but that doesn&#8217;t mean you have to use it all the time. Resist the temptation to overuse it, and always weigh it against more traditional techniques</span>.</p>
<p>Oh, and have a nice Ruby Metaprogramming course!</p>
<p><span style="color:#CC3333;"><em>Thank you Paolo. In case you have any queries and/or questions, kindly post your questions here (as comments to this blog post) and Paolo would be glad to answer.</em></span></p>
</div>
<p>Technorati Tags: <a href="http://technorati.com/tag/Paolo+Perrotta" rel="tag">Paolo Perrotta</a>, <a href="http://technorati.com/tag/Ruby+Metaprogramming" rel="tag">Ruby Metaprogramming</a>, <a href="http://technorati.com/tag/Ruby+programming" rel="tag">Ruby programming</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=vFDDxJlgd9Q:pfthZsAlNLY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LearningRubyBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=vFDDxJlgd9Q:pfthZsAlNLY:MclgosYkiZA"><img src="http://feeds.feedburner.com/~ff/LearningRubyBlog?i=vFDDxJlgd9Q:pfthZsAlNLY:MclgosYkiZA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://rubylearning.com/blog/2009/07/01/interview-author-paolo-perrotta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>20+ Rubyists are using Sinatra – Do you?</title>
		<link>http://rubylearning.com/blog/2009/06/29/20-rubyists-using-sinatra-do-you/</link>
		<comments>http://rubylearning.com/blog/2009/06/29/20-rubyists-using-sinatra-do-you/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 02:45:56 +0000</pubDate>
		<dc:creator>Satish Talim</dc:creator>
				<category><![CDATA[Beginners]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[Popular]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[ruby programming]]></category>
		<category><![CDATA[Rubyists]]></category>
		<category><![CDATA[Rubyists Using Sinatra]]></category>

		<guid isPermaLink="false">http://rubylearning.com/blog/?p=2355</guid>
		<description><![CDATA[
20+ Rubyists are using Sinatra &#8211; Do you?
With Sinatra you can quickly create your own tiny web-applications in Ruby and write lots of small services. RubyLearning caught up with some Rubyists working with Sinatra and asked them as to why, how and where they use Sinatra.
Aaron Quint&#62;&#62; I&#8217;ve been using Sinatra all over the place. [...]]]></description>
			<content:encoded><![CDATA[<p></p><div>
<h3>20+ Rubyists are using Sinatra &#8211; Do you?</h3>
<p class="update">With <strong>Sinatra</strong> you can quickly create your own tiny web-applications in Ruby and write lots of small services. RubyLearning caught up with some Rubyists working with Sinatra and asked them as to why, how and where they use <em>Sinatra</em>.</p>
<p class="block"><img class="alignright" title="Aaron Quint" src="http://rubylearning.com/images/AaronQuint.jpg" alt="Aaron Quint" /><strong><a href="http://twitter.com/aq">Aaron Quint</a>&gt;&gt;</strong> I&#8217;ve been using Sinatra all over the place. With <a href="http://code.quirkey.com/vegas/">Vegas</a> I&#8217;ve been using it as a way to provide simple web interfaces to existing code. I&#8217;ve also been using it to prototype new application ideas. When not using Sinatra, I&#8217;ve been using some of the same basic ideas in JavaScript with <a href="http://code.quirkey.com/sammy/">Sammy.js</a>. <span style="background-color: #FFFFCC;">In general, Sinatra is just fun to use as it provides the most direct and clean route to get an idea or a piece of code on the web</span>. <a href="http://rubylearning.com/blog/2009/03/20/interview-aaron-quint-on-sinatra/">Read Aaron&#8217;s interview on Sinatra</a>.</p>
<p class="block"><img class="alignleft" title="Adam Keys" src="http://rubylearning.com/images/AdamKeys.jpg" alt="Adam Keys" /><strong><a href="http://twitter.com/therealadam">Adam Keys</a>&gt;&gt;</strong> I’m using Sinatra for two things. For personal stuff, <span style="background-color: #FFFFCC;">I always reach for Sinatra when I want to prototype an idea. It’s easy to get something in place so I can iterate on the idea quickly. Sinatra is great for deploying prototypes too!</span></p>
<p>At FiveRuns, we use Sinatra as the API endpoint for Dash. We’ve got hundreds of clients in our public beta sending custom metrics to Dash once a minute. Sinatra has handled this load with aplomb. Further, because our API is just a few URL endpoints, <span style="background-color: #FFFFCC;">Sinatra’s minimal API is a perfect match for our needs.</span> <a href="http://rubylearning.com/blog/2009/03/03/interview-adam-keys-on-sinatra/">Read Adam&#8217;s interview on Sinatra</a>.</p>
<p class="block"><img class="alignright" title="Andrew Neil" src="http://rubylearning.com/images/nelstrom-125.jpg" alt="Andrew Neil" /><strong><a href="http://twitter.com/nelstrom">Andrew Neil</a>&gt;&gt;</strong> <a href="http://all-sorts.org/">All Sorts</a> searches Twitter every minute for the <a href="http://search.twitter.com/search?q=%23collectivenouns">#collectivenouns</a> hashtag, then parses matching tweets to identify collective nouns. The requirements were very simple &#8211; no user log in, no CRUD, only a handful of models and routes &#8211; so Sinatra was the perfect choice for this project. I took Nick Plante&#8217;s <a href="http://github.com/zapnap/retweet/tree/master">retweet</a> source as a starting point, which proved to be an excellent introduction to Sinatra and DataMapper. Part of the appeal, of course, was to dabble with new technologies. The live site runs on passenger, with Rack::Cache taking care of the caching.</p>
<p class="block"><img class="alignleft" title="Bruno Miranda" src="http://rubylearning.com/images/bruno.jpg" alt="Bruno Miranda" /><strong><a href="http://twitter.com/brupm">Bruno Miranda</a>&gt;&gt;</strong> I am using Sinatra on a url shortner app that I wrote at <a href="http://s.bopia.com/">s.bopia.com</a> as well as a proxy app that processes beanstalkd queue items for <a href="http://mx.msn.cyloop.com/">mx.msn.cyloop.com</a>. <span style="background-color: #FFFFCC;">Sinatra is a great tool to accomplish small tasks as a minimal layer on top of http protocol.</span></p>
<p class="block"><img class="alignright" title="Chris Strom" src="http://rubylearning.com/images/chris_strom.jpg" alt="Chris Strom" /><strong><a href="http://twitter.com/eee_c">Chris Strom</a>&gt;&gt;</strong> I am using Sinatra most prominently to serve up my family&#8217;s cookbook, backed by a CouchDB store. Excruciating details on how I do this are contained in a series of blog posts starting with: <a href="http://japhr.blogspot.com/2009/03/my-chain.html">http://japhr.blogspot.com/2009/03/my-chain.htm</a>.</p>
<p>I chose Sinatra because it felt close to the metal &#8212; especially important because I did not want anything interfering with CouchDB. I continue to use Sinatra because it complements my BDD workflow exceedingly well. <span style="background-color: #FFFFCC;">Sinatra&#8217;s lean DSL encourages me to produce similarly beautiful code. Sinatra never gets in my way. Sinatra goes out of its way to make my life simple.</span></p>
<p class="block"><img class="alignleft" title="Corey Donohoe" src="http://rubylearning.com/images/CoreyDonohoe.jpg" alt="Corey Donohoe" /><strong><a href="http://twitter.com/atmos">Corey Donohoe</a>&gt;&gt;</strong> <span style="background-color: #FFFFCC;">Sinatra is great for building non-trivial rack middleware.</span> <a href="http://www.engineyard.com/">We&#8217;re mainly using Sinatra</a> for integration applications between existing pieces of software. Instead of working on a monolithic app we&#8217;re writing a fleet of microapps to handle arising business needs. We feel that Sinatra gets in the way less frequently than most other frameworks. With cucumber and good development practices we&#8217;re using the same top notch testing tools the Rails guys are using. In my <a href="http://atmos.org/index.php/about/">personal hacking</a> I&#8217;ve been using it as the basis for twitter microapps leveraging twitter&#8217;s oauth API.</p>
<p class="block"><img class="alignright" title="Doug Sparling" src="http://www.rubylearning.com/images/doug_sparling.jpg" alt="Doug Sparling" /><strong><a href="http://twitter.com/scriptrunner">Doug Sparling</a>&gt;&gt;</strong> In my former company, we had started using <em>Sinatra for web services</em> and in one instance, a small app used for mobile advertising that doesn&#8217;t use the database.</p>
<p>1) <b>Why?</b> &#8211; <span style="background-color: #FFFFCC;">We don&#8217;t always need the full Rails stack, particularly with web services and anything that doesn&#8217;t require the database. It&#8217;s also useful for use with legacy databases, which we have to deal with. I can use Datamapper, which is thread safe (though I haven&#8217;t seen any performance issues with Rails, which we usually cache anyway).</span><br />2) <b>How?</b> &#8211; We use Mongrel clusters for our Rails web sites, but with the Sinatra apps we&#8217;re using Passenger. For our Sinatra web services, I use Datamapper ORM. I have one internal web service in Rails 2.3.2, but I&#8217;m looking at moving it to Sinatra as well.<br />3) <b>Where?</b> &#8211; Mostly internal web services at the moment, but I&#8217;m sure we&#8217;ll look at it for external services as well.</p>
<p class="block"><img class="alignleft" title="Jeremy Evans" src="http://rubylearning.com/images/jeremy-125.jpg" alt="Jeremy Evans" /><strong><a href="http://code.jeremyevans.net/">Jeremy Evans</a>&gt;&gt;</strong> I use Sinatra on quite a few projects, mostly for small applications. At work, we use it to handle the dynamic portion of our mostly static public website, and for some internal applications. Personally, I use it in <a href="http://github.com/jeremyevans/giftsmas/tree/master">Giftsmas</a>, my open source gift-tracking application, and in a couple of other sites I maintain.</p>
<p><span style="background-color: #FFFFCC;">I use Sinatra because it is simple and flexible. It doesn&#8217;t require boilerplate code, and lets you focus on the needs of your application.</span></p>
<p class="block"><img class="alignright" title="Graham Ashton" src="http://www.rubylearning.com/images/graham-ashton.jpeg" alt="Graham Ashton" /><strong><a href="http://twitter.com/grahamashton">Graham Ashton</a>&gt;&gt;</strong> I first tried Sinatra during an in house &#8220;hack week&#8221; at <a href="http://www.wordtracker.com/">Wordtracker</a> (one of my main Rails clients). We used Sinatra to great effect to throw up a user interface for a new keyword research tool that we&#8217;d come up with during hack week. <span style="background-color: #FFFFCC;">Sinatra was very accessible &#8211; the docs are well written and the mailing list is friendly. I quickly gained a lot of confidence in the framework by reading the code, which is succinct and easy to follow</span> (I wish more projects would follow the advice of the Linux kernel coding style and wrap their code at 80 columns &#8211; it encourages legibility).</p>
<p>After that experience Sinatra was an obvious choice for Nesta, my <a href="http://effectif.com/nesta">file based CMS</a>. It&#8217;s a simple app and Sinatra is a perfect fit for it. I had the application up and running in a matter of days, and I really enjoyed writing it. The goal of Nesta was to build a CMS that people could easily modify to suit their own web sites, and Sinatra makes it very easy for people to do that. There&#8217;s not a lot of ceremony.</p>
<p>I still use Rails for larger apps, but I&#8217;m now turning to Sinatra first whenever I want to try something out, or if I&#8217;m not sure where a new application is going. It&#8217;s more fun.</p>
<p class="block"><img class="alignleft" title="Hasham Malik" src="http://rubylearning.com/images/hasham_small.jpg" alt="Hasham Malik" /><strong><a href="http://twitter.com/hasham2">Hasham Malik</a>&gt;&gt;</strong> I have recently started development with the Sinatra micro framework while working at <a href="http://www.cambridgedocs.com/">CambridgeDocs</a>. Earlier we have used PHP / Ruby on Rails for server-side back ends of native iphone applications that we have been developing. <span style="background-color: #FFFFCC;">Sinatra lets you create REST based services with minimalistic approach which is ideal of mobile  back ends. Sinatra is also lean and fast and at the same time it gives you the liberty to use whichever ORM / templating system you want.</span> Sinatra has this positive vibe among Rubyists these days with 1.0 nearing its release its great time to learn this new framework.</p>
<p class="block"><img class="alignright" title="James Edward Gray II" src="http://grayproductions.net/images/james_headshot_square.jpg" alt="James Edward Gray II" /><strong><a href="http://twitter.com/JEG2">James Edward Gray II</a>&gt;&gt;</strong> At <a href="http://highgroove.com/">Highgroove Studios</a>, Sinatra is a vital part of the architecture of our monitoring application, <a href="http://scoutapp.com/">Scout</a>. We provide the API the agents use to check-in with data via the micro framework. This is nice because it separates the two functions of the application, allowing us to do things like deploy an application update without interrupting the API service. Still <span style="background-color: #FFFFCC;">Sinatra gives us a touch more abstraction than something like Rails Metal would and that makes working on the API a little easier.</span></p>
<p class="block"><img class="alignleft" title="Jeremy Raines" src="http://rubylearning.com/images/face_small2.jpg" alt="Jeremy Raines" /><strong><a href="http://twitter.com/jraines">Jeremy Raines</a>&gt;&gt;</strong> I&#8217;m a web developer in Park City, Utah. I got started using Sinatra because I was interested in REST and <span style="background-color: #FFFFCC;">I like the way Sinatra maps controller actions to HTTP verbs. I also love its lightweight simplicity. It&#8217;s great for doing small API based webapps and mashups.</span> Most of my Sinatra apps use Ruby scripts fired by cron jobs to pull data from other webservices into a SQLite database, and serve content with Sinatra. I&#8217;ll be using it more in my work with Purple Raincloud, a new social media consultancy here in Utah. I&#8217;m @jraines on Twitter, and my homepage is at <a href="http://jeremyraines.com/">jeremyraines.com</a>.</p>
<p class="block"><img class="alignright" title="Julio Javier Cicchelli" src="http://www.rubylearning.com/images/jjcicchelli.jpg" alt="Julio Javier Cicchelli" /><strong><a href="http://twitter.com/monsieur_rock">Julio Javier Cicchelli</a>&gt;&gt;</strong> First of all, I like the idea to write about Sinatra and, especially, to show its practical uses to the masses. There are a whole lot of Rails developers but nobody seems to be taking Sinatra quite seriously (at least, this is what I&#8217;ve been noticing in websites such as <a href="http://jobs.rubynow.com/">jobs.rubynow.com</a>).</p>
<p>I&#8217;ve just founded a company called &#8220;<a href="http://rock-n-code.com/">Rock &amp; Code</a>&#8221; in Amsterdam, The Netherlands that offers solutions developed on Sinatra (instead of Rails or even Merb) to my partners. Why you would ask? <span style="background-color: #FFFFCC;">Sinatra have definitely broken the MVC paradigm (widely implemented by frameworks such as Rails, Merb, Django, Spring, etc.) and decided to give total control back to the developer by allowing him to build almost any kind of web-based solution (no matter the complexity) in a very simple manner on top of the abstracted HTTP layer it implements from Rack. Furthermore, Sinatra applications can make use of the existing gem library instead of consuming plug-ins specifically-designed for a particular framework.</span> How my company is using Sinatra? I&#8217;m currently developing RESTful web services that uses CouchDB and communicates with clients written in both MacRuby and iPhone (in the near future) using JSON but I&#8217;ve planned to use Sinatra in web development and also server interfacing. Where can it be applied? I believe that Sinatra suits perfectly for prototyping, client-server applications, SOA applications and interfacing servers, for starters.</p>
<p class="block"><img class="alignleft" title="Karel Minarík" src="http://www.rubylearning.com/images/karmi_mugshot.jpg" alt="Karel Minarík" /><strong><a href="http://twitter.com/karmiq">Karel Minarík</a>&gt;&gt;</strong> <span style="background-color: #FFFFCC;">Sinatra</span> powers <a href="http://www.restafari.org/">my blog</a>, deployment automation, internal apps and <span style="background-color: #FFFFCC;">is generally the tool of choice whenever I need to build a web app without overhead. Sinatra excels when doing &#8220;freestyle coding&#8221; &#8212; it&#8217;s a sort of a blank canvas: you&#8217;re bound only by HTTP and your Ruby knowledge. Sinatra doesn&#8217;t force anything on you, which can lead to awesome or evil code, in equal measures &#8212; and that&#8217;s part of its charm to me. Sinatra exposes you to Rack intensely, though, which brings rather different mindset for building web applications then the prevailing &#8220;monolithic&#8221; style.</span> See eg. <a href="http://github.com/rack/rack-contrib/tree/master">www.github.com/rack/rack-contrib</a> for inspiration.</p>
<p class="block"><strong><a href="http://twitter.com/cypher">Markus Prinz</a>&gt;&gt;</strong> I use Sinatra because it concentrates on one area, and does that very well, leaving the rest up to me. So <span style="background-color: #FFFFCC;">whenever I have some idea that requires a web app, I can try it out very quickly with Sinatra with a minimum of fuss.</span> And since Sinatra is not a one-size-fits-all solution, but instead essentially a library, I have a great deal of flexibility in using it. That means I can try out new approaches to things like data storage, and use something like Tokyo Cabinet/Tokyo Tyrant or CouchDB instead of a relational database. But <span style="background-color: #FFFFCC;">I can also use Sinatra as a component in a larger application to offer a web interface, without interfering with the rest of the application.</span></p>
<p class="block"><img class="alignright" title="Matt Todd" src="http://highgroove.com/images/about/mtodd.jpg" alt="Matt Todd" /><strong><a href="http://twitter.com/mtodd">Matt Todd</a>&gt;&gt;</strong> We at @highgroove (<a href="http://highgroove.com/">Highgroove Studios</a>) <span style="background-color: #FFFFCC;">use Sinatra in a lot of different projects for memory-efficient web services.</span> One of our products, <a href="http://scoutapp.com/">Scout</a> (@scoutapp) uses it to consume thousands of reports constantly. We are able to fine tune our stack with Sinatra to keep it minimal, responsive, and powerful.</p>
<p>Highgroove Studios is Charles Brian Quinn (@seebq), Derek Haynes (@dhaynes23), Andre Lewis (@alewis), James Edward Gray II (@JEG2), and myself, Matt Todd (@mtodd).</p>
<p class="block"><img class="alignleft" title="Nick Plante" src="http://www.rubylearning.com/images/nap.jpg" alt="Nick Plante" /><strong><a href="http://twitter.com/zapnap">Nick Plante</a>&gt;&gt;</strong> We&#8217;re using Sinatra for a variety of small web sites and services. Why? Because <span style="background-color: #FFFFCC;">Sinatra is small, RESTful, fast, and intuitive. It&#8217;s perfect for lightweight apps and APIs.</span></p>
<p>One of our sites, <a href="http://rdoc.info/">rdoc.info</a>, uses it to generate and host documentation for a variety of Ruby libraries, integrating with GitHub web hooks to automatically regenerate docs whenever projects are updated. We could have used Rails, but the additional overhead, helpers, and other extras that come pre-packaged with it just weren&#8217;t necessary. In fact, they would have probably gotten in our way.</p>
<p><a href="http://tweetdreams.org/">Tweetdreams</a> is another small Sinatra-based project that we launched earlier this year. It&#8217;s a Twitter dream journal. There really isn&#8217;t much to it, which is sort of the beauty of it. The source is available on GitHub as &#8220;<a href="http://github.com/zapnap/retweet/tree/master">retweet</a>&#8221; and it&#8217;s been used as the basis for a number of other Twitter-oriented projects including the <a href="http://all-sorts.org/">http://all-sorts.org</a> linguistic experiment created by Andrew Neil.</p>
<p>I should note that both of these projects use DataMapper and Haml, too. <span style="background-color: #FFFFCC;">Sinatra is ORM and templating language agnostic, which can be another bonus if you already have a predefined set of tools that you&#8217;re familiar with and want to use.</span></p>
<p class="block"><img class="alignright" title="Peter Cooper" src="http://www.rubylearning.com/images/petercooper.jpg" alt="Peter Cooper" /><strong><a href="http://twitter.com/peterc">Peter Cooper</a>&gt;&gt;</strong> As I don&#8217;t work on big projects, I&#8217;m using Sinatra for everything now, where I would have used Rails before. It&#8217;s nearly all local or private stuff for now but I&#8217;d like to be able to release more community projects using it in due course. <span style="background-color: #FFFFCC;">I love Sinatra because it&#8217;s less opinionated and more Ruby-like than Rails. It might take me a little longer to achieve certain results but I can &#8220;plug and play&#8221; code, libraries, and frameworks wherever I like with it, rather than have to work around tightly coupled &#8220;conventions.&#8221;</span></p>
<p class="block"><img class="alignleft" title="Piyush Gupta" src="http://www.rubylearning.com/images/PiyushGupta.jpg" alt="Piyush Gupta" /><strong><a href="http://twitter.com/mba_piyush">Piyush Gupta</a>&gt;&gt;</strong> When your application is small, Sinatra helps us to develop applications quickly and easily. <span style="background-color: #FFFFCC;">Sinatra is easy to understand and follow.</span> We have recently used it for a twitter mashup called MillionTwitter Follower which is not yet live. Expecting it to be live soon.</p>
<p class="block"><img class="alignright" title="Sam Goebert" src="http://www.rubylearning.com/images/sam.jpg" alt="Sam Goebert" /><strong><a href="http://twitter.com/bigcurl">Sam Goebert</a>&gt;&gt;</strong> <a href="http://www.bigcurl.de/">Bigcurl</a> uses Sinatra to power its <a href="http://www.httpush.com/">HTTPush API</a>, which is a hosted gateway to the Apple Push Notification Service. Our complete api frontend is implemented using Sinatra. This gave us a tremendous boost during development of the API specification. We were able to experiment more as the code has very few lines. Second reason we went with Sinatra was memory consumption, since we span lot of instances over the course of a day this was crucial to get the maximum out of a machine but maintaining the beauty in code.</p>
<p class="block"><img class="alignleft" title="Sau Sheong Chang" src="http://www.rubylearning.com/images/sau.jpg" alt="Sau Sheong Chang" /><strong><a href="http://twitter.com/sausheong">Sau Sheong Chang</a>&gt;&gt;</strong> I picked up Sinatra first when I was writing my <a href="http://blog.saush.com/2009/03/write-an-internet-search-engine-with-200-lines-of-ruby-code/">search engine</a> and I was looking for a simple way to write my search engine interface. The simplicity of Sinatra blew me away and I was soon knee-deep into writing more apps on Sinatra. After a few more applications, I was convinced that <span style="background-color: #FFFFCC;">Sinatra is the way to write web applications as it is meant to be.</span> Today I use it to write quick and simple web applications, often in combination with DataMapper, that serve as front-end interfaces for larger systems.</p>
<p class="block"><img class="alignright" title="Saurabh Purnaye" src="http://www.rubylearning.com/images/saurabhpurnaye.jpg" alt="Saurabh Purnaye" /><strong><a href="http://twitter.com/saurabhp">Saurabh Purnaye</a>&gt;&gt;</strong> I work for Synechron, Pune. The applications we create are mostly UI based (html/css/jquery and flex), and I need web services to respond to the calls from UI &#8211; that&#8217;s where I use Sinatra. <span style="background-color: #FFFFCC;">Sinatra is really fast and easy for providing RESTful web service solutions.</span> There are many options while working with Sinatra &#8211; for example Database: ORM (datamapper/active record), Templating: (erb/haml/builder), http caching, filters, helpers and error handling. One of it&#8217;s best features is it comes with Rack middleware. For the last 6 months I am using Sinatra and I feel very happy to work with it.</p>
<h3>Do YOU use Sinatra?</h3>
<p>If you are a Rubyist using Sinatra, <em>we would like to know as to why, how and where you are using Sinatra</em>. Post this as a blog comment. Thanks.</p>
<p class="alert"><strong><em>Post supported by 1st Easy Limited</em>:</strong> UK based 1st Easy Limited offer Sinatra and Rails hosting running on a Phusion Passenger (mod_rails) and LAMP stack. If you want to get to know them first, or simply want to try out your Sinatra or Rails skills, <a href="http://www.1steasy.com/ruby-on-rails.htm#try">let them arrange a free trial hosting account</a> for you &#8211; full technical support from their team is included!</p>
</div>
<p>Technorati Tags: <a href="http://technorati.com/tag/Rubyists+Using+Sinatra" rel="tag">Rubyists Using Sinatra</a>, <a href="http://technorati.com/tag/Ruby+Programming" rel="tag">Ruby Programming</a>, <a href="http://technorati.com/tag/Rubyists" rel="tag">Rubyists</a>, <a href="http://technorati.com/tag/Sinatra" rel="tag">Sinatra</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=i1gHee1x-BY:gRKt9WCuSPw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LearningRubyBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=i1gHee1x-BY:gRKt9WCuSPw:MclgosYkiZA"><img src="http://feeds.feedburner.com/~ff/LearningRubyBlog?i=i1gHee1x-BY:gRKt9WCuSPw:MclgosYkiZA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://rubylearning.com/blog/2009/06/29/20-rubyists-using-sinatra-do-you/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Follow 10+ Rubyists using Sinatra on Twitter</title>
		<link>http://rubylearning.com/blog/2009/06/24/follow-10-rubyists-using-sinatra-on-twitter/</link>
		<comments>http://rubylearning.com/blog/2009/06/24/follow-10-rubyists-using-sinatra-on-twitter/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 10:12:32 +0000</pubDate>
		<dc:creator>Satish Talim</dc:creator>
				<category><![CDATA[Popular]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby Masters]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[Ruby Beginners]]></category>
		<category><![CDATA[Rubyists]]></category>
		<category><![CDATA[The Ruby Programming Language]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://rubylearning.com/blog/?p=2387</guid>
		<description><![CDATA[
What&#8217;s Twitter?

The New York Times says:
Twitter is a simple messaging service that you&#8217;ve either heard about a lot or not at all. Either way, it&#8217;s a fun and useful tool, well worth trying if you want to reach potential and existing customers, employees or employers.

List of Rubyists Using Sinatra
This list of over 10 Rubyists using [...]]]></description>
			<content:encoded><![CDATA[<p></p><div>
<h3>What&#8217;s Twitter?</h3>
<p><img class="alignright" src="http://rubylearning.com/images/icon_d.png" alt="Twitter" title="http://twitter.com/IndianGuru" width="128" height="128" /></p>
<p><a href="http://shiftingcareers.blogs.nytimes.com/2008/09/07/how-twitter-can-help-at-work/?excamp=GGSBtwitternews&amp;WT.srch=1&amp;WT.mc_ev=click&amp;WT.mc_id=SB-S-E-GG-NA-S-twitter_news">The New York Times</a> says:</p>
<blockquote><p><a href="http://www.twitter.com/">Twitter</a> is a simple messaging service that you&#8217;ve either <a href="http://query.nytimes.com/search/sitesearch?query=twitter&amp;srchst=cse">heard about a lot</a> or <a href="http://kara.allthingsd.com/20080428/twitter-where-nobody-know-your-name/">not at all</a>. Either way, it&#8217;s a fun and useful tool, well worth trying if you want to reach potential and existing customers, employees or employers.</p>
</blockquote>
<h3>List of Rubyists Using Sinatra</h3>
<p>This list of over 10 Rubyists using Sinatra, is in alphabetical order, with a link to their Twitter profile. The following list is <em>not</em> intended to be all-inclusive, but it should give you a great start to following some talented Rubyists using Sinatra.</p>
<ol>
<li>Aaron Quint &#8211; <a href="http://twitter.com/aq">aq</a></li>
<li>Adeel Ahmad &#8211; <a href="http://twitter.com/_adeel">_adeel</a></li>
<li>Andre Lewis &#8211; <a href="http://twitter.com/alewis">alewis</a></li>
<li>Andrew Neil &#8211; <a href="http://twitter.com/nelstrom">nelstrom</a></li>
<li>Arjun Ram &#8211; <a href="http://twitter.com/arjunram">arjunram</a></li>
<li>August Lilleaas &#8211; <a href="http://twitter.com/augustl">augustl</a></li>
<li>Barry Hess &#8211; <a href="http://twitter.com/bjhess">bjhess</a></li>
<li>Bill Siggelkow &#8211; <a href="http://twitter.com/bsiggelkow">bsiggelkow</a></li>
<li><em>Blake Mizerany &#8211; <a href="http://twitter.com/bmizerany">bmizerany</a></em></li>
<li>Brian Deterling &#8211; <a href="http://twitter.com/bdeter">bdeter</a></li>
<li>Bruno Miranda &#8211; <a href="http://twitter.com/brupm">brupm</a></li>
<li>Charles Brian Quinn &#8211; <a href="http://twitter.com/seebq">seebq</a></li>
<li>Chris Strom &#8211; <a href="http://twitter.com/eee_c">eee_c</a></li>
<li>Corey Donohoe &#8211; <a href="http://twitter.com/atmos">atmos</a></li>
<li>Damon Clinkscales &#8211; <a href="http://twitter.com/damon">damon</a></li>
<li>Dan Croak &#8211; <a href="http://twitter.com/dancroak">dancroak</a></li>
<li>Dan Mayer &#8211; <a href="http://twitter.com/danmayer">danmayer</a></li>
<li>David Balatero &#8211; <a href="http://twitter.com/dbalatero">dbalatero</a></li>
<li>Derek Haynes &#8211; <a href="http://twitter.com/dhaynes23">dhaynes23</a></li>
<li>Doug Sparling &#8211; <a href="http://twitter.com/scriptrunner">scriptrunner</a></li>
<li>Foy Savas &#8211; <a href="http://twitter.com/foysavas">foysavas</a></li>
<li>Graham Ashton &#8211; <a href="http://twitter.com/grahamashton">grahamashton</a></li>
<li>Hasham Malik &#8211; <a href="http://twitter.com/hasham2">hasham2</a></li>
<li>James Edward Gray II &#8211; <a href="http://twitter.com/JEG2">JEG2</a></li>
<li>Jean-Daniel Tanguay &#8211; <a href="http://twitter.com/jeedee">jeedee</a></li>
<li>Jeremy Raines &#8211; <a href="http://twitter.com/jraines">jraines</a></li>
<li>Jesse Cooke &#8211; <a href="http://twitter.com/jc00ke">jc00ke</a></li>
<li>Joe Ferris &#8211; <a href="http://twitter.com/joeferris">joeferris</a></li>
<li>Julio Javier Cicchelli &#8211; <a href="http://twitter.com/monsieur_rock">monsieur_rock</a></li>
<li>Justin Britten &#8211; <a href="http://twitter.com/jbritten">jbritten</a></li>
<li>Karel Minarik &#8211; <a href="http://twitter.com/karmiq">karmiq</a></li>
<li>Logan Koester &#8211; <a href="http://twitter.com/logankoester">logankoester</a></li>
<li>Luke Francl &#8211; <a href="http://twitter.com/lof">lof</a></li>
<li>Marcin Kulik &#8211; <a href="http://twitter.com/sickill">sickill</a></li>
<li>Matt Todd &#8211; <a href="http://twitter.com/mtodd">mtodd</a></li>
<li>Mike Demers &#8211; <a href="http://twitter.com/mikedemers">mikedemers</a></li>
<li>Nick Plante &#8211; <a href="http://twitter.com/zapnap">zapnap</a></li>
<li>Nick Quaranto &#8211; <a href="http://twitter.com/qrush">qrush</a></li>
<li>Peter Cooper &#8211; <a href="http://twitter.com/peterc">peterc</a></li>
<li>Piyush Gupta &#8211; <a href="http://twitter.com/mba_piyush">mba_piyush</a></li>
<li>Richard Taylor &#8211; <a href="http://twitter.com/moomerman">moomerman</a></li>
<li><em>Ryan Tomayko &#8211; <a href="http://twitter.com/rtomayko">rtomayko</a></em></li>
<li>Sam Goebert &#8211; <a href="http://twitter.com/bigcurl">bigcurl</a></li>
<li>Sau Sheong Chang &#8211; <a href="http://twitter.com/sausheong">sausheong</a></li>
<li>Saurabh Purnaye &#8211; <a href="http://twitter.com/saurabhp">saurabhp</a></li>
<li>Trevor Bramble &#8211; <a href="http://twitter.com/">TrevorBramble</a></li>
<li>Vishnu Gopal &#8211; <a href="http://twitter.com/vishnugopal">vishnugopal</a></li>
</ol>
<p class="note">The following list is <strong>Not &#8220;Rubyists&#8221; per-se, but should still be of interest</strong>:</p>
<ol>
<li>FiveRuns &#8211; <a href="http://twitter.com/fiveruns">fiveruns</a></li>
<li>taazza &#8211; <a href="http://twitter.com/taazza">taazza</a></li>
<li>thoughtbot &#8211; <a href="http://twitter.com/thoughtbot">thoughtbot</a></li>
</ol>
<p><strong><span style="color:red;">Note:</span></strong> Keep the feedback coming in. We will update the list based on your recommendations.</p>
<p class="alert"><strong>Have we missed out any <em>Rubyists who are using Sinatra</em>?<br />You can help</strong>. Please feel free to add a link to a Rubyist&#8217;s Twitter profile. We would love to hear why you think the particular Rubyist is important to Twitter with. Also, do add a link to your Twitter profile in the comments.</p>
</div>
<p>Technorati Tags: <a href="http://technorati.com/tag/Ruby" rel="tag">Ruby</a>, <a href="http://technorati.com/tag/Rubyists" rel="tag">Rubyists</a>, <a href="http://technorati.com/tag/Ruby+Beginners" rel="tag">Ruby Beginners</a>, <a href="http://technorati.com/tag/Ruby+Masters" rel="tag">Ruby Masters</a>, <a href="http://technorati.com/tag/The+Ruby+Programming+Language" rel="tag">The Ruby Programming Language</a>, <a href="http://technorati.com/tag/Sinatra" rel="tag">Sinatra</a>, <a href="http://technorati.com/tag/Twitter" rel="tag">Twitter</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=ll-tGm6pVKQ:79kLc3q44Mg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LearningRubyBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=ll-tGm6pVKQ:79kLc3q44Mg:MclgosYkiZA"><img src="http://feeds.feedburner.com/~ff/LearningRubyBlog?i=ll-tGm6pVKQ:79kLc3q44Mg:MclgosYkiZA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://rubylearning.com/blog/2009/06/24/follow-10-rubyists-using-sinatra-on-twitter/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Want to create a Sinatra Web Service?</title>
		<link>http://rubylearning.com/blog/2009/06/23/want-to-create-a-sinatra-web-service/</link>
		<comments>http://rubylearning.com/blog/2009/06/23/want-to-create-a-sinatra-web-service/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 00:52:12 +0000</pubDate>
		<dc:creator>Satish Talim</dc:creator>
				<category><![CDATA[Heroku]]></category>
		<category><![CDATA[Popular]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[ruby programming]]></category>
		<category><![CDATA[Sinatra tutorial]]></category>
		<category><![CDATA[Sinatra web service]]></category>
		<category><![CDATA[sorter]]></category>

		<guid isPermaLink="false">http://rubylearning.com/blog/?p=2302</guid>
		<description><![CDATA[
With Sinatra you can quickly create your own tiny web-applications in Ruby and write lots of small services.
Problem definition
To upload a text file to a Sinatra web service and have its sorted content returned.
How to upload a file from the command line?
We shall use cURL, a tool and library designed to give you a user-friendly [...]]]></description>
			<content:encoded><![CDATA[<p></p><div>
<p class="alert">With <strong>Sinatra</strong> you can quickly create your own tiny web-applications in Ruby and write lots of small services.</p>
<h3>Problem definition</h3>
<p>To upload a text file to a <strong>Sinatra web service</strong> and have its sorted content returned.</p>
<h3>How to upload a file from the command line?</h3>
<p>We shall use <strong>cURL</strong>, a tool and library designed to give you a user-friendly but low-level interface to making HTTP requests. cURL also supports many other protocols related to uploading and downloading files.</p>
<p>In case you have not used cURL, please <a href="http://rubylearning.com/data/cURL.pdf">download this note on cURL</a>. It explains how you can download, install and use cURL.</p>
<p>The actual command from the command prompt to upload a text file to a <em>Sinatra web service</em> is:</p>
<pre>curl -F "info=@alpha.txt" localhost:4567/sorter</pre>
<p>Let&#8217;s look at the above command in more detail:</p>
<ul>
<li>The cURL -F option lets cURL emulate a filled-in form in which a user has pressed the submit button. This causes curl to POST data. This also enables uploading of binary files etc. To force the &#8216;content&#8217; part to be a file, we prefix the file name with an @ sign.</li>
<li>alpha.txt is our text file to be uploaded. You can check the contents of this file <a href="http://rubylearning.com/data/alpha.txt">from here</a>.</li>
<li>info is the name of the form-field to which alpha.txt will be the input.</li>
<li>Our Sinatra web service will be running on localhost:4567/sorter</li>
</ul>
<h3>Sorter Sinatra Web Service</h3>
<p>Our <em>Sinatra web service</em> is very simple. The contents of the program <b>sorter.rb</b> are:</p>
<pre># sorter.rb
require 'sinatra'

# Usage: curl -F "info=@alpha.txt" localhost:4567/sorter
post '/sorter' do
  params[:info][:tempfile].readlines.sort
end</pre>
<ul>
<li>Handler is the generic term that Sinatra uses for the &#8220;controllers&#8221;. A handler is the initial point of entry for new HTTP requests into your application. In handlers you can reach submitted form parameters directly via the <b>params</b> hash. The support of Rails like nested parameters is built-in since Sinatra. Therefore in handlers you can use nested parameters like a regular hash: <b>params[:info][:tempfile]</b></li>
<li>The Ruby method <b>readlines</b> reads the entire file as individual lines and returns those lines in an array.</li>
<li>The <b>Array.sort</b> method, sorts our array contents.</li>
</ul>
<h3>Starting the Sorter Sinatra Web Service</h3>
<p>Open a new command window and change the folder to the folder that contains your file &#8211; <b>sorter.rb</b>. Next type:</p>
<pre>ruby sorter.rb</pre>
<p>Now open another command window and change the folder to the folder that contains your file &#8211; <b>alpha.txt</b>. Next type in our cURL command, namely:</p>
<pre>curl -F "info=@alpha.txt" localhost:4567/sorter</pre>
<p>The command window where you typed in your cURL command should get the results, namely:</p>
<pre>apple
birthday
cat
pune
xmas
yen
zebra</pre>
<h4>Use my Sorter Sinatra Web Service</h4>
<p>For your pleasure, I have created the Sorter <em>Sinatra Web Service</em> on <a href="http://heroku.com/">Heroku</a> (it&#8217;s free). You can use this <em>Sorter Sinatra Web Service</em> service anytime you want. Open a command window and change your folder to the folder containing the file <b>alpha.txt</b>. Next type in the following cURL command:</p>
<pre>curl -F "info=@alpha.txt" falling-stream-54.heroku.com/sorter</pre>
<p>The command window where you typed in this cURL command should display the desired results.</p>
<p><span style="background-color: #FFFFCC;">Remember to have fun with <strong>Sinatra</strong>!</span></p>
<h4>Credits</h4>
<ul>
<li>Michael C. Morin for the note on cURL.</li>
<li>Jonathan Palardy whose blog post inspired me to write this article.</li>
</ul>
</div>
<p>Technorati Tags: <a href="http://technorati.com/tag/cURL" rel="tag">cURL</a>, <a href="http://technorati.com/tag/Sinatra" rel="tag">Sinatra</a>, <a href="http://technorati.com/tag/Sinatra+web+service" rel="tag">Sinatra web service</a>, <a href="http://technorati.com/tag/Ruby+programming" rel="tag">Ruby programming</a>, <a href="http://technorati.com/tag/sorter" rel="tag">sorter</a>, <a href="http://technorati.com/tag/Heroku" rel="tag">Heroku</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=hGA_jPq4JUw:zIszSNTT6IU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LearningRubyBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=hGA_jPq4JUw:zIszSNTT6IU:MclgosYkiZA"><img src="http://feeds.feedburner.com/~ff/LearningRubyBlog?i=hGA_jPq4JUw:zIszSNTT6IU:MclgosYkiZA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://rubylearning.com/blog/2009/06/23/want-to-create-a-sinatra-web-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
