Skip to content

Instantly share code, notes, and snippets.

@akira345
Forked from eiel/rack_test.rb
Created November 29, 2012 01:05
Show Gist options
  • Save akira345/4166004 to your computer and use it in GitHub Desktop.
Save akira345/4166004 to your computer and use it in GitHub Desktop.
rack と erb の sample 初期状態
require 'rubygems'
require 'rack'
require 'erb'
class RackApp
def call(env)
[200, {'Content-Type' => 'text/html'}, [<<END_HTML]
<html>
<head><title>Rack test</title></head>
<body>
<h1>Rack test</h1>
<p>
<% (1..9).each do |y| %>
<%= y %>
<% end %>
<%(1..9).each do |x|%>
<%= x %>
<%(1..9).each do |y|%>
<%= x * y %>
<% end %>
<% end %>
</p>
</body>
</html>
END_HTML
]
end
end
require './rack_test.rb'
run RackApp.new
@eiel
Copy link

eiel commented Nov 29, 2012

次のcommitでなおせばいいやっておもったんだけどそれかっこの位置違う。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment