JunKikuchi-sinatra-block-html 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +47 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/sinatra-block-html.rb +5 -1
- metadata +4 -3
data/README.rdoc
CHANGED
|
@@ -1 +1,48 @@
|
|
|
1
1
|
= sinatra-block-html
|
|
2
|
+
|
|
3
|
+
こんな感じのビューを作って
|
|
4
|
+
|
|
5
|
+
views/index.bhtml
|
|
6
|
+
html {
|
|
7
|
+
tag(:head) {
|
|
8
|
+
title.text @title
|
|
9
|
+
}
|
|
10
|
+
tag(:body) {
|
|
11
|
+
h1.text @title
|
|
12
|
+
p.text @contents
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
Sinatra の DSL で出力
|
|
17
|
+
|
|
18
|
+
require 'rubygems'
|
|
19
|
+
require 'sinatra'
|
|
20
|
+
require 'sinatra-block-html'
|
|
21
|
+
|
|
22
|
+
get '/' do
|
|
23
|
+
@title = 'Hello World!'
|
|
24
|
+
@contents = 'こんにちは!'
|
|
25
|
+
|
|
26
|
+
bhtml :index
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
Sinatra::Base で出力
|
|
30
|
+
|
|
31
|
+
require 'rubygems'
|
|
32
|
+
require 'sinatra/base'
|
|
33
|
+
require 'sinatra-block-html'
|
|
34
|
+
|
|
35
|
+
class App < Sinatra::Base
|
|
36
|
+
get '/' do
|
|
37
|
+
@title = 'Hello World!'
|
|
38
|
+
@contents = 'こんにちは!'
|
|
39
|
+
|
|
40
|
+
bhtml :index
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
use App
|
|
45
|
+
|
|
46
|
+
すると、こんな HTML が出力されます
|
|
47
|
+
|
|
48
|
+
<html><head><title>Hello World!</title></head><body><h1>Hello World!</h1><p>こんにちは!</p></body></html>
|
data/Rakefile
CHANGED
|
@@ -18,7 +18,7 @@ begin
|
|
|
18
18
|
) + Dir.glob("{bin,doc,spec,lib}/**/*")
|
|
19
19
|
s.require_path = "lib"
|
|
20
20
|
s.has_rdoc = true
|
|
21
|
-
s.add_dependency('block-html','>= 0.0.
|
|
21
|
+
s.add_dependency('block-html','>= 0.0.1')
|
|
22
22
|
end
|
|
23
23
|
rescue LoadError
|
|
24
24
|
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.2
|
data/lib/sinatra-block-html.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: JunKikuchi-sinatra-block-html
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jun Kikuchi
|
|
@@ -20,7 +20,7 @@ dependencies:
|
|
|
20
20
|
requirements:
|
|
21
21
|
- - ">="
|
|
22
22
|
- !ruby/object:Gem::Version
|
|
23
|
-
version: 0.0.
|
|
23
|
+
version: 0.0.1
|
|
24
24
|
version:
|
|
25
25
|
description: sinatra-block-html
|
|
26
26
|
email: kikuchi@bonnou.com
|
|
@@ -39,6 +39,7 @@ files:
|
|
|
39
39
|
- lib/sinatra-block-html.rb
|
|
40
40
|
has_rdoc: false
|
|
41
41
|
homepage: http://github.com/JunKikuchi/sinatra-block-html
|
|
42
|
+
licenses:
|
|
42
43
|
post_install_message:
|
|
43
44
|
rdoc_options:
|
|
44
45
|
- --charset=UTF-8
|
|
@@ -59,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
59
60
|
requirements: []
|
|
60
61
|
|
|
61
62
|
rubyforge_project:
|
|
62
|
-
rubygems_version: 1.
|
|
63
|
+
rubygems_version: 1.3.5
|
|
63
64
|
signing_key:
|
|
64
65
|
specification_version: 3
|
|
65
66
|
summary: sinatra-block-html
|