GREAT
       DEVELOPERS
          STEAL
ben scofield / @bscofield / scottish ruby conference / 8 april 2011
flickr: hisgett
ART
http://obeygiant.com/headlines/obey-x-austin-sxsw
I’M NO
ART HISTORIAN
Mythology
http://www.saversplanet.com/wallpapers/one-ring-wallpapers_3072_1600.jpg
http://www.xibalba.demon.co.uk/jbr/trek/gen.html
http://www.scifinow.co.uk/news/top-five-sci-fi-vehicles/
Music
V

            U
http://www.wired.com/special_multimedia/2008/pl_music_1609
http://www.soulculture.co.uk/features/jimi-hendrix-the-epitome-of-a-legend/
http://upload.wikimedia.org/wikipedia/commons/d/d3/Eleanor_Rigby_-_DSC05154.JPG (Benkid77)
Software Development
Software Development
SUnit


xUnit
        JUnit
        CppUnit
        NUnit
        Lapidary  Test::Unit
JBehave


BDD
      RBehave  RSpec
      NBehave
      PHPSpec
      Jasmine
Rails


Rails
        CakePHP
        Grails
        Rhino on Rails
        ASP.NET MVC
ORM   Hibernate  NHibernate
      ActiveRecord  SubSonic
mod_perl

mod_*   mod_python
        mod_php
        mod_rails  Passenger
Paste


WSGI
       Rack
       Jack
       Plack
       Hack
WSGI
     def simple_app(environ, start_response):
         """Simplest possible application object"""
         status = '200 OK'
         response_headers = [('Content-type', 'text/html')]
         start_response(status, response_headers)
         return ['Hello Worldn']




http://www.python.org/dev/peps/pep-0333/
Paste
     def app(environ, start_response):
         start_response('200 OK', [('content-type', 'text/html')])
         return ['Hello world']




https://bitbucket.org/ianb/paste
Rack
     def call(env)
       [200, {'Content-Type' => 'text/html'}, 'Hello World']
     end




https://github.com/rack/rack
Plack
     my $app = sub {
       my $env = shift;
       return [ 200, [ 'Content-Type' => 'text/html' ], 'Hello World' ];
     };




https://github.com/miyagawa/Plack
Jack
     function(env){
       return [200, {'Content-Type': 'text/html'}, "Hello World"];
     };




https://github.com/JackDanger/jack
Hack
     app :: Application
     app = env -> return $
       Response 200 [ ("Content-Type", "text/plain") ] (pack "Hello World")

     main = run app




https://github.com/nfjinjing/hack
Express.js
          Ratpack


Sinatra
          Sammy.js
          Fitzgerald
          Slim
          Scalatra
          Nancy
Sinatra
     require 'rubygems'
     require 'sinatra'

     get '/' do
       erb :homepage
     end

     get '/names/:name' do
       "Hello, #{params[:name]}"
     end

     post '/login' do
       # data is in request.body
       # validate login
     end




https://github.com/bmizerany/sinatra
Express.js
     var express = require('express');
     var app = express.createServer();

     app.configure(function(){
       app.use(express.bodyParser());
     });

     app.get('/', function(request, response) {
       response.render('homepage.ejs');
     });

     app.get('/names/:name', function(request, response) {
       response.send('Hello, ' + request.param('name'));

     });

     app.post('/login', function(request, response) {
       // data is in request.body
       // validate login
     });




https://github.com/visionmedia/express
Ratpack
     get("/") {
       render "homepage.html"
     }

     get("/names/:name") {
       "Hello, ${urlparams.name}"
     }

     post("/login") {
       // data is in params.field
       // validate login
     }




https://github.com/bleedingwolf/Ratpack
Slim
     <?php
     require 'Slim/Slim.php';
     Slim::init();

     Slim::get('/', function () {
       Slim::render('homepage.php');
     });

     Slim::get('/names/:name', function ($name) {
       echo "Hello, $name";
     });

     Slim::post('/login', function () {
       # data is in Slim::request()->post('field')
       # validate login
     });

     Slim::run();
     ?>




https://github.com/codeguy/Slim
Nancy
     public class Sample : NancyModule
     {
       public Module()
       {
         Get["/"] = params => {
           return View.Spark("homepage.spark", params);
         };

         Get["/names/{name}"] = params => {
            return string.Concat("Hello, ", params.name);
         };

         Post["/login"] = params => {
            /// data is in params.field
            /// validate login
         };
       }
     }




https://github.com/thecodejunkie/Nancy
Sammy.js
     (function($) {
       var app = $.sammy('#main', function() {
         this.get('#/', function() {
           this.partial('files/homepage.html');
         });

         this.post('#/login', function() {
           // data is in params.field
           // validate login
         });
       });

       $(function() { app.run('#/'); });
     })(jQuery);




https://github.com/quirkey/sammy
Interlude

On Naming
Scalatra
     import org.scalatra._
     import org.scalatra.scalate._

     class Example extends ScalatraServlet with ScalateSupport {
       get("/") {
         templateEngine.layout("homepage.scaml")
       }

       get("/names/:name") {
         <p>Hello, {params("name")}</p>
       }

       post("/login") {
         // data is in params{"field"}
         // validate login
       }
     }




https://github.com/scalatra/scalatra
Software Theft 101
Software Theft 101
Need-Driven
1 Find a problem
2 Pick a target
3 Case the joint
Opportunity-
Driven
1 Pick a target
2 Case the joint
Wait for your
3 chance
Casing the Joint
Searching
GitHub

General   BitBucket
          SourceForge
          Google Code
Rubygems

Specific   PEPs
          PyPI
          CPAN
Evaluating
Forks and watchers
       Active repositories
       Edge case tests

Good   Issues
       Citations
       Documentation
       History
       Strong opinions
Perpetration
Location

Trouble   Paradigm
          Idiom
          Style
Inspire   JBehave  RSpec
Sample   Sinatra  Padrino
Cover   JUnit  NUnit
        WSGI  Rack
RUBYISTS
can steal from
  EVERYONE
Procedural
Object-Oriented
Functional
Metaprogramming
Test-focused
THANK YOU!
now go burgle something

   Ben Scofield / @bscofield
   http://benscofield.com
   http://speakerrate.com/t/7099

Great Developers Steal