From Ruby Installation
                         to Deploy
                            this is gonna hurt your head




Tuesday, October 19, 2010
About Me

                            Speaker.new({
                               :name        =>   "Scotty Motte",
                               :email       =>   "scott@spitfiresky.com",
                               :twitter     =>   "@spitfiresky",
                               :works_on    =>   "http://smartevents.com"
                            })




Tuesday, October 19, 2010
Building Web Apps
                    • Server Side
                            •   Server Side Programming Language - Ruby

                            •   Database - MySQL

                            •   Versioning Software - GIT


                    • Browser Side
                            •   HTML - HAML

                            •   Javascript - jQuery

                            •   AJAX




Tuesday, October 19, 2010
Server Side




Tuesday, October 19, 2010
Programming Languages
                    •       Ruby (writes like english. great community. hotter than
                            your mom. nuff said.)

                    • PHPbrackets)like someone shat all over the page with
                      curly
                            (looks


                    • Java (configuration weirdos)
                    • .NET (put a gun to my head already)
                    • Perl (WTF)
Tuesday, October 19, 2010
Why Ruby
                    • Created by Matz - he’s Japanese
                    • Programmer Happiness! - written for
                            humans not for computers
                    • Easy to read and write
                            5.times { puts "Have some chunky bacon Matz."}

                            ['riverside', 'japan', 'america'].each {|locale|
                            puts locale.capitalize }


                    • Popularized by Ruby on Rails
Tuesday, October 19, 2010
Install Ruby
                    • Mac Users, I say rejoice, for thou haveth
                            Ruby already!
                    • Windows users - are you prejudiced
                             towards Japan or something?! Let’s fix that
                             by installing Ruby:
                            • http://www.ruby-lang.org/en/downloads/ - run the one-click installer
                                and make sure to de-check the SciTE and check enable ruby gems.
                                Important.

                            •   (http://docs.heroku.com/windows) - very helpful. video.


                                                 Remember - friends don’t let friends use internet explorer.
Tuesday, October 19, 2010
Database

                    • Where we store our data
                    • MySQL popular
                    • skip


Tuesday, October 19, 2010
Git
                    • Keeps track of all the code you write
                    • http://code.google.com/p/msysgit/
                            (windows)
                    • http://code.google.com/p/git-osx-installer/
                            (mac)
                    • http://github.com (keep your code safe)

Tuesday, October 19, 2010
Hello World app

                    • [sudo] gem install sinatra
                    • [sudo] gem install unicorn
                    • [sudo] gem install haml
                    • mkdir hello_world
                    • cd hello_world

Tuesday, October 19, 2010
Hello World app cont.
                    • Create and edit app.rb
                              require 'rubygems'
                              require 'sinatra'

                              get '/' do
                                "Hello World!"
                              end




Tuesday, October 19, 2010
Hello World app cont.
                    • Create and edit config.ru file
                             require 'app'
                             run Sinatra::Application




Tuesday, October 19, 2010
Hello World app cont.
                    • Create and edit .gems file for heroku

                            sinatra --version '>= 0.9.4'
                            haml




Tuesday, October 19, 2010
Hello World app cont.

                    • Run the local server: unicorn -p 3000
                    • Browse to: http://localhost:3000/
                    • Congrats! Drink a beer!


Tuesday, October 19, 2010
Deploy


                    • Sign up on Heroku: http://heroku.com
                    • [sudo] gem install heroku


Tuesday, October 19, 2010
Deploy cont.

                    • cd into your hello_world project
                    • git init
                    • git add .
                    • git commit -am “initial import”

Tuesday, October 19, 2010
Deploy cont.


                    • ssh-keygen -C “you@email.com” -t rsa
                    • (leave the passphrase blank unless it’s your
                            computer)




Tuesday, October 19, 2010
Deploy cont.

                    • heroku create
                    • git push heroku master
                    • heroku rename yourchoice
                    • browse to http://yourchoice.heroku.com

Tuesday, October 19, 2010
Deploy cont.
                    • Other things you can do
                       • Add an about page
                       • Switch to haml
                       • Add a layout file
                       • Add images under a public folder
                       • Move onto ajax
Tuesday, October 19, 2010
views/layout.haml
                    !!!
                    %html
                      %head
                        %title Your App
                        %link{:rel=>'stylesheet', :href=>'/stylesheets/
                    layout.css', :type => "text/css"}
                        / javascripts
                        %script{:type => "text/javascript", :src => "/javascripts/
                    jquery.js"}
                        %script{:type => "text/javascript", :src => "/javascripts/
                    index.js"}
                      %body
                        = yield




Tuesday, October 19, 2010
views/index.haml
                               %h1
                                 Hello World!




                                get '/' do
                                  haml :index
                                end




Tuesday, October 19, 2010
Browser Side




Tuesday, October 19, 2010
public/javascripts


                    • Add jquery.js - download from jquery.com
                    • Add index.js


Tuesday, October 19, 2010
public/javascripts/
                                 index.js

                            $(document).ready(function() {
                              alert("It works!");
                            });




Tuesday, October 19, 2010
views/index.haml
             %h1 Hello World

             %h2 Search

             %form{:id => "search_form", :method => "get", :action => "/search"}
               %input{:type => "text", :id => "search_field", :name => "search_field"}
               %input{:type => "submit", :value => "Search", :id => "search_btn"}

             %ul#search_field_value
               %li= @search_field_value




Tuesday, October 19, 2010
app.rb (add route)
                            get '/search' do
                              @search_field_value = params[:search_field]
                              haml :index
                            end




Tuesday, October 19, 2010
public/javascripts/
                                   index.js
                            $(document).ready(function() {
                              $("#search_btn").click(function() {
                                var search_text = $("#search_field").val();
                                alert(search_text);
                                return false;
                              });
                            });




Tuesday, October 19, 2010
public/javascripts/
                                 index.js
                            $(document).ready(function() {
                              $("#search_btn").click(function() {
                                var search_text = $("#search_field").val();
                                // alert(search_text);

                                $.ajax({
                                  url: "/search?search_field="+search_text,
                                  success: function(responseText, statusText, xhr) {
                                     $('#search_field_value').append(responseText);
                                  },
                                  error: function(request, statusText, xhr) {
                                     alert("There was an error!");
                                  }
                                });

                                return false;
                              });
                            });




Tuesday, October 19, 2010
public/javascripts/
                                  index.js
                            get '/search' do
                              @search_field_value = params[:search_field]
                              "<li>#{@search_field_value}</li>"
                            end




Tuesday, October 19, 2010
The End




Tuesday, October 19, 2010

More Related Content

PDF
dojo is bizarro jQuery
PDF
Reef - ESUG 2010
PDF
The Tech Side of Project Argo
PDF
Complex things explained easily
PDF
Mars - ESUG 2010
PDF
iBizLog - ESUG2010
PDF
Debugging your JavaScript
PDF
HTML5 Apps - Cross platform
dojo is bizarro jQuery
Reef - ESUG 2010
The Tech Side of Project Argo
Complex things explained easily
Mars - ESUG 2010
iBizLog - ESUG2010
Debugging your JavaScript
HTML5 Apps - Cross platform

Viewers also liked (8)

PPTX
Map It! 090717
PPT
Epwp E Londen 17 June2008
PPSX
Rubattino Portfolio
PDF
Kon nichi wa_ruby
DOCX
Luke 1 1 4 42.3 mms 03 06 2012 jesus in the old testment
PPT
Belajar cara belajar
Map It! 090717
Epwp E Londen 17 June2008
Rubattino Portfolio
Kon nichi wa_ruby
Luke 1 1 4 42.3 mms 03 06 2012 jesus in the old testment
Belajar cara belajar
Ad

Similar to Presentation to wdim_students (20)

PDF
PDF Ruby on Rails 3 Day BC
PPTX
Adventures of java developer in ruby world
PDF
Frozen Rails Slides
KEY
Ruby on Rails survival guide of an aged Java developer
PDF
Campus Party 2010
KEY
Ruby v cpp_preso
PDF
Calloway introduction
PDF
Red Dirt Ruby Conference
KEY
Ruby On Rails
PDF
Connecting the Worlds of Java and Ruby with JRuby
PDF
Introduction To Google App Engine
PPT
PDF
Oscon 2010
KEY
An introduction to Rails 3
PDF
Crank Up Your Apps With TorqueBox
PDF
Welcome To Ruby On Rails
PDF
Web application intro + a bit of ruby (revised)
PDF
遇見 Ruby on Rails
PDF
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
PDF
Ruby tutorial
PDF Ruby on Rails 3 Day BC
Adventures of java developer in ruby world
Frozen Rails Slides
Ruby on Rails survival guide of an aged Java developer
Campus Party 2010
Ruby v cpp_preso
Calloway introduction
Red Dirt Ruby Conference
Ruby On Rails
Connecting the Worlds of Java and Ruby with JRuby
Introduction To Google App Engine
Oscon 2010
An introduction to Rails 3
Crank Up Your Apps With TorqueBox
Welcome To Ruby On Rails
Web application intro + a bit of ruby (revised)
遇見 Ruby on Rails
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby tutorial
Ad

Recently uploaded (20)

PDF
Abstractive summarization using multilingual text-to-text transfer transforme...
PDF
Consumable AI The What, Why & How for Small Teams.pdf
PPT
What is a Computer? Input Devices /output devices
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PDF
Flame analysis and combustion estimation using large language and vision assi...
PDF
CloudStack 4.21: First Look Webinar slides
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
UiPath Agentic Automation session 1: RPA to Agents
PPTX
Configure Apache Mutual Authentication
PPT
Module 1.ppt Iot fundamentals and Architecture
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
Architecture types and enterprise applications.pdf
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
The influence of sentiment analysis in enhancing early warning system model f...
DOCX
search engine optimization ppt fir known well about this
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PPT
Geologic Time for studying geology for geologist
Abstractive summarization using multilingual text-to-text transfer transforme...
Consumable AI The What, Why & How for Small Teams.pdf
What is a Computer? Input Devices /output devices
Custom Battery Pack Design Considerations for Performance and Safety
Flame analysis and combustion estimation using large language and vision assi...
CloudStack 4.21: First Look Webinar slides
A review of recent deep learning applications in wood surface defect identifi...
UiPath Agentic Automation session 1: RPA to Agents
Configure Apache Mutual Authentication
Module 1.ppt Iot fundamentals and Architecture
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Architecture types and enterprise applications.pdf
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
The influence of sentiment analysis in enhancing early warning system model f...
search engine optimization ppt fir known well about this
Enhancing emotion recognition model for a student engagement use case through...
Zenith AI: Advanced Artificial Intelligence
sustainability-14-14877-v2.pddhzftheheeeee
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
Geologic Time for studying geology for geologist

Presentation to wdim_students

  • 1. From Ruby Installation to Deploy this is gonna hurt your head Tuesday, October 19, 2010
  • 2. About Me Speaker.new({ :name => "Scotty Motte", :email => "[email protected]", :twitter => "@spitfiresky", :works_on => "http://smartevents.com" }) Tuesday, October 19, 2010
  • 3. Building Web Apps • Server Side • Server Side Programming Language - Ruby • Database - MySQL • Versioning Software - GIT • Browser Side • HTML - HAML • Javascript - jQuery • AJAX Tuesday, October 19, 2010
  • 5. Programming Languages • Ruby (writes like english. great community. hotter than your mom. nuff said.) • PHPbrackets)like someone shat all over the page with curly (looks • Java (configuration weirdos) • .NET (put a gun to my head already) • Perl (WTF) Tuesday, October 19, 2010
  • 6. Why Ruby • Created by Matz - he’s Japanese • Programmer Happiness! - written for humans not for computers • Easy to read and write 5.times { puts "Have some chunky bacon Matz."} ['riverside', 'japan', 'america'].each {|locale| puts locale.capitalize } • Popularized by Ruby on Rails Tuesday, October 19, 2010
  • 7. Install Ruby • Mac Users, I say rejoice, for thou haveth Ruby already! • Windows users - are you prejudiced towards Japan or something?! Let’s fix that by installing Ruby: • http://www.ruby-lang.org/en/downloads/ - run the one-click installer and make sure to de-check the SciTE and check enable ruby gems. Important. • (http://docs.heroku.com/windows) - very helpful. video. Remember - friends don’t let friends use internet explorer. Tuesday, October 19, 2010
  • 8. Database • Where we store our data • MySQL popular • skip Tuesday, October 19, 2010
  • 9. Git • Keeps track of all the code you write • http://code.google.com/p/msysgit/ (windows) • http://code.google.com/p/git-osx-installer/ (mac) • http://github.com (keep your code safe) Tuesday, October 19, 2010
  • 10. Hello World app • [sudo] gem install sinatra • [sudo] gem install unicorn • [sudo] gem install haml • mkdir hello_world • cd hello_world Tuesday, October 19, 2010
  • 11. Hello World app cont. • Create and edit app.rb require 'rubygems' require 'sinatra' get '/' do "Hello World!" end Tuesday, October 19, 2010
  • 12. Hello World app cont. • Create and edit config.ru file require 'app' run Sinatra::Application Tuesday, October 19, 2010
  • 13. Hello World app cont. • Create and edit .gems file for heroku sinatra --version '>= 0.9.4' haml Tuesday, October 19, 2010
  • 14. Hello World app cont. • Run the local server: unicorn -p 3000 • Browse to: http://localhost:3000/ • Congrats! Drink a beer! Tuesday, October 19, 2010
  • 15. Deploy • Sign up on Heroku: http://heroku.com • [sudo] gem install heroku Tuesday, October 19, 2010
  • 16. Deploy cont. • cd into your hello_world project • git init • git add . • git commit -am “initial import” Tuesday, October 19, 2010
  • 17. Deploy cont. • ssh-keygen -C “[email protected]” -t rsa • (leave the passphrase blank unless it’s your computer) Tuesday, October 19, 2010
  • 18. Deploy cont. • heroku create • git push heroku master • heroku rename yourchoice • browse to http://yourchoice.heroku.com Tuesday, October 19, 2010
  • 19. Deploy cont. • Other things you can do • Add an about page • Switch to haml • Add a layout file • Add images under a public folder • Move onto ajax Tuesday, October 19, 2010
  • 20. views/layout.haml !!! %html %head %title Your App %link{:rel=>'stylesheet', :href=>'/stylesheets/ layout.css', :type => "text/css"} / javascripts %script{:type => "text/javascript", :src => "/javascripts/ jquery.js"} %script{:type => "text/javascript", :src => "/javascripts/ index.js"} %body = yield Tuesday, October 19, 2010
  • 21. views/index.haml %h1 Hello World! get '/' do haml :index end Tuesday, October 19, 2010
  • 23. public/javascripts • Add jquery.js - download from jquery.com • Add index.js Tuesday, October 19, 2010
  • 24. public/javascripts/ index.js $(document).ready(function() { alert("It works!"); }); Tuesday, October 19, 2010
  • 25. views/index.haml %h1 Hello World %h2 Search %form{:id => "search_form", :method => "get", :action => "/search"} %input{:type => "text", :id => "search_field", :name => "search_field"} %input{:type => "submit", :value => "Search", :id => "search_btn"} %ul#search_field_value %li= @search_field_value Tuesday, October 19, 2010
  • 26. app.rb (add route) get '/search' do @search_field_value = params[:search_field] haml :index end Tuesday, October 19, 2010
  • 27. public/javascripts/ index.js $(document).ready(function() { $("#search_btn").click(function() { var search_text = $("#search_field").val(); alert(search_text); return false; }); }); Tuesday, October 19, 2010
  • 28. public/javascripts/ index.js $(document).ready(function() { $("#search_btn").click(function() { var search_text = $("#search_field").val(); // alert(search_text); $.ajax({ url: "/search?search_field="+search_text, success: function(responseText, statusText, xhr) { $('#search_field_value').append(responseText); }, error: function(request, statusText, xhr) { alert("There was an error!"); } }); return false; }); }); Tuesday, October 19, 2010
  • 29. public/javascripts/ index.js get '/search' do @search_field_value = params[:search_field] "<li>#{@search_field_value}</li>" end Tuesday, October 19, 2010