Skip to content

Commit 7721d8e

Browse files
committed
Todoアプリケーション2.0.0で利用するライブラリ
1 parent 6df1f31 commit 7721d8e

15 files changed

+104
-9
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ RUN apt-get update -y && apt-get install -y \
66
sqlite3 \
77
curl
88

9-
RUN gem install bundler rack
9+
RUN gem install bundler rack sinatra haml
1010

1111
WORKDIR /app
1212

1313
VOLUME /app
1414

15-
EXPOSE 9292
15+
EXPOSE 9292 4567
1616

1717
ENTRYPOINT ["/bin/bash"]
1818

attr_sample.haml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
%form{action: '/TASKS'.downcase} Rubyスクリプトを解釈する
2+
%form(action='/tasks') HTML属性風の指定

config.ru

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
require 'rack'
2+
require './sinatra_modular'
23

3-
class RackApplication
4-
def call(env)
5-
[200, {'Content-Type' => 'text/plain'},['Hello!']]
6-
end
7-
end
8-
9-
run RackApplication.new
4+
run Application

div_sample.haml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.error
2+
エラー
3+
#error_message
4+
エラーメッセージ

multi_class.haml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.foo_class.bar_class
2+
hi

ruby_sample.haml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
%ul
2+
- %w(alice bob carol).each do |name|
3+
%li
4+
= name

sample.haml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%hml
2+
%body
3+
%h1.error エラーメッセージ
4+
%p#error_message
5+
エラー内容

sinatra_classic.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
require 'sinatra'
2+
3+
get '/' do
4+
'Classic Style Sinatra!'
5+
end

sinatra_configure.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'sinatra'
2+
3+
configure do
4+
puts 'default configure'
5+
end
6+
7+
configure :production do
8+
puts 'production configure'
9+
end
10+
11+
configure :development, :test do
12+
puts 'development,test configure'
13+
end
14+
15+
get '/' do
16+
'configure sample'
17+
end

sinatra_env_sample.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require 'sinatra'
2+
3+
get '/' do
4+
puts "settings.production? => #{settings.production?}"
5+
puts "settings.development? => #{settings.development?}"
6+
puts "settings.test? => #{settings.test?}"
7+
8+
"configure sample"
9+
end

0 commit comments

Comments
 (0)