Permalink
Browse files

updated files

  • Loading branch information...
mnewt committed Jul 13, 2012
1 parent 00fb5cd commit 015b80eab54e24a08fe59f17e48d7c5f264ec0c9
Showing with 91 additions and 44 deletions.
  1. +1 −0 .rvmrc
  2. +10 −8 Gemfile.lock
  3. +60 −2 app/controllers/proxy_controller.rb
  4. +0 −13 app/views/layouts/application.html.erb
  5. +1 −1 app/views/proxy/main.html.haml
  6. +8 −1 light-proxy.rb
  7. +11 −19 public/index.html
View
1 .rvmrc
@@ -0,0 +1 @@
+rvm ruby-1.9.3-p194@proxy
View
@@ -40,10 +40,11 @@ GEM
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
+ ffi (1.0.11)
haml (3.1.6)
hike (1.2.1)
i18n (0.6.0)
- journey (1.0.3)
+ journey (1.0.4)
jquery-rails (2.0.2)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
@@ -52,7 +53,7 @@ GEM
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.18)
+ mime-types (1.19)
multi_json (1.3.6)
polyglot (0.3.3)
rack (1.4.1)
@@ -80,7 +81,7 @@ GEM
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
- sass (3.1.19)
+ sass (3.1.20)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
@@ -90,17 +91,18 @@ GEM
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
- thor (0.15.2)
+ thor (0.15.4)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
- typhoeus (0.3.3)
- mime-types
+ typhoeus (0.4.2)
+ ffi (~> 1.0)
+ mime-types (~> 1.18)
tzinfo (0.3.33)
- uglifier (1.2.4)
+ uglifier (1.2.6)
execjs (>= 0.3.0)
- multi_json (>= 1.0.2)
+ multi_json (~> 1.3)
PLATFORMS
ruby
@@ -6,7 +6,7 @@ def main
require 'json'
# the request object
- request = Typhoeus::Request.new("http://mnewton.com")
+ request = Typhoeus::Request.new("http://localhost:3000")
# :body => "this is a request body",
# :method => :post,
# :headers => {:Accept => "text/html"},
@@ -24,7 +24,56 @@ def main
# the response object will be set after the request is run
response = request.response
- @body = response.body
+ @page = response.body
+
+ hash_of_fields_for_user_application = [ username: "mnewt",
+ password: "matthew"
+ ]
+
+ @css = <<HERE
+ <style type="text/css">
+ .navbar {
+ position: absolute;
+ top:0;
+ left: 30%;
+ width:300px;
+ z-index=-1;
+
+ text-align: center;
+ background-color:red;
+ }
+ </style>
+HERE
+
+ @script = <<HERE
+ <script type="text/javascript">
+ $(function() {
+ $('#username').val ('user');
+ $('#password').val ('pass');
+ $('#login').submit();
+ });
+ </script>
+HERE
+
+
+ @navbar = <<HERE
+ <div class="navbar">
+ THIS IS THE NAV BAR
+ </div>
+
+HERE
+
+# @page = <<HERE
+# <!doctype html>
+# <head>
+# <title>Proxy Tester</title>
+# </head>
+# <body>
+# This is my body
+# </body>
+# HERE
+ @page["</head>"] = @css + @script + "</head>"
+ @page["</body>"] = @navbar + "</body>"
# 1. create header view - should it be a partial or its own controller?
# 2. create js parser/inserter
# 3. stick header and parser in response.body before sending to view
@@ -35,4 +84,13 @@ def main
# response.headers_hash # http headers put into a hash
# response.body # the response body
end
+
+ def pene_find_fields(raw_html)
+ #given raw html, returns hash of fields
+ end
+
+
+ def pene_populate(elements)
+ # find fields
+ end
end
@@ -1,14 +1 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Proxy</title>
- <%= stylesheet_link_tag "application", :media => "all" %>
- <%= javascript_include_tag "application" %>
- <%= csrf_meta_tags %>
-</head>
-<body>
-
<%= yield %>
-
-</body>
-</html>
@@ -1,2 +1,2 @@
-= raw @body
+= raw @page
View
@@ -3,7 +3,7 @@
require 'json'
# the request object
-request = Typhoeus::Request.new("http://www.pauldix.net")
+request = Typhoeus::Request.new("http://localhost:3000")
# :body => "this is a request body",
# :method => :post,
# :headers => {:Accept => "text/html"},
@@ -27,6 +27,13 @@
response.headers_hash # http headers put into a hash
response.body # the response body
+jparse = <<END
+THIS IS WHERE MY CODE WOULD GO
+END
+
+
+response.body["</body>"] = jparse + "</body>"
+
puts "response.code:"
puts response.code
puts
View
@@ -213,25 +213,17 @@ <h3><a href="rails/info/properties" onclick="about(); return false">About your a
</div>
<div id="getting-started">
- <h1>Getting started</h1>
- <h2>Here&rsquo;s how to get rolling:</h2>
-
- <ol>
- <li>
- <h2>Use <code>rails generate</code> to create your models and controllers</h2>
- <p>To see all available options, run it without parameters.</p>
- </li>
-
- <li>
- <h2>Set up a default route and remove <span class="filename">public/index.html</span></h2>
- <p>Routes are set up in <span class="filename">config/routes.rb</span>.</p>
- </li>
-
- <li>
- <h2>Create your database</h2>
- <p>Run <code>rake db:create</code> to create your database. If you're not using SQLite (the default), edit <span class="filename">config/database.yml</span> with your username and password.</p>
- </li>
- </ol>
+ <h1>Demo form</h1>
+ <h2>This is a test form:</h2>
+
+ <form name="login" method="post" action="mailto:matt@slybear.com">
+ <ul>
+ <li>username: <input type="text" name="username" /></li>
+ <li>password: <input type="password" name="password" /></li>
+ </ul>
+ <input type="submit" value="Login" />
+ </form>
+
</div>
</div>

0 comments on commit 015b80e

Please sign in to comment.