Permalink
Browse files

upgraded to html2haml gem

  • Loading branch information...
1 parent d6e3e23 commit b906b08ebf8f3a7708b171299ae8eda9653d2d9e @twilson63 committed Sep 9, 2012
View
Binary file not shown.
View
@@ -1 +1 @@
-rvm use 1.9.3
+rvm use 1.9.3-p194
View
@@ -1,9 +1,9 @@
source :gemcutter
gem 'thin'
-gem 'sinatra', '~> 1.2.0'
+gem 'sinatra'
gem 'hpricot'
-gem 'haml', '3.1.6'
+gem 'html2haml'
gem 'json'
gem 'builder'
gem 'erubis'
View
@@ -1,34 +1,41 @@
GEM
remote: http://rubygems.org/
specs:
- builder (3.0.0)
+ builder (3.1.3)
crack (0.3.1)
- daemons (1.1.4)
+ daemons (1.1.9)
diff-lcs (1.1.3)
erubis (2.7.0)
- eventmachine (0.12.10)
- haml (3.1.6)
- hpricot (0.8.4)
- json (1.6.1)
- newrelic_rpm (3.1.2)
- rack (1.3.3)
+ eventmachine (1.0.0)
+ haml (3.2.0.beta.3)
+ tilt
+ hpricot (0.8.6)
+ html2haml (1.0.0.beta.1)
+ haml (>= 3.2.0.beta.1)
+ hpricot
+ json (1.7.5)
+ newrelic_rpm (3.4.2)
+ rack (1.4.1)
+ rack-protection (1.2.0)
+ rack
rack-test (0.6.1)
rack (>= 1.0)
- rspec (2.6.0)
- rspec-core (~> 2.6.0)
- rspec-expectations (~> 2.6.0)
- rspec-mocks (~> 2.6.0)
- rspec-core (2.6.4)
- rspec-expectations (2.6.0)
- diff-lcs (~> 1.1.2)
- rspec-mocks (2.6.0)
+ rspec (2.11.0)
+ rspec-core (~> 2.11.0)
+ rspec-expectations (~> 2.11.0)
+ rspec-mocks (~> 2.11.0)
+ rspec-core (2.11.1)
+ rspec-expectations (2.11.3)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.11.2)
ruby_parser (2.3.1)
sexp_processor (~> 3.0)
- sexp_processor (3.0.7)
- sinatra (1.2.6)
- rack (~> 1.1)
- tilt (>= 1.2.2, < 2.0)
- thin (1.2.11)
+ sexp_processor (3.2.0)
+ sinatra (1.3.3)
+ rack (~> 1.3, >= 1.3.6)
+ rack-protection (~> 1.2)
+ tilt (~> 1.3, >= 1.3.3)
+ thin (1.4.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
@@ -41,12 +48,12 @@ DEPENDENCIES
builder
crack
erubis
- haml (= 3.1.6)
hpricot
+ html2haml
json
newrelic_rpm
rack-test
rspec
ruby_parser
- sinatra (~> 1.2.0)
+ sinatra
thin
View
@@ -2,7 +2,7 @@ require "bundler"
Bundler.require
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '.')
-require 'html2haml'
+require 'server'
set :environment, :production
disable :run
@@ -0,0 +1,46 @@
+# Logfile created on 2012-09-09 08:29:54 -0400 by logger.rb/31641
+[09/09/12 08:29:54 -0400 air-2.local (55632)] INFO : Dispatcher: thin
+[09/09/12 08:29:54 -0400 air-2.local (55632)] INFO : Application: development
+[09/09/12 08:29:54 -0400 air-2.local (55632)] ERROR : No license key found. Please edit your newrelic.yml file and insert your license key.
+[09/09/12 08:29:54 -0400 air-2.local (55632)] INFO : New Relic Ruby Agent 3.4.2 Initialized: pid = 55632
+[09/09/12 08:29:54 -0400 air-2.local (55632)] INFO : Agent Log at /Users/twilson63/code/html2haml/log/newrelic_agent.log
+[09/09/12 08:32:23 -0400 air-2.local (55645)] INFO : Dispatcher: thin
+[09/09/12 08:32:23 -0400 air-2.local (55645)] INFO : Application: development
+[09/09/12 08:32:23 -0400 air-2.local (55645)] ERROR : No license key found. Please edit your newrelic.yml file and insert your license key.
+[09/09/12 08:32:23 -0400 air-2.local (55645)] INFO : New Relic Ruby Agent 3.4.2 Initialized: pid = 55645
+[09/09/12 08:32:23 -0400 air-2.local (55645)] INFO : Agent Log at /Users/twilson63/code/html2haml/log/newrelic_agent.log
+[09/09/12 08:34:32 -0400 air-2.local (55650)] INFO : Dispatcher: thin
+[09/09/12 08:34:32 -0400 air-2.local (55650)] INFO : Application: development
+[09/09/12 08:34:32 -0400 air-2.local (55650)] ERROR : No license key found. Please edit your newrelic.yml file and insert your license key.
+[09/09/12 08:34:32 -0400 air-2.local (55650)] INFO : New Relic Ruby Agent 3.4.2 Initialized: pid = 55650
+[09/09/12 08:34:32 -0400 air-2.local (55650)] INFO : Agent Log at /Users/twilson63/code/html2haml/log/newrelic_agent.log
+[09/09/12 08:37:07 -0400 air-2.local (55656)] INFO : Dispatcher: thin
+[09/09/12 08:37:07 -0400 air-2.local (55656)] INFO : Application: development
+[09/09/12 08:37:07 -0400 air-2.local (55656)] ERROR : No license key found. Please edit your newrelic.yml file and insert your license key.
+[09/09/12 08:37:07 -0400 air-2.local (55656)] INFO : New Relic Ruby Agent 3.4.2 Initialized: pid = 55656
+[09/09/12 08:37:07 -0400 air-2.local (55656)] INFO : Agent Log at /Users/twilson63/code/html2haml/log/newrelic_agent.log
+[09/09/12 08:37:32 -0400 air-2.local (55658)] INFO : Dispatcher: thin
+[09/09/12 08:37:32 -0400 air-2.local (55658)] INFO : Application: development
+[09/09/12 08:37:32 -0400 air-2.local (55658)] ERROR : No license key found. Please edit your newrelic.yml file and insert your license key.
+[09/09/12 08:37:32 -0400 air-2.local (55658)] INFO : New Relic Ruby Agent 3.4.2 Initialized: pid = 55658
+[09/09/12 08:37:32 -0400 air-2.local (55658)] INFO : Agent Log at /Users/twilson63/code/html2haml/log/newrelic_agent.log
+[09/09/12 08:40:12 -0400 air-2.local (55666)] INFO : Dispatcher: thin
+[09/09/12 08:40:12 -0400 air-2.local (55666)] INFO : Application: development
+[09/09/12 08:40:12 -0400 air-2.local (55666)] ERROR : No license key found. Please edit your newrelic.yml file and insert your license key.
+[09/09/12 08:40:12 -0400 air-2.local (55666)] INFO : New Relic Ruby Agent 3.4.2 Initialized: pid = 55666
+[09/09/12 08:40:12 -0400 air-2.local (55666)] INFO : Agent Log at /Users/twilson63/code/html2haml/log/newrelic_agent.log
+[09/09/12 08:40:50 -0400 air-2.local (55669)] INFO : Dispatcher: thin
+[09/09/12 08:40:50 -0400 air-2.local (55669)] INFO : Application: development
+[09/09/12 08:40:50 -0400 air-2.local (55669)] ERROR : No license key found. Please edit your newrelic.yml file and insert your license key.
+[09/09/12 08:40:50 -0400 air-2.local (55669)] INFO : New Relic Ruby Agent 3.4.2 Initialized: pid = 55669
+[09/09/12 08:40:50 -0400 air-2.local (55669)] INFO : Agent Log at /Users/twilson63/code/html2haml/log/newrelic_agent.log
+[09/09/12 08:42:56 -0400 air-2.local (55675)] INFO : Dispatcher: thin
+[09/09/12 08:42:56 -0400 air-2.local (55675)] INFO : Application: development
+[09/09/12 08:42:56 -0400 air-2.local (55675)] ERROR : No license key found. Please edit your newrelic.yml file and insert your license key.
+[09/09/12 08:42:56 -0400 air-2.local (55675)] INFO : New Relic Ruby Agent 3.4.2 Initialized: pid = 55675
+[09/09/12 08:42:56 -0400 air-2.local (55675)] INFO : Agent Log at /Users/twilson63/code/html2haml/log/newrelic_agent.log
+[09/09/12 08:45:25 -0400 air-2.local (55682)] INFO : Dispatcher: thin
+[09/09/12 08:45:25 -0400 air-2.local (55682)] INFO : Application: development
+[09/09/12 08:45:25 -0400 air-2.local (55682)] ERROR : No license key found. Please edit your newrelic.yml file and insert your license key.
+[09/09/12 08:45:25 -0400 air-2.local (55682)] INFO : New Relic Ruby Agent 3.4.2 Initialized: pid = 55682
+[09/09/12 08:45:25 -0400 air-2.local (55682)] INFO : Agent Log at /Users/twilson63/code/html2haml/log/newrelic_agent.log
View
Binary file not shown.
@@ -1,6 +1,6 @@
require "sinatra"
+require "html2haml"
require "haml"
-require "haml/html"
require "json"
require "net/http"
require "open-uri"
@@ -18,10 +18,13 @@
end
post '/url' do
- @html = open("http://#{params[:q]}") { |f| f.read }
- @haml = convert(@html)
- haml :index
-
+ begin
+ @html = open("http://#{params[:q]}") { |f| f.read }
+ @haml = convert(@html)
+ haml :index
+ rescue
+ redirect '/'
+ end
end
post '/api.json' do
@@ -45,5 +48,3 @@
def convert(html)
Haml::HTML.new(html, :erb => true, :xhtml => true).render
end
-
-
View
@@ -1,5 +1,5 @@
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..')
-require 'html2haml'
+require 'server'
require 'rspec'
require 'rack/test'
View
@@ -1,5 +1,5 @@
!!!
-%html
+%html{ :'ng-app' => true }
%head
%title HTML2Haml | Convert HTML Snippets to Haml
- %w{ reset text 960 app }.each do |css|
@@ -11,6 +11,7 @@
%a{:href => "http://haml-lang.com/"} Haml
= yield
+ %script{ :src => 'http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js'}
%script{ :type => "text/javascript" }
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
View
@@ -1,7 +1,7 @@
#box
%p
%span{:style => 'color:green;font-size:1.2em;'}
- Updated to Haml 3.1.6
+ Updated to Html2Haml Gem 1.0.0.beta and Haml 3.2.0.beta.3
#box
%p
%a{:href => 'http://js2cs.nodejitsu.com'} Convert Javascript to Coffeescript
View
@@ -1,5 +1,5 @@
%form{:method => "POST", :action => "/url", :id => 'hamlurl'}
%label{:for => "url"} url
%span http://
- %input{:type => 'text', :name => 'q', :style => 'width: 200px'}
+ %input{:type => 'text', :name => 'q', :style => 'width: 200px', :required => true, :placeholder => 'foo.com'}
%button Submit

0 comments on commit b906b08

Please sign in to comment.