[Jifty-commit] r3716 - talks/talks

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue Jul 24 19:28:16 EDT 2007


Author: jesse
Date: Tue Jul 24 19:28:15 2007
New Revision: 3716

Removed:
   talks/talks/oscon.2007.dsls.txt
Modified:
   talks/talks/oscon.dsls.2007.txt

Log:
* updated the dsls talk

Modified: talks/talks/oscon.dsls.2007.txt
==============================================================================
--- talks/talks/oscon.dsls.2007.txt	(original)
+++ talks/talks/oscon.dsls.2007.txt	Tue Jul 24 19:28:15 2007
@@ -59,6 +59,23 @@
 ---
 DHH demonstrated Rails migrations
 ---
+#mode ruby
+class AddUserTable < ActiveRecord::Migration
+    def self.up
+      create_table :users do |table|
+        table.column :name, :string
+        table.column :login,  :string
+        table.column :password, :string, :limit => 32
+        table.column :email, :string
+      end
+    end
+
+    def self.down
+      drop_table :users
+    end
+  end
+
+---
 They looked very sexy
 ---
 I was very jealous
@@ -110,6 +127,31 @@
 ---
 Hashes are ugly
 ---
+#mode perl
+sub _CoreAccessible {
+    {   id => {
+            read       => 1,
+            sql_type   => 4,
+            length     => 11,
+            is_blob    => 0,
+            is_numeric => 1,
+            type       => 'int(11)',
+            default    => ''
+        },
+        Name => {
+            read       => 1,
+            write      => 1,
+            sql_type   => 12,
+            length     => 200,
+            is_blob    => 0,
+            is_numeric => 0,
+            type       => 'varchar(200)',
+            default    => ''
+        },
+   }
+}
+
+---
 We spent about a month playing with syntax.
 ---
 Our first goal was "feels right"
@@ -414,6 +456,8 @@
 ---
 ...and then your program gets control back
 ---
+All that magic is encapuslated in Object::Declare
+---
 #title Jifty::DBI::Schema - end
 That's Jifty::DBI::Schema.
 ---
@@ -438,14 +482,19 @@
 There's Perl inside.
 ---
 <mason><is><still> 
+
 <full><of> 
+
 <angle><brackets>
 ---
 </brackets></angle> 
+
 </of></full> 
+
 </still></is></mason> 
 ---
 <html><is><for> 
+
 <jedi><knights>
 ---
 What it looks like
@@ -497,6 +546,7 @@
 People use CSS for design now
 ---
 Programmers still have to make templates
+---
 Templates run like CODE
 ---
 Because they ARE code
@@ -707,6 +757,8 @@
 ---
 We can already do T::D tags, map, grep and for
 ---
+We're rolling improvements back to the Perl core
+---
 Ping me afterward if you want to help out.
 ---
 #title
@@ -779,22 +831,6 @@
         $user->set_last_visit( DateTime->now);
     }
  };
-
-
----
-Shell-style globbing
----
-#mode perl
- before '*' => run {
-    if ($ENV{'HTTP_USER_AGENT'} =~ /(?:hiptop|Blazer|iPhone
-                                    SonyEricsson|Symbian|
-                                    NetFront|UP.Browser/iox )  {
-        set mobile_ua => '1';
-    } else {
-        set mobile_ua => '0';
-
-    }
- };
 ---
 Perl Regexes
 ---
@@ -807,6 +843,19 @@
     }
  };
 ---
+Shell-style globbing
+---
+#mode perl
+before 'facebook/pick/#/*' => run {
+    my $choice_num = $1;
+    my $vote   = $2;
+    # ....
+};
+---
+(Globs are compiled to regexes)
+---
+Jifty::View::Declare::_compile_glob should get CPANed
+---
 HTTP VERBS
 ---
 #mode perl
@@ -818,16 +867,25 @@
 SSL adjectives
 ---
 #mode perl
-before HTTPS $RESTRICTED_PAGES => run {
+before HTTPS qr'/restricted' => run {
     redirect '/login' if not Jifty->web->current_user->id;
-}
+};
 ---
 How it's built
 ---
-
-show off the mapping tables and how it builds up the dispatch table
-
-
+The DSL bit
+---
+#mode perl
+sub before ($$@) { ... }
+sub on     ($$@) { ... }
+sub after  ($$@) { ... }
+sub run    (&) { return shift } 
+sub HTTPS  ($) { return protocol => 'HTTPS', @_) }
+sub HTTP   ($) { return protocol => 'HTTP', @_) }
+sub HTTPS  ($) { return protocol => 'HTTPS', @_) }
+sub GET    ($) { return method => 'GET', @_) }
+---
+The rest is just building up a list of rules and running it
 ---
 #title 
 Test::WWW::Declare


More information about the Jifty-commit mailing list