Permalink
Browse files

New directory-based method

  • Loading branch information...
nateberkopec committed Jul 15, 2012
1 parent a6ee014 commit 858b37ea22d1f510e976595ccf5bd56856def3a0
Showing with 143 additions and 87 deletions.
  1. +4 −0 Gemfile
  2. +19 −0 Gemfile.lock
  3. +10 −10 config.ru
  4. +0 −63 index.html
  5. +110 −0 public/cell.html
  6. +0 −14 public/config.ru
View
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+gem 'rack-contrib', :git => 'git://github.com/rack/rack-contrib.git'
+gem 'rack-rewrite'
View
@@ -0,0 +1,19 @@
+GIT
+ remote: git://github.com/rack/rack-contrib.git
+ revision: b7e7c38fd02c3b5da91aa57af78b3f571c6ebcd0
+ specs:
+ rack-contrib (1.1.0)
+ rack (>= 0.9.1)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ rack (1.4.1)
+ rack-rewrite (1.2.1)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ rack-contrib!
+ rack-rewrite
View
@@ -1,14 +1,14 @@
+require 'rack/contrib'
+require 'rack-rewrite'
+
use Rack::Static,
:urls => ["/css", "/img"],
:root => "public"
-run lambda { |env|
- [
- 200,
- {
- 'Content-Type' => 'text/html',
- 'Cache-Control' => 'public, max-age=86400'
- },
- File.open('public/index.html', File::RDONLY)
- ]
-}
+
+use Rack::Rewrite do
+ rewrite '/', '/index.html'
+ rewrite '/cell', '/cell.html'
+end
+
+run Rack::Directory.new('public')
View
@@ -1,63 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>TastingTonight</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
- <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
- <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
-</head>
-<body>
-
-<div data-role="content" >
- <h2>TastingTonight</h2>
-
- <p>Welcome to TastingTonight! You're just an hour away from getting a professionally curated tasting box delivered to your place in NYC.</p>
-
- <h3>Let's get started:</h3>
- <p><a href="#two" data-role="button">Choose Package</a></p>
- </div><!-- /content -->
-
-</div><!-- /page one -->
-
-
-<!-- Start of second page: #two -->
-<div data-role="page" id="two" data-theme="a">
-
- <div data-role="header">
- <h1>Two</h1>
- </div><!-- /header -->
-
- <div data-role="content" data-theme="a">
- <h2>Two</h2>
- <p>I have an id of "two" on my page container. I'm the second page container in this multi-page template.</p>
- <p>Notice that the theme is different for this page because we've added a few <code>data-theme</code> swatch assigments here to show off how flexible it is. You can add any content or widget to these pages, but we're keeping these simple.</p>
- <p><a href="#one" data-direction="reverse" data-role="button" data-theme="b">Back to page "one"</a></p>
-
- </div><!-- /content -->
-
- <div data-role="footer">
- <h4>Page Footer</h4>
- </div><!-- /footer -->
-</div><!-- /page two -->
-
-
-<!-- Start of third page: #popup -->
-<div data-role="page" id="popup">
-
- <div data-role="header" data-theme="e">
- <h1>Dialog</h1>
- </div><!-- /header -->
-
- <div data-role="content" data-theme="d">
- <h2>Popup</h2>
- <p>I have an id of "popup" on my page container and only look like a dialog because the link to me had a <code>data-rel="dialog"</code> attribute which gives me this inset look and a <code>data-transition="pop"</code> attribute to change the transition to pop. Without this, I'd be styled as a normal page.</p>
- <p><a href="#one" data-rel="back" data-role="button" data-inline="true" data-icon="back">Back to page "one"</a></p>
- </div><!-- /content -->
-
- <div data-role="footer">
- <h4>Page Footer</h4>
- </div><!-- /footer -->
-</div><!-- /page popup -->
-
-</body>
View
@@ -0,0 +1,110 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>TastingTonight</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
+ <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
+ <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
+ <style type="text/css">
+ h1 {
+ text-align: center;
+ font-size: 18px;
+ }
+ </style>
+</head>
+<body>
+
+<div data-role="page" id="one" data-theme="a">
+ <div data-role="header">
+ <div>
+ <h1>TastingTonight</h1>
+ </div>
+ </div><!-- /header -->
+
+ <div data-role="content" >
+
+ <p>Welcome to TastingTonight! You're just an hour away from getting a professionally curated tasting box delivered to your place in NYC.</p>
+
+ <h3>Let's get started:</h3>
+ <p><a href="#two" data-role="button">Choose Package</a></p>
+ </div><!-- /content -->
+
+</div><!-- /page one -->
+
+
+<!-- Start of second page: #two -->
+<div data-role="page" id="two" data-theme="a">
+
+ <div data-role="header">
+ <h1>Choose Package</h1>
+ </div><!-- /header -->
+
+ <div data-role="content" data-theme="a">
+ <h2>Choose Your Tasting Package</h2>
+ <p><a href="#beer" data-role="button">Craft Beers</a></p>
+ <p><a href="#wine" data-role="button">Wines</a></p>
+ <p><a href="#scotch" data-role="button">Scotches</a></p>
+ </div><!-- /content -->
+</div><!-- /page two -->
+
+<div data-role="page" id="beer">
+
+ <div data-role="header" data-theme="a">
+ <div>
+ <h1>Craft Beer Package</h1>
+ </div>
+ </div><!-- /header -->
+
+ <div data-role="content" data-theme="a">
+ <h2>Choose Package Size</h2>
+ <h3>You'll receive 5 different beers with this package</h3>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=CraftBeerTwo" data-role="button">2 people - $25 <br> (equiv to 5 beers)</a></p>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=CraftBeerThree" data-role="button">3 people - $37 <br> (equiv to 7.5 beers)</a></p>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=CraftBeerFour" data-role="button">4 people - $50 <br>(equiv to 10 beers)</a></p>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=CraftBeerFive" data-role="button">5 people - $63 <br>(equiv to 12.5 beers)</a></p>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=CraftBeerSix" data-role="button">6 people - $75 <br>(equiv to 15 beers)</a></p>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=CraftBeerSeven" data-role="button">7 people - $87 <br>(equiv to 17.5 beers)</a></p>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=CraftBeerEight" data-role="button">8 people - $100 <br>(equiv to 20 beers)</a></p>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=CraftBeerSPECIAL" data-role="button">Custom/Other <br>($8 pp)</a></p>
+ </div><!-- /content -->
+
+</div>
+
+<div data-role="page" id="wine">
+
+ <div data-role="header" data-theme="a">
+ <div>
+ <h1>Fine Wines Package</h1>
+ </div>
+ </div><!-- /header -->
+
+ <div data-role="content" data-theme="a">
+ <h2>Choose Package Size</h2>
+ <h3>You'll receive 5 different wines with this package</h3>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=WineTwoThree" data-role="button">2-4 people - $50 <br>(equiv to 2.5 bottles)</a></p>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=WineFiveEight" data-role="button">5-8 people - $100 <br>(equiv to 5 bottles)</a></p>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=WineSPECIAL" data-role="button">Custom/Other</a></p>
+ </div><!-- /content -->
+
+</div>
+
+<div data-role="page" id="scotch">
+
+ <div data-role="header" data-theme="a">
+ <div>
+ <h1>Scotch Package</h1>
+ </div>
+ </div><!-- /header -->
+
+ <div data-role="content" data-theme="a">
+ <h2>Choose Package Size</h2>
+ <h3>You'll receive 5 different scotches with this package</h3>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=ScotchThree" data-role="button">3 persons - $65 <br>(equiv to 1 full bottle)</a></p>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=ScotchSix" data-role="button">6 persons - $125 <br>(equiv to 2 full bottles)</a></p>
+ <p><a href="mailto: nate.berkopec@gmail.com?subject=ScotchSPECIAL" data-role="button">Custom/Other</a></p>
+ </div><!-- /content -->
+
+</div>
+
+</body>
View
@@ -1,14 +0,0 @@
-use Rack::Static,
- :urls => ["/css", "/img"],
- :root => "public"
-
-run lambda { |env|
- [
- 200,
- {
- 'Content-Type' => 'text/html',
- 'Cache-Control' => 'public, max-age=86400'
- },
- File.open('public/index.html', File::RDONLY)
- ]
-}

0 comments on commit 858b37e

Please sign in to comment.