padrino-core 0.10.7 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/padrino-core.rb +58 -4
- data/lib/padrino-core/application.rb +38 -16
- data/lib/padrino-core/application/flash.rb +229 -0
- data/lib/padrino-core/application/rendering.rb +39 -11
- data/lib/padrino-core/application/rendering/extensions/erubis.rb +55 -0
- data/lib/padrino-core/application/rendering/extensions/haml.rb +26 -0
- data/lib/padrino-core/application/rendering/extensions/slim.rb +14 -0
- data/lib/padrino-core/application/routing.rb +106 -35
- data/lib/padrino-core/cli/base.rb +41 -38
- data/lib/padrino-core/cli/rake.rb +30 -9
- data/lib/padrino-core/cli/rake_tasks.rb +9 -14
- data/lib/padrino-core/loader.rb +23 -9
- data/lib/padrino-core/locale/fr.yml +1 -1
- data/lib/padrino-core/locale/ru.yml +1 -1
- data/lib/padrino-core/logger.rb +48 -32
- data/lib/padrino-core/module.rb +58 -0
- data/lib/padrino-core/mounter.rb +15 -5
- data/lib/padrino-core/reloader.rb +14 -12
- data/lib/padrino-core/server.rb +4 -4
- data/lib/padrino-core/support_lite.rb +43 -6
- data/lib/padrino-core/version.rb +1 -1
- data/padrino-core.gemspec +9 -4
- data/test/fixtures/app_gem/Gemfile +4 -0
- data/test/fixtures/app_gem/app/app.rb +3 -0
- data/test/fixtures/app_gem/app_gem.gemspec +17 -0
- data/test/fixtures/app_gem/lib/app_gem.rb +7 -0
- data/test/fixtures/app_gem/lib/app_gem/version.rb +3 -0
- data/test/mini_shoulda.rb +1 -1
- data/test/test_application.rb +38 -21
- data/test/test_csrf_protection.rb +80 -0
- data/test/test_filters.rb +70 -0
- data/test/test_flash.rb +168 -0
- data/test/test_logger.rb +27 -0
- data/test/test_mounter.rb +24 -2
- data/test/test_reloader_simple.rb +4 -4
- data/test/test_rendering.rb +75 -4
- data/test/test_routing.rb +164 -35
- data/test/test_support_lite.rb +56 -0
- metadata +52 -29
@@ -0,0 +1,56 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/helper')
|
2
|
+
|
3
|
+
describe "ObjectSpace" do
|
4
|
+
def setup
|
5
|
+
end
|
6
|
+
|
7
|
+
def teardown
|
8
|
+
end
|
9
|
+
|
10
|
+
context "#classes" do
|
11
|
+
should "take an snapshot of the current loaded classes" do
|
12
|
+
snapshot = ObjectSpace.classes
|
13
|
+
assert_equal snapshot.include?(Padrino::Logger), true
|
14
|
+
end
|
15
|
+
|
16
|
+
should "return a Set object" do
|
17
|
+
snapshot = ObjectSpace.classes
|
18
|
+
assert_equal snapshot.kind_of?(Set), true
|
19
|
+
end
|
20
|
+
|
21
|
+
should "be able to process a the class name given a block" do
|
22
|
+
klasses = ObjectSpace.classes do |klass|
|
23
|
+
if klass.name =~ /^Padrino::/
|
24
|
+
klass
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
assert_equal (klasses.size > 1), true
|
29
|
+
klasses.each do |klass|
|
30
|
+
assert_match /^Padrino::/, klass.to_s
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context "#new_classes" do
|
36
|
+
setup do
|
37
|
+
@snapshot = ObjectSpace.classes
|
38
|
+
end
|
39
|
+
|
40
|
+
should "return list of new classes" do
|
41
|
+
class OSTest; end
|
42
|
+
module OSTestModule; class B; end; end
|
43
|
+
|
44
|
+
new_classes = ObjectSpace.new_classes(@snapshot)
|
45
|
+
|
46
|
+
assert_equal new_classes.size, 2
|
47
|
+
assert_equal new_classes.include?(OSTest), true
|
48
|
+
assert_equal new_classes.include?(OSTestModule::B), true
|
49
|
+
end
|
50
|
+
|
51
|
+
should "return a Set object" do
|
52
|
+
new_classes = ObjectSpace.new_classes(@snapshot)
|
53
|
+
assert_equal new_classes.kind_of?(Set), true
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: padrino-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.11.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Padrino Team
|
@@ -12,12 +11,11 @@ authors:
|
|
12
11
|
autorequire:
|
13
12
|
bindir: bin
|
14
13
|
cert_chain: []
|
15
|
-
date:
|
14
|
+
date: 2013-03-22 00:00:00.000000000 Z
|
16
15
|
dependencies:
|
17
16
|
- !ruby/object:Gem::Dependency
|
18
17
|
name: tilt
|
19
18
|
requirement: !ruby/object:Gem::Requirement
|
20
|
-
none: false
|
21
19
|
requirements:
|
22
20
|
- - ~>
|
23
21
|
- !ruby/object:Gem::Version
|
@@ -25,7 +23,6 @@ dependencies:
|
|
25
23
|
type: :runtime
|
26
24
|
prerelease: false
|
27
25
|
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
26
|
requirements:
|
30
27
|
- - ~>
|
31
28
|
- !ruby/object:Gem::Version
|
@@ -33,67 +30,73 @@ dependencies:
|
|
33
30
|
- !ruby/object:Gem::Dependency
|
34
31
|
name: sinatra
|
35
32
|
requirement: !ruby/object:Gem::Requirement
|
36
|
-
none: false
|
37
33
|
requirements:
|
38
34
|
- - ~>
|
39
35
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
36
|
+
version: 1.4.2
|
41
37
|
type: :runtime
|
42
38
|
prerelease: false
|
43
39
|
version_requirements: !ruby/object:Gem::Requirement
|
44
|
-
none: false
|
45
40
|
requirements:
|
46
41
|
- - ~>
|
47
42
|
- !ruby/object:Gem::Version
|
48
|
-
version: 1.
|
43
|
+
version: 1.4.2
|
49
44
|
- !ruby/object:Gem::Dependency
|
50
45
|
name: http_router
|
51
46
|
requirement: !ruby/object:Gem::Requirement
|
52
|
-
none: false
|
53
47
|
requirements:
|
54
48
|
- - ~>
|
55
49
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.
|
50
|
+
version: 0.11.0
|
57
51
|
type: :runtime
|
58
52
|
prerelease: false
|
59
53
|
version_requirements: !ruby/object:Gem::Requirement
|
60
|
-
none: false
|
61
54
|
requirements:
|
62
55
|
- - ~>
|
63
56
|
- !ruby/object:Gem::Version
|
64
|
-
version: 0.
|
57
|
+
version: 0.11.0
|
65
58
|
- !ruby/object:Gem::Dependency
|
66
59
|
name: thor
|
67
60
|
requirement: !ruby/object:Gem::Requirement
|
68
|
-
none: false
|
69
61
|
requirements:
|
70
62
|
- - ~>
|
71
63
|
- !ruby/object:Gem::Version
|
72
|
-
version: 0.
|
64
|
+
version: 0.17.0
|
73
65
|
type: :runtime
|
74
66
|
prerelease: false
|
75
67
|
version_requirements: !ruby/object:Gem::Requirement
|
76
|
-
none: false
|
77
68
|
requirements:
|
78
69
|
- - ~>
|
79
70
|
- !ruby/object:Gem::Version
|
80
|
-
version: 0.
|
71
|
+
version: 0.17.0
|
81
72
|
- !ruby/object:Gem::Dependency
|
82
73
|
name: activesupport
|
83
74
|
requirement: !ruby/object:Gem::Requirement
|
84
|
-
none: false
|
85
75
|
requirements:
|
86
|
-
- -
|
76
|
+
- - '>='
|
87
77
|
- !ruby/object:Gem::Version
|
88
|
-
version: 3.
|
78
|
+
version: 3.1.0
|
89
79
|
type: :runtime
|
90
80
|
prerelease: false
|
91
81
|
version_requirements: !ruby/object:Gem::Requirement
|
92
|
-
none: false
|
93
82
|
requirements:
|
94
|
-
- -
|
83
|
+
- - '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 3.1.0
|
86
|
+
- !ruby/object:Gem::Dependency
|
87
|
+
name: rack-protection
|
88
|
+
requirement: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: 1.5.0
|
93
|
+
type: :runtime
|
94
|
+
prerelease: false
|
95
|
+
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - '>='
|
95
98
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
99
|
+
version: 1.5.0
|
97
100
|
description: The Padrino core gem required for use of this framework
|
98
101
|
email: padrinorb@gmail.com
|
99
102
|
executables:
|
@@ -111,7 +114,11 @@ files:
|
|
111
114
|
- bin/padrino
|
112
115
|
- lib/padrino-core.rb
|
113
116
|
- lib/padrino-core/application.rb
|
117
|
+
- lib/padrino-core/application/flash.rb
|
114
118
|
- lib/padrino-core/application/rendering.rb
|
119
|
+
- lib/padrino-core/application/rendering/extensions/erubis.rb
|
120
|
+
- lib/padrino-core/application/rendering/extensions/haml.rb
|
121
|
+
- lib/padrino-core/application/rendering/extensions/slim.rb
|
115
122
|
- lib/padrino-core/application/routing.rb
|
116
123
|
- lib/padrino-core/application/showexceptions.rb
|
117
124
|
- lib/padrino-core/caller.rb
|
@@ -146,6 +153,7 @@ files:
|
|
146
153
|
- lib/padrino-core/locale/zh_cn.yml
|
147
154
|
- lib/padrino-core/locale/zh_tw.yml
|
148
155
|
- lib/padrino-core/logger.rb
|
156
|
+
- lib/padrino-core/module.rb
|
149
157
|
- lib/padrino-core/mounter.rb
|
150
158
|
- lib/padrino-core/reloader.rb
|
151
159
|
- lib/padrino-core/router.rb
|
@@ -154,6 +162,11 @@ files:
|
|
154
162
|
- lib/padrino-core/tasks.rb
|
155
163
|
- lib/padrino-core/version.rb
|
156
164
|
- padrino-core.gemspec
|
165
|
+
- test/fixtures/app_gem/Gemfile
|
166
|
+
- test/fixtures/app_gem/app/app.rb
|
167
|
+
- test/fixtures/app_gem/app_gem.gemspec
|
168
|
+
- test/fixtures/app_gem/lib/app_gem.rb
|
169
|
+
- test/fixtures/app_gem/lib/app_gem/version.rb
|
157
170
|
- test/fixtures/apps/.components
|
158
171
|
- test/fixtures/apps/.gitignore
|
159
172
|
- test/fixtures/apps/complex.rb
|
@@ -169,8 +182,10 @@ files:
|
|
169
182
|
- test/mini_shoulda.rb
|
170
183
|
- test/test_application.rb
|
171
184
|
- test/test_core.rb
|
185
|
+
- test/test_csrf_protection.rb
|
172
186
|
- test/test_dependencies.rb
|
173
187
|
- test/test_filters.rb
|
188
|
+
- test/test_flash.rb
|
174
189
|
- test/test_locale.rb
|
175
190
|
- test/test_logger.rb
|
176
191
|
- test/test_mounter.rb
|
@@ -180,32 +195,37 @@ files:
|
|
180
195
|
- test/test_restful_routing.rb
|
181
196
|
- test/test_router.rb
|
182
197
|
- test/test_routing.rb
|
198
|
+
- test/test_support_lite.rb
|
183
199
|
homepage: http://www.padrinorb.com
|
184
200
|
licenses: []
|
201
|
+
metadata: {}
|
185
202
|
post_install_message:
|
186
203
|
rdoc_options:
|
187
204
|
- --charset=UTF-8
|
188
205
|
require_paths:
|
189
206
|
- lib
|
190
207
|
required_ruby_version: !ruby/object:Gem::Requirement
|
191
|
-
none: false
|
192
208
|
requirements:
|
193
|
-
- -
|
209
|
+
- - '>='
|
194
210
|
- !ruby/object:Gem::Version
|
195
211
|
version: '0'
|
196
212
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
|
-
none: false
|
198
213
|
requirements:
|
199
|
-
- -
|
214
|
+
- - '>='
|
200
215
|
- !ruby/object:Gem::Version
|
201
216
|
version: 1.3.6
|
202
217
|
requirements: []
|
203
218
|
rubyforge_project: padrino-core
|
204
|
-
rubygems_version:
|
219
|
+
rubygems_version: 2.0.3
|
205
220
|
signing_key:
|
206
|
-
specification_version:
|
221
|
+
specification_version: 4
|
207
222
|
summary: The required Padrino core gem
|
208
223
|
test_files:
|
224
|
+
- test/fixtures/app_gem/Gemfile
|
225
|
+
- test/fixtures/app_gem/app/app.rb
|
226
|
+
- test/fixtures/app_gem/app_gem.gemspec
|
227
|
+
- test/fixtures/app_gem/lib/app_gem.rb
|
228
|
+
- test/fixtures/app_gem/lib/app_gem/version.rb
|
209
229
|
- test/fixtures/apps/.components
|
210
230
|
- test/fixtures/apps/.gitignore
|
211
231
|
- test/fixtures/apps/complex.rb
|
@@ -221,8 +241,10 @@ test_files:
|
|
221
241
|
- test/mini_shoulda.rb
|
222
242
|
- test/test_application.rb
|
223
243
|
- test/test_core.rb
|
244
|
+
- test/test_csrf_protection.rb
|
224
245
|
- test/test_dependencies.rb
|
225
246
|
- test/test_filters.rb
|
247
|
+
- test/test_flash.rb
|
226
248
|
- test/test_locale.rb
|
227
249
|
- test/test_logger.rb
|
228
250
|
- test/test_mounter.rb
|
@@ -232,4 +254,5 @@ test_files:
|
|
232
254
|
- test/test_restful_routing.rb
|
233
255
|
- test/test_router.rb
|
234
256
|
- test/test_routing.rb
|
257
|
+
- test/test_support_lite.rb
|
235
258
|
has_rdoc:
|