The Why Of Ruby

Brian Hogan
Brian HoganProgrammer and writer.
why ruby?
   cs 320
programming is fun.
you just don’t know it
         yet.
I was a designer. I hated
     programming.
my clients wanted
interactive websites...
I learned Ruby in 2005
    and fell in love...
The Why Of Ruby
want to make a
desktop app that runs
on Mac, Windows, and
       Linux?
Shoes.app do
 para "Item name"
 @name = edit_line

 button "Add to list" do
  @names.append do
   para @name.text
  end
  @name.text = ""
 end

 button("Clear the list") {@names.clear}

 @names = stack :width=>"100%", :height=>"90%"

end
how about a simple
iPhone-enabled site?
require 'sinatra'
require 'pathname'

get "/" do
 dir = "./files/"
 @links = Dir[dir+"*"].map { |file|
   file_link(file)
 }.join
 erb :index
end

helpers do

 def file_link(file)
  filename = Pathname.new(file).basename
  "<li><a href='#{file}' target='_self'>#{filename}</a></li>"
 end

end

use_in_file_templates!

__END__

@@ index
<html>
 <head>
  <meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
  <style type="text/css" media="screen">@import "/stylesheets/iui.css";</style>
  <script type="application/x-javascript" src="/javascripts/iui.js"></script>
 </head>

 <body>
  <div class="toolbar">
  <h1 id="pageTitle"></h1>
  </div>
  <ul id="home" title="Your files, sir." selected="true">
    <%= @links %>
  </ul>
 </body>

</html>
want to make CSS
easier to read and use?
@the-border: 1px;
@base-color: #111;

#header {
  color: @base-color * 3;
  border-left: @the-border;
  border-right: @the-border * 2;
}

#header {
  color: red;
  a{
    font-weight: bold;
    text-decoration: none;
  }
}


#footer {
  color: (@base-color + #111) * 1.5;
}
got a great idea and
want to get it out there
       quickly?
The Why Of Ruby
got a big site that’s hard
      to maintain?
The Why Of Ruby
Want to change your
        life?
Don’t just do
something...
...do something you
     love to do.
Ruby makes us happy.
so... if you have an
interest in this and you
    want to learn...
...we’ll help you get
         there.
Open House
• Dooley’s Pub
• 5:00 to 7:00 Thursday, October 1st
• Presentations, prize drawing
@ecruby on Twitter
Thanks for your time!
1 of 26

Recommended

Class1Class1
Class1Saneer Gera
392 views26 slides
Le Wagon - 2h LandingLe Wagon - 2h Landing
Le Wagon - 2h LandingBoris Paillard
29.1K views100 slides
HTML Lesson 5HTML Lesson 5
HTML Lesson 5Danny Ambrosio
326 views5 slides

More Related Content

Similar to The Why Of Ruby

LeSS in actionLeSS in action
LeSS in actionPu Shiming
879 views24 slides
LESS is MoreLESS is More
LESS is Morejsmith92
1.5K views19 slides
Doing More With LessDoing More With Less
Doing More With LessDavid Engel
1.3K views37 slides
Advanced sass/compassAdvanced sass/compass
Advanced sass/compassNick Cooley
6.1K views58 slides

More from Brian Hogan(20)

DockerDocker
Docker
Brian Hogan1.2K views
Responsive Web DesignResponsive Web Design
Responsive Web Design
Brian Hogan1.3K views
Building A Gem From ScratchBuilding A Gem From Scratch
Building A Gem From Scratch
Brian Hogan1.4K views
Intro To Advanced RubyIntro To Advanced Ruby
Intro To Advanced Ruby
Brian Hogan2.5K views
Turning Passion Into WordsTurning Passion Into Words
Turning Passion Into Words
Brian Hogan1.1K views
HTML5 and CSS3 TodayHTML5 and CSS3 Today
HTML5 and CSS3 Today
Brian Hogan2.2K views
Intro to RubyIntro to Ruby
Intro to Ruby
Brian Hogan1.7K views
Story-driven TestingStory-driven Testing
Story-driven Testing
Brian Hogan1.2K views
Learning To Walk In ShoesLearning To Walk In Shoes
Learning To Walk In Shoes
Brian Hogan1.4K views

Recently uploaded(20)

The Why Of Ruby