aldebaran 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +13 -0
- data/.travis.yml +16 -0
- data/.yardopts +4 -0
- data/AUTHORS +4 -0
- data/Gemfile +77 -0
- data/KNOWN_ISSUES +5 -0
- data/LICENSE +22 -0
- data/README.rdoc +1900 -0
- data/Rakefile +175 -0
- data/aldebaran.gemspec +19 -0
- data/lib/aldebaran.rb +7 -0
- data/lib/aldebaran/base.rb +1600 -0
- data/lib/aldebaran/images/404.png +0 -0
- data/lib/aldebaran/images/500.png +0 -0
- data/lib/aldebaran/main.rb +28 -0
- data/lib/aldebaran/showexceptions.rb +340 -0
- data/lib/aldebaran/version.rb +3 -0
- data/test/aldebaran_test.rb +17 -0
- data/test/base_test.rb +160 -0
- data/test/builder_test.rb +95 -0
- data/test/coffee_test.rb +92 -0
- data/test/contest.rb +98 -0
- data/test/creole_test.rb +65 -0
- data/test/delegator_test.rb +162 -0
- data/test/encoding_test.rb +20 -0
- data/test/erb_test.rb +104 -0
- data/test/extensions_test.rb +100 -0
- data/test/filter_test.rb +397 -0
- data/test/haml_test.rb +101 -0
- data/test/helper.rb +115 -0
- data/test/helpers_test.rb +1192 -0
- data/test/less_test.rb +67 -0
- data/test/liquid_test.rb +59 -0
- data/test/mapped_error_test.rb +259 -0
- data/test/markaby_test.rb +80 -0
- data/test/markdown_test.rb +81 -0
- data/test/middleware_test.rb +68 -0
- data/test/nokogiri_test.rb +69 -0
- data/test/public/favicon.ico +0 -0
- data/test/radius_test.rb +59 -0
- data/test/rdoc_test.rb +65 -0
- data/test/readme_test.rb +136 -0
- data/test/request_test.rb +45 -0
- data/test/response_test.rb +61 -0
- data/test/result_test.rb +98 -0
- data/test/route_added_hook_test.rb +59 -0
- data/test/routing_test.rb +1096 -0
- data/test/sass_test.rb +115 -0
- data/test/scss_test.rb +88 -0
- data/test/server_test.rb +48 -0
- data/test/settings_test.rb +493 -0
- data/test/slim_test.rb +98 -0
- data/test/static_test.rb +178 -0
- data/test/streaming_test.rb +100 -0
- data/test/templates_test.rb +298 -0
- data/test/textile_test.rb +65 -0
- data/test/views/a/in_a.str +1 -0
- data/test/views/ascii.erb +2 -0
- data/test/views/b/in_b.str +1 -0
- data/test/views/calc.html.erb +1 -0
- data/test/views/error.builder +3 -0
- data/test/views/error.erb +3 -0
- data/test/views/error.haml +3 -0
- data/test/views/error.sass +2 -0
- data/test/views/explicitly_nested.str +1 -0
- data/test/views/foo/hello.test +1 -0
- data/test/views/hello.builder +1 -0
- data/test/views/hello.coffee +1 -0
- data/test/views/hello.creole +1 -0
- data/test/views/hello.erb +1 -0
- data/test/views/hello.haml +1 -0
- data/test/views/hello.less +5 -0
- data/test/views/hello.liquid +1 -0
- data/test/views/hello.mab +1 -0
- data/test/views/hello.md +1 -0
- data/test/views/hello.nokogiri +1 -0
- data/test/views/hello.radius +1 -0
- data/test/views/hello.rdoc +1 -0
- data/test/views/hello.sass +2 -0
- data/test/views/hello.scss +3 -0
- data/test/views/hello.slim +1 -0
- data/test/views/hello.str +1 -0
- data/test/views/hello.test +1 -0
- data/test/views/hello.textile +1 -0
- data/test/views/layout2.builder +3 -0
- data/test/views/layout2.erb +2 -0
- data/test/views/layout2.haml +2 -0
- data/test/views/layout2.liquid +2 -0
- data/test/views/layout2.mab +2 -0
- data/test/views/layout2.nokogiri +3 -0
- data/test/views/layout2.radius +2 -0
- data/test/views/layout2.slim +3 -0
- data/test/views/layout2.str +2 -0
- data/test/views/layout2.test +1 -0
- data/test/views/nested.str +1 -0
- data/test/views/utf8.erb +2 -0
- metadata +231 -0
@@ -0,0 +1,65 @@
|
|
1
|
+
require File.expand_path('../helper', __FILE__)
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'redcloth'
|
5
|
+
|
6
|
+
class TextileTest < Test::Unit::TestCase
|
7
|
+
def textile_app(&block)
|
8
|
+
mock_app do
|
9
|
+
set :views, File.dirname(__FILE__) + '/views'
|
10
|
+
get '/', &block
|
11
|
+
end
|
12
|
+
get '/'
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'renders inline textile strings' do
|
16
|
+
textile_app { textile 'h1. Hiya' }
|
17
|
+
assert ok?
|
18
|
+
assert_equal "<h1>Hiya</h1>", body
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'renders .textile files in views path' do
|
22
|
+
textile_app { textile :hello }
|
23
|
+
assert ok?
|
24
|
+
assert_equal "<h1>Hello From Textile</h1>", body
|
25
|
+
end
|
26
|
+
|
27
|
+
it "raises error if template not found" do
|
28
|
+
mock_app { get('/') { textile :no_such_template } }
|
29
|
+
assert_raise(Errno::ENOENT) { get('/') }
|
30
|
+
end
|
31
|
+
|
32
|
+
it "renders with inline layouts" do
|
33
|
+
mock_app do
|
34
|
+
layout { 'THIS. IS. #{yield.upcase}!' }
|
35
|
+
get('/') { textile 'Sparta', :layout_engine => :str }
|
36
|
+
end
|
37
|
+
get '/'
|
38
|
+
assert ok?
|
39
|
+
assert_like 'THIS. IS. <P>SPARTA</P>!', body
|
40
|
+
end
|
41
|
+
|
42
|
+
it "renders with file layouts" do
|
43
|
+
textile_app { textile 'Hello World', :layout => :layout2, :layout_engine => :erb }
|
44
|
+
assert ok?
|
45
|
+
assert_body "ERB Layout!\n<p>Hello World</p>"
|
46
|
+
end
|
47
|
+
|
48
|
+
it "can be used in a nested fashion for partials and whatnot" do
|
49
|
+
mock_app do
|
50
|
+
template(:inner) { "hi" }
|
51
|
+
template(:outer) { "<outer><%= textile :inner %></outer>" }
|
52
|
+
get '/' do
|
53
|
+
erb :outer
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
get '/'
|
58
|
+
assert ok?
|
59
|
+
assert_like '<outer><p>hi</p></outer>', body
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
rescue LoadError
|
64
|
+
warn "#{$!.to_s}: skipping textile tests"
|
65
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Gimme an A!
|
@@ -0,0 +1 @@
|
|
1
|
+
Gimme a B!
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= 1 + 1 %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<content>#{render :str, :hello, :layout => :layout2}</content>
|
@@ -0,0 +1 @@
|
|
1
|
+
from another views directory
|
@@ -0,0 +1 @@
|
|
1
|
+
xml.exclaim "You're my boy, #{@name}!"
|
@@ -0,0 +1 @@
|
|
1
|
+
alert "Aye!"
|
@@ -0,0 +1 @@
|
|
1
|
+
= Hello From Creole
|
@@ -0,0 +1 @@
|
|
1
|
+
Hello <%= 'World' %>
|
@@ -0,0 +1 @@
|
|
1
|
+
%h1 Hello From Haml
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>Hello From Liquid</h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
h1 "Hello From Markaby"
|
data/test/views/hello.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Hello From Markdown
|
@@ -0,0 +1 @@
|
|
1
|
+
xml.exclaim "You're my boy, #{@name}!"
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>Hello From Radius</h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
= Hello From RDoc
|
@@ -0,0 +1 @@
|
|
1
|
+
h1 Hello From Slim
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>Hello From String</h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
Hello World!
|
@@ -0,0 +1 @@
|
|
1
|
+
h1. Hello From Textile
|
@@ -0,0 +1 @@
|
|
1
|
+
Layout 2!
|
@@ -0,0 +1 @@
|
|
1
|
+
<content>#{render :str, :hello}</content>
|
data/test/views/utf8.erb
ADDED
metadata
ADDED
@@ -0,0 +1,231 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aldebaran
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Mahmut Bulut
|
14
|
+
- Eren Kaplan
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2011-09-09 00:00:00 Z
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rack
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 9
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 3
|
33
|
+
version: "1.3"
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: tilt
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 9
|
45
|
+
segments:
|
46
|
+
- 1
|
47
|
+
- 3
|
48
|
+
version: "1.3"
|
49
|
+
type: :runtime
|
50
|
+
version_requirements: *id002
|
51
|
+
description: Aldebaran is Web-development DSL micro-framework written with Mathematical Constructions
|
52
|
+
email:
|
53
|
+
executables: []
|
54
|
+
|
55
|
+
extensions: []
|
56
|
+
|
57
|
+
extra_rdoc_files:
|
58
|
+
- README.rdoc
|
59
|
+
- LICENSE
|
60
|
+
files:
|
61
|
+
- .gitignore
|
62
|
+
- .travis.yml
|
63
|
+
- .yardopts
|
64
|
+
- AUTHORS
|
65
|
+
- Gemfile
|
66
|
+
- KNOWN_ISSUES
|
67
|
+
- LICENSE
|
68
|
+
- README.rdoc
|
69
|
+
- Rakefile
|
70
|
+
- aldebaran.gemspec
|
71
|
+
- lib/aldebaran.rb
|
72
|
+
- lib/aldebaran/base.rb
|
73
|
+
- lib/aldebaran/images/404.png
|
74
|
+
- lib/aldebaran/images/500.png
|
75
|
+
- lib/aldebaran/main.rb
|
76
|
+
- lib/aldebaran/showexceptions.rb
|
77
|
+
- lib/aldebaran/version.rb
|
78
|
+
- test/aldebaran_test.rb
|
79
|
+
- test/base_test.rb
|
80
|
+
- test/builder_test.rb
|
81
|
+
- test/coffee_test.rb
|
82
|
+
- test/contest.rb
|
83
|
+
- test/creole_test.rb
|
84
|
+
- test/delegator_test.rb
|
85
|
+
- test/encoding_test.rb
|
86
|
+
- test/erb_test.rb
|
87
|
+
- test/extensions_test.rb
|
88
|
+
- test/filter_test.rb
|
89
|
+
- test/haml_test.rb
|
90
|
+
- test/helper.rb
|
91
|
+
- test/helpers_test.rb
|
92
|
+
- test/less_test.rb
|
93
|
+
- test/liquid_test.rb
|
94
|
+
- test/mapped_error_test.rb
|
95
|
+
- test/markaby_test.rb
|
96
|
+
- test/markdown_test.rb
|
97
|
+
- test/middleware_test.rb
|
98
|
+
- test/nokogiri_test.rb
|
99
|
+
- test/public/favicon.ico
|
100
|
+
- test/radius_test.rb
|
101
|
+
- test/rdoc_test.rb
|
102
|
+
- test/readme_test.rb
|
103
|
+
- test/request_test.rb
|
104
|
+
- test/response_test.rb
|
105
|
+
- test/result_test.rb
|
106
|
+
- test/route_added_hook_test.rb
|
107
|
+
- test/routing_test.rb
|
108
|
+
- test/sass_test.rb
|
109
|
+
- test/scss_test.rb
|
110
|
+
- test/server_test.rb
|
111
|
+
- test/settings_test.rb
|
112
|
+
- test/slim_test.rb
|
113
|
+
- test/static_test.rb
|
114
|
+
- test/streaming_test.rb
|
115
|
+
- test/templates_test.rb
|
116
|
+
- test/textile_test.rb
|
117
|
+
- test/views/a/in_a.str
|
118
|
+
- test/views/ascii.erb
|
119
|
+
- test/views/b/in_b.str
|
120
|
+
- test/views/calc.html.erb
|
121
|
+
- test/views/error.builder
|
122
|
+
- test/views/error.erb
|
123
|
+
- test/views/error.haml
|
124
|
+
- test/views/error.sass
|
125
|
+
- test/views/explicitly_nested.str
|
126
|
+
- test/views/foo/hello.test
|
127
|
+
- test/views/hello.builder
|
128
|
+
- test/views/hello.coffee
|
129
|
+
- test/views/hello.creole
|
130
|
+
- test/views/hello.erb
|
131
|
+
- test/views/hello.haml
|
132
|
+
- test/views/hello.less
|
133
|
+
- test/views/hello.liquid
|
134
|
+
- test/views/hello.mab
|
135
|
+
- test/views/hello.md
|
136
|
+
- test/views/hello.nokogiri
|
137
|
+
- test/views/hello.radius
|
138
|
+
- test/views/hello.rdoc
|
139
|
+
- test/views/hello.sass
|
140
|
+
- test/views/hello.scss
|
141
|
+
- test/views/hello.slim
|
142
|
+
- test/views/hello.str
|
143
|
+
- test/views/hello.test
|
144
|
+
- test/views/hello.textile
|
145
|
+
- test/views/layout2.builder
|
146
|
+
- test/views/layout2.erb
|
147
|
+
- test/views/layout2.haml
|
148
|
+
- test/views/layout2.liquid
|
149
|
+
- test/views/layout2.mab
|
150
|
+
- test/views/layout2.nokogiri
|
151
|
+
- test/views/layout2.radius
|
152
|
+
- test/views/layout2.slim
|
153
|
+
- test/views/layout2.str
|
154
|
+
- test/views/layout2.test
|
155
|
+
- test/views/nested.str
|
156
|
+
- test/views/utf8.erb
|
157
|
+
homepage: http://www.resettek.com/aldebaran
|
158
|
+
licenses: []
|
159
|
+
|
160
|
+
post_install_message:
|
161
|
+
rdoc_options:
|
162
|
+
- --line-numbers
|
163
|
+
- --inline-source
|
164
|
+
- --title
|
165
|
+
- aldebaran
|
166
|
+
- --main
|
167
|
+
- README.rdoc
|
168
|
+
require_paths:
|
169
|
+
- lib
|
170
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
171
|
+
none: false
|
172
|
+
requirements:
|
173
|
+
- - ">="
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
hash: 3
|
176
|
+
segments:
|
177
|
+
- 0
|
178
|
+
version: "0"
|
179
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
|
+
none: false
|
181
|
+
requirements:
|
182
|
+
- - ">="
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
hash: 3
|
185
|
+
segments:
|
186
|
+
- 0
|
187
|
+
version: "0"
|
188
|
+
requirements: []
|
189
|
+
|
190
|
+
rubyforge_project:
|
191
|
+
rubygems_version: 1.8.5
|
192
|
+
signing_key:
|
193
|
+
specification_version: 3
|
194
|
+
summary: DSL micro-framework with mathematical constructions
|
195
|
+
test_files:
|
196
|
+
- test/aldebaran_test.rb
|
197
|
+
- test/base_test.rb
|
198
|
+
- test/builder_test.rb
|
199
|
+
- test/coffee_test.rb
|
200
|
+
- test/creole_test.rb
|
201
|
+
- test/delegator_test.rb
|
202
|
+
- test/encoding_test.rb
|
203
|
+
- test/erb_test.rb
|
204
|
+
- test/extensions_test.rb
|
205
|
+
- test/filter_test.rb
|
206
|
+
- test/haml_test.rb
|
207
|
+
- test/helpers_test.rb
|
208
|
+
- test/less_test.rb
|
209
|
+
- test/liquid_test.rb
|
210
|
+
- test/mapped_error_test.rb
|
211
|
+
- test/markaby_test.rb
|
212
|
+
- test/markdown_test.rb
|
213
|
+
- test/middleware_test.rb
|
214
|
+
- test/nokogiri_test.rb
|
215
|
+
- test/radius_test.rb
|
216
|
+
- test/rdoc_test.rb
|
217
|
+
- test/readme_test.rb
|
218
|
+
- test/request_test.rb
|
219
|
+
- test/response_test.rb
|
220
|
+
- test/result_test.rb
|
221
|
+
- test/route_added_hook_test.rb
|
222
|
+
- test/routing_test.rb
|
223
|
+
- test/sass_test.rb
|
224
|
+
- test/scss_test.rb
|
225
|
+
- test/server_test.rb
|
226
|
+
- test/settings_test.rb
|
227
|
+
- test/slim_test.rb
|
228
|
+
- test/static_test.rb
|
229
|
+
- test/streaming_test.rb
|
230
|
+
- test/templates_test.rb
|
231
|
+
- test/textile_test.rb
|