Your SlideShare is downloading. ×
0
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Your first sinatra app
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Your first sinatra app

2,065

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,065
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
18
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Your first Sinatra app Create a basic Sinatra web, in just 2 minutes ..or less
  • 2. Thursday, February 3, 2011Mario Zaizar@ Twitter, Github, Facebook, **
  • 3. Thursday, February 3, 201106:18pm(finished at)Mario Zaizar@ Twitter, Github, Facebook, *.*
  • 4. ok,o_O Sinatra?
  • 5. Sinatra is.Is a Ruby web frameworkIts written in Ruby. dah Its based in URLs, get, put, delete.. Sinatra is a very simple, yet powerful, Domain Specific Language (DSL) +RESTfulhttp://www.sinatrarb.com/
  • 6. AdvantagesIts, simple, only have what you need.Better performance than Rails. You can use gems. There is life beyond Rails.Templates, Views, supports *all of them. good for? API implmentations, quick demos, minimal applications, widgets..
  • 7. DisadvantagesNo Rails mystical magic, forgot it.Everything from scratch, only your needs.Isnt the best MVC frameworkNot so popular, than others
  • 8. Lets go!Installing the core, yeah, well need rocks, stars, and mud Create a folder, install ruby, group all the gems in a single gemset.
  • 9. Define which ruby, your gemset name,and enable them by default.* rvm is your only friend.$ mkdir ~/rubyc/ && cd ~/rubyc;$ touch .rvmrc && open .rvmrc;Paste:rvm 1.9.1@rubyc --createReload your bash, let rvm bring the magic!
  • 10. Manage your gems with Gemfile andBundlerInstall bundler, use a Gemfile to declare all your required gems,repositories, version locking stuff, etc.$ gem install bundler;$ touch Gemfile && open Gemfile;Paste :source :rubygemsgem sinatraUse bundler to install and maintain them.$ bundle install;
  • 11. Step 1 / 19Create your App.$ touch rubyc.rb && gedit rubyc.rbPaste:require sinatraget / do "It works!"endget /hi:name do "Hello #{params[:name]}!"end
  • 12. Step 2 to 18Make coffee.
  • 13. Test your App! Step 19 / 19Start the server.$ ruby rubyc.rbOpen it$ open http://localhost:4567 Click me!
  • 14. Thats easy :P
  • 15. Links? ruby lang sinatra framework sinatra and bundler best way
  • 16. Thanks! d(n_n)b ^C == Sinatra has ended his set (crowd applauds) Download me http://bit.ly/dXJn1H

×