rabl 0.8.6 → 0.9.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.travis.yml +0 -3
- data/CHANGELOG.md +7 -0
- data/Gemfile +1 -2
- data/Gemfile.ci +0 -1
- data/README.md +1 -0
- data/Rakefile +1 -1
- data/fixtures/rails2/config/environment.rb +22 -0
- data/fixtures/rails4/.gitignore +16 -0
- data/fixtures/rails4/Gemfile +47 -0
- data/fixtures/rails4/README.rdoc +28 -0
- data/fixtures/rails4/Rakefile +11 -0
- data/fixtures/rails4/app/assets/javascripts/application.js +16 -0
- data/fixtures/rails4/app/assets/stylesheets/application.css +13 -0
- data/fixtures/rails4/app/controllers/application_controller.rb +5 -0
- data/fixtures/rails4/app/controllers/concerns/.keep +0 -0
- data/fixtures/rails4/app/controllers/posts_controller.rb +11 -0
- data/fixtures/rails4/app/controllers/users_controller.rb +11 -0
- data/fixtures/rails4/app/helpers/application_helper.rb +5 -0
- data/fixtures/rails4/app/mailers/.keep +0 -0
- data/fixtures/rails4/bin/bundle +3 -0
- data/fixtures/rails4/bin/rails +4 -0
- data/fixtures/rails4/bin/rake +4 -0
- data/fixtures/rails4/config.ru +4 -0
- data/fixtures/rails4/config/application.rb +23 -0
- data/fixtures/rails4/config/boot.rb +4 -0
- data/fixtures/rails4/config/database.yml +25 -0
- data/fixtures/rails4/config/environment.rb +5 -0
- data/fixtures/rails4/config/environments/development.rb +29 -0
- data/fixtures/rails4/config/environments/production.rb +80 -0
- data/fixtures/rails4/config/environments/test.rb +36 -0
- data/fixtures/rails4/config/initializers/backtrace_silencers.rb +7 -0
- data/fixtures/rails4/config/initializers/filter_parameter_logging.rb +4 -0
- data/fixtures/rails4/config/initializers/inflections.rb +16 -0
- data/fixtures/rails4/config/initializers/mime_types.rb +7 -0
- data/fixtures/rails4/config/initializers/secret_token.rb +12 -0
- data/fixtures/rails4/config/initializers/session_store.rb +3 -0
- data/fixtures/rails4/config/initializers/wrap_parameters.rb +14 -0
- data/fixtures/rails4/config/locales/en.yml +23 -0
- data/fixtures/rails4/config/routes.rb +51 -0
- data/fixtures/rails4/db/seeds.rb +7 -0
- data/fixtures/rails4/lib/assets/.keep +0 -0
- data/fixtures/rails4/lib/tasks/.keep +0 -0
- data/fixtures/rails4/log/.keep +0 -0
- data/fixtures/rails4/public/404.html +58 -0
- data/fixtures/rails4/public/422.html +58 -0
- data/fixtures/rails4/public/500.html +57 -0
- data/fixtures/rails4/public/favicon.ico +0 -0
- data/fixtures/rails4/public/robots.txt +5 -0
- data/fixtures/rails4/test/controllers/.keep +0 -0
- data/fixtures/rails4/test/fixtures/.keep +0 -0
- data/fixtures/rails4/test/functional/posts_controller_test.rb +232 -0
- data/fixtures/rails4/test/functional/users_controller_test.rb +87 -0
- data/fixtures/rails4/test/helpers/.keep +0 -0
- data/fixtures/rails4/test/integration/.keep +0 -0
- data/fixtures/rails4/test/mailers/.keep +0 -0
- data/fixtures/rails4/test/models/.keep +0 -0
- data/fixtures/rails4/test/test_helper.rb +26 -0
- data/fixtures/rails4/vendor/assets/javascripts/.keep +0 -0
- data/fixtures/rails4/vendor/assets/stylesheets/.keep +0 -0
- data/lib/rabl.rb +6 -1
- data/lib/rabl/builder.rb +3 -1
- data/lib/rabl/digestor.rb +21 -0
- data/lib/rabl/engine.rb +20 -2
- data/lib/rabl/helpers.rb +7 -1
- data/lib/rabl/railtie.rb +6 -0
- data/lib/rabl/template.rb +1 -1
- data/lib/rabl/tracker.rb +53 -0
- data/lib/rabl/version.rb +1 -1
- data/rabl.gemspec +6 -1
- data/test/engine_test.rb +23 -0
- data/test/helpers_test.rb +6 -0
- data/test/integration/rails4/posts_controller_test.rb +232 -0
- data/test/integration/rails4/users_controller_test.rb +87 -0
- data/test/msgpack_engine_test.rb +50 -49
- data/test/renderer_test.rb +2 -2
- data/test/teststrap.rb +6 -2
- metadata +65 -33
@@ -0,0 +1,87 @@
|
|
1
|
+
# Lives in <rabl>/test/integration/users_controller_test.rb
|
2
|
+
# Symlinked to fixture applications
|
3
|
+
|
4
|
+
begin # Sinatra
|
5
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
|
6
|
+
rescue LoadError # Rails
|
7
|
+
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
|
8
|
+
end
|
9
|
+
|
10
|
+
context "UsersController" do
|
11
|
+
helper(:json_output) { JSON.parse(last_response.body) }
|
12
|
+
|
13
|
+
setup do
|
14
|
+
create_users!
|
15
|
+
end
|
16
|
+
|
17
|
+
context "for index action" do
|
18
|
+
# Tests `collection @users` extending from 'show' template
|
19
|
+
|
20
|
+
setup do
|
21
|
+
get "/users", format: :json
|
22
|
+
end
|
23
|
+
|
24
|
+
# Attributes (regular)
|
25
|
+
asserts("contains user usernames") do
|
26
|
+
json_output.map { |u| u["user"]["username"] }
|
27
|
+
end.equals { @users.map(&:username) }
|
28
|
+
asserts("contains email") do
|
29
|
+
json_output.map { |u| u["user"]["email"] }
|
30
|
+
end.equals { @users.map(&:email) }
|
31
|
+
asserts("contains location") do
|
32
|
+
json_output.map { |u| u["user"]["location"] }
|
33
|
+
end.equals { @users.map(&:location) }
|
34
|
+
|
35
|
+
# Attributes (custom name)
|
36
|
+
asserts("contains registered_at") do
|
37
|
+
json_output.map { |u| u["user"]["registered_at"] }
|
38
|
+
end.equals { @users.map(&:created_at).map(&:utc).map(&:to_s) }
|
39
|
+
|
40
|
+
# Node (renders based on attribute)
|
41
|
+
asserts("contains role") do
|
42
|
+
json_output.map { |u| u["user"]["role"] }
|
43
|
+
end.equals ['normal', 'normal', 'admin']
|
44
|
+
|
45
|
+
# Child (custom collection name)
|
46
|
+
asserts("contains formatted phone numbers") do
|
47
|
+
json_output.map { |u| u["user"]["pnumbers"].map { |n| n["pnumber"]["formatted"] } }
|
48
|
+
end.equals { @users.map { |u| u.phone_numbers.map(&:formatted) } }
|
49
|
+
|
50
|
+
# Node (renders collection partial)
|
51
|
+
asserts("contains reversed node numbers") do
|
52
|
+
json_output.map { |u| u["user"]["node_numbers"].map { |n| n["reversed"] } }
|
53
|
+
end.equals { @users.map { |u| u.phone_numbers.map(&:formatted).map(&:reverse) } }
|
54
|
+
end # index
|
55
|
+
|
56
|
+
context "for show action" do
|
57
|
+
# Tests `object :user => :person` custom parent node name
|
58
|
+
setup do
|
59
|
+
get "/users/#{@user1.id}", format: :json
|
60
|
+
end
|
61
|
+
|
62
|
+
# Attributes (regular)
|
63
|
+
asserts("contains username") { json_output["person"]["username"] }.equals { @user1.username }
|
64
|
+
asserts("contains email") { json_output["person"]["email"] }.equals { @user1.email }
|
65
|
+
asserts("contains location") { json_output["person"]["location"] }.equals { @user1.location }
|
66
|
+
# Attributes (custom name)
|
67
|
+
asserts("contains registered_at") { json_output["person"]["registered_at"] }.equals { @user1.created_at.utc.to_s }
|
68
|
+
# Node (renders based on attribute)
|
69
|
+
asserts("contains role node") { json_output["person"]["role"] }.equals "normal"
|
70
|
+
|
71
|
+
# Child (custom collection name)
|
72
|
+
asserts("contains first phone number") {
|
73
|
+
json_output["person"]["pnumbers"][0]["pnumber"]["formatted"]
|
74
|
+
}.equals { @user1.phone_numbers[0].formatted }
|
75
|
+
asserts("contains second phone number") {
|
76
|
+
json_output["person"]["pnumbers"][1]["pnumber"]["formatted"]
|
77
|
+
}.equals { @user1.phone_numbers[1].formatted }
|
78
|
+
|
79
|
+
# Node (renders collection partial)
|
80
|
+
asserts("contains first node number") {
|
81
|
+
json_output["person"]["node_numbers"][0]["formatted"]
|
82
|
+
}.equals { @user1.phone_numbers[0].formatted }
|
83
|
+
asserts("contains second node number") {
|
84
|
+
json_output["person"]["node_numbers"][1]["formatted"]
|
85
|
+
}.equals { @user1.phone_numbers[1].formatted }
|
86
|
+
end # show
|
87
|
+
end
|
data/test/msgpack_engine_test.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: iso-8859-1
|
2
|
+
|
1
3
|
require File.expand_path('../teststrap', __FILE__)
|
2
4
|
require 'rabl/template'
|
3
5
|
|
@@ -19,8 +21,8 @@ context "Rabl::Engine" do
|
|
19
21
|
}
|
20
22
|
scope = Object.new
|
21
23
|
scope.instance_variable_set :@user, User.new
|
22
|
-
template.render(scope)
|
23
|
-
end.
|
24
|
+
char_split template.render(scope)
|
25
|
+
end.equals char_split("\x81\xA4user\x80")
|
24
26
|
|
25
27
|
asserts "that it can set root node" do
|
26
28
|
template = rabl %q{
|
@@ -28,8 +30,8 @@ context "Rabl::Engine" do
|
|
28
30
|
}
|
29
31
|
scope = Object.new
|
30
32
|
scope.instance_variable_set :@user, User.new
|
31
|
-
template.render(scope)
|
32
|
-
end.equals "\x81\xA6person\x80"
|
33
|
+
char_split template.render(scope)
|
34
|
+
end.equals char_split("\x81\xA6person\x80")
|
33
35
|
end
|
34
36
|
|
35
37
|
context "#collection" do
|
@@ -39,8 +41,8 @@ context "Rabl::Engine" do
|
|
39
41
|
}
|
40
42
|
scope = Object.new
|
41
43
|
scope.instance_variable_set :@users, [User.new, User.new]
|
42
|
-
template.render(scope)
|
43
|
-
end.equals "\x92\x81\xA4user\x80\x81\xA4user\x80"
|
44
|
+
char_split template.render(scope)
|
45
|
+
end.equals char_split("\x92\x81\xA4user\x80\x81\xA4user\x80")
|
44
46
|
|
45
47
|
asserts "that it sets root node for objects" do
|
46
48
|
template = rabl %{
|
@@ -48,8 +50,8 @@ context "Rabl::Engine" do
|
|
48
50
|
}
|
49
51
|
scope = Object.new
|
50
52
|
scope.instance_variable_set :@users, [User.new, User.new]
|
51
|
-
template.render(scope)
|
52
|
-
end.equals "\x81\xA6person\x92\x81\xA6person\x80\x81\xA6person\x80"
|
53
|
+
char_split template.render(scope)
|
54
|
+
end.equals char_split("\x81\xA6person\x92\x81\xA6person\x80\x81\xA6person\x80")
|
53
55
|
end
|
54
56
|
|
55
57
|
context "#attribute" do
|
@@ -60,8 +62,8 @@ context "Rabl::Engine" do
|
|
60
62
|
}
|
61
63
|
scope = Object.new
|
62
64
|
scope.instance_variable_set :@user, User.new(:name => 'irvine')
|
63
|
-
template.render(scope)
|
64
|
-
end.equals "\x81\xA4user\x81\xA4name\xA6irvine"
|
65
|
+
char_split template.render(scope)
|
66
|
+
end.equals char_split("\x81\xA4user\x81\xA4name\xA6irvine")
|
65
67
|
|
66
68
|
asserts "that it can add attribute under a different key name through :as" do
|
67
69
|
template = rabl %{
|
@@ -70,8 +72,8 @@ context "Rabl::Engine" do
|
|
70
72
|
}
|
71
73
|
scope = Object.new
|
72
74
|
scope.instance_variable_set :@user, User.new(:name => 'irvine')
|
73
|
-
template.render(scope)
|
74
|
-
end.equals "\x81\xA4user\x81\xA4city\xA6irvine"
|
75
|
+
char_split template.render(scope)
|
76
|
+
end.equals char_split("\x81\xA4user\x81\xA4city\xA6irvine")
|
75
77
|
|
76
78
|
asserts "that it can add attribute under a different key name through hash" do
|
77
79
|
template = rabl %{
|
@@ -80,8 +82,8 @@ context "Rabl::Engine" do
|
|
80
82
|
}
|
81
83
|
scope = Object.new
|
82
84
|
scope.instance_variable_set :@user, User.new(:name => 'irvine')
|
83
|
-
template.render(scope)
|
84
|
-
end.equals "\x81\xA4user\x81\xA4city\xA6irvine"
|
85
|
+
char_split template.render(scope)
|
86
|
+
end.equals char_split("\x81\xA4user\x81\xA4city\xA6irvine")
|
85
87
|
end
|
86
88
|
|
87
89
|
context "#code" do
|
@@ -89,15 +91,15 @@ context "Rabl::Engine" do
|
|
89
91
|
template = rabl %{
|
90
92
|
code(:foo) { 'bar' }
|
91
93
|
}
|
92
|
-
template.render(Object.new)
|
93
|
-
end.equals "\x81\xA3foo\xA3bar"
|
94
|
+
char_split template.render(Object.new)
|
95
|
+
end.equals char_split("\x81\xA3foo\xA3bar")
|
94
96
|
|
95
97
|
asserts "that it can be passed conditionals" do
|
96
98
|
template = rabl %{
|
97
99
|
code(:foo, :if => lambda { |i| false }) { 'bar' }
|
98
100
|
}
|
99
|
-
template.render(Object.new)
|
100
|
-
end.equals "\x80"
|
101
|
+
char_split template.render(Object.new)
|
102
|
+
end.equals char_split("\x80")
|
101
103
|
end
|
102
104
|
|
103
105
|
context "#child" do
|
@@ -109,8 +111,8 @@ context "Rabl::Engine" do
|
|
109
111
|
}
|
110
112
|
scope = Object.new
|
111
113
|
scope.instance_variable_set :@user, User.new(:name => 'leo', :city => 'LA')
|
112
|
-
template.render(scope)
|
113
|
-
end.equals "\x81\xA4user\x82\xA4name\xA3leo\xA4user\x81\xA4city\xA2LA"
|
114
|
+
char_split template.render(scope)
|
115
|
+
end.equals char_split("\x81\xA4user\x82\xA4name\xA3leo\xA4user\x81\xA4city\xA2LA")
|
114
116
|
|
115
117
|
asserts "that it can create a child node with different key" do
|
116
118
|
template = rabl %{
|
@@ -120,9 +122,8 @@ context "Rabl::Engine" do
|
|
120
122
|
}
|
121
123
|
scope = Object.new
|
122
124
|
scope.instance_variable_set :@user, User.new(:name => 'leo', :city => 'LA')
|
123
|
-
template.render(scope)
|
124
|
-
|
125
|
-
end.equals "\x81\xA4user\x82\xA4name\xA3leo\xA6person\x81\xA4city\xA2LA".split("").sort
|
125
|
+
char_split template.render(scope)
|
126
|
+
end.equals char_split("\x81\xA4user\x82\xA4name\xA3leo\xA6person\x81\xA4city\xA2LA")
|
126
127
|
end
|
127
128
|
|
128
129
|
context "#glue" do
|
@@ -135,8 +136,8 @@ context "Rabl::Engine" do
|
|
135
136
|
}
|
136
137
|
scope = Object.new
|
137
138
|
scope.instance_variable_set :@user, User.new(:name => 'leo', :city => 'LA', :age => 12)
|
138
|
-
template.render(scope)
|
139
|
-
end.equals "\x81\xA4user\x83\xA4name\xA3leo\xA4city\xA2LA\xA3age\f"
|
139
|
+
char_split template.render(scope)
|
140
|
+
end.equals char_split("\x81\xA4user\x83\xA4name\xA3leo\xA4city\xA2LA\xA3age\f")
|
140
141
|
end
|
141
142
|
|
142
143
|
teardown do
|
@@ -185,8 +186,8 @@ context "Rabl::Engine" do
|
|
185
186
|
}
|
186
187
|
scope = Object.new
|
187
188
|
scope.instance_variable_set :@user, User.new
|
188
|
-
template.render(scope)
|
189
|
-
end.
|
189
|
+
char_split template.render(scope)
|
190
|
+
end.equals char_split("\x80")
|
190
191
|
|
191
192
|
asserts "that it can set root node" do
|
192
193
|
template = rabl %q{
|
@@ -194,8 +195,8 @@ context "Rabl::Engine" do
|
|
194
195
|
}
|
195
196
|
scope = Object.new
|
196
197
|
scope.instance_variable_set :@user, User.new
|
197
|
-
template.render(scope)
|
198
|
-
end.equals "\x80"
|
198
|
+
char_split template.render(scope)
|
199
|
+
end.equals char_split("\x80")
|
199
200
|
end
|
200
201
|
|
201
202
|
context "#collection" do
|
@@ -205,8 +206,8 @@ context "Rabl::Engine" do
|
|
205
206
|
}
|
206
207
|
scope = Object.new
|
207
208
|
scope.instance_variable_set :@users, [User.new, User.new]
|
208
|
-
template.render(scope)
|
209
|
-
end.equals "\x92\x80\x80"
|
209
|
+
char_split template.render(scope)
|
210
|
+
end.equals char_split("\x92\x80\x80")
|
210
211
|
|
211
212
|
asserts "that it sets root node for objects" do
|
212
213
|
template = rabl %{
|
@@ -214,8 +215,8 @@ context "Rabl::Engine" do
|
|
214
215
|
}
|
215
216
|
scope = Object.new
|
216
217
|
scope.instance_variable_set :@users, [User.new, User.new]
|
217
|
-
template.render(scope)
|
218
|
-
end.equals "\x81\xA6person\x92\x80\x80"
|
218
|
+
char_split template.render(scope)
|
219
|
+
end.equals char_split("\x81\xA6person\x92\x80\x80")
|
219
220
|
end
|
220
221
|
|
221
222
|
context "#attribute" do
|
@@ -226,8 +227,8 @@ context "Rabl::Engine" do
|
|
226
227
|
}
|
227
228
|
scope = Object.new
|
228
229
|
scope.instance_variable_set :@user, User.new(:name => 'irvine')
|
229
|
-
template.render(scope)
|
230
|
-
end.equals "\x81\xA4name\xA6irvine"
|
230
|
+
char_split template.render(scope)
|
231
|
+
end.equals char_split("\x81\xA4name\xA6irvine")
|
231
232
|
|
232
233
|
asserts "that it can add attribute under a different key name through :as" do
|
233
234
|
template = rabl %{
|
@@ -236,8 +237,8 @@ context "Rabl::Engine" do
|
|
236
237
|
}
|
237
238
|
scope = Object.new
|
238
239
|
scope.instance_variable_set :@user, User.new(:name => 'irvine')
|
239
|
-
template.render(scope)
|
240
|
-
end.equals "\x81\xA4city\xA6irvine"
|
240
|
+
char_split template.render(scope)
|
241
|
+
end.equals char_split("\x81\xA4city\xA6irvine")
|
241
242
|
|
242
243
|
asserts "that it can add attribute under a different key name through hash" do
|
243
244
|
template = rabl %{
|
@@ -246,8 +247,8 @@ context "Rabl::Engine" do
|
|
246
247
|
}
|
247
248
|
scope = Object.new
|
248
249
|
scope.instance_variable_set :@user, User.new(:name => 'irvine')
|
249
|
-
template.render(scope)
|
250
|
-
end.equals "\x81\xA4city\xA6irvine"
|
250
|
+
char_split template.render(scope)
|
251
|
+
end.equals char_split("\x81\xA4city\xA6irvine")
|
251
252
|
end
|
252
253
|
|
253
254
|
context "#code" do
|
@@ -255,15 +256,15 @@ context "Rabl::Engine" do
|
|
255
256
|
template = rabl %{
|
256
257
|
code(:foo) { 'bar' }
|
257
258
|
}
|
258
|
-
template.render(Object.new)
|
259
|
-
end.equals "\x81\xA3foo\xA3bar"
|
259
|
+
char_split template.render(Object.new)
|
260
|
+
end.equals char_split("\x81\xA3foo\xA3bar")
|
260
261
|
|
261
262
|
asserts "that it can be passed conditionals" do
|
262
263
|
template = rabl %{
|
263
264
|
code(:foo, :if => lambda { |i| false }) { 'bar' }
|
264
265
|
}
|
265
|
-
template.render(Object.new)
|
266
|
-
end.equals "\x80"
|
266
|
+
char_split template.render(Object.new)
|
267
|
+
end.equals char_split("\x80")
|
267
268
|
end
|
268
269
|
|
269
270
|
context "#child" do
|
@@ -275,8 +276,8 @@ context "Rabl::Engine" do
|
|
275
276
|
}
|
276
277
|
scope = Object.new
|
277
278
|
scope.instance_variable_set :@user, User.new(:name => 'leo', :city => 'LA')
|
278
|
-
template.render(scope)
|
279
|
-
end.equals "\x82\xA4name\xA3leo\xA4user\x81\xA4city\xA2LA"
|
279
|
+
char_split template.render(scope)
|
280
|
+
end.equals char_split("\x82\xA4name\xA3leo\xA4user\x81\xA4city\xA2LA")
|
280
281
|
|
281
282
|
asserts "that it can create a child node with different key" do
|
282
283
|
template = rabl %{
|
@@ -286,8 +287,8 @@ context "Rabl::Engine" do
|
|
286
287
|
}
|
287
288
|
scope = Object.new
|
288
289
|
scope.instance_variable_set :@user, User.new(:name => 'leo', :city => 'LA')
|
289
|
-
template.render(scope)
|
290
|
-
end.equals "\x82\xA4name\xA3leo\xA6person\x81\xA4city\xA2LA"
|
290
|
+
char_split template.render(scope)
|
291
|
+
end.equals char_split("\x82\xA4name\xA3leo\xA6person\x81\xA4city\xA2LA")
|
291
292
|
end
|
292
293
|
|
293
294
|
context "#glue" do
|
@@ -300,8 +301,8 @@ context "Rabl::Engine" do
|
|
300
301
|
}
|
301
302
|
scope = Object.new
|
302
303
|
scope.instance_variable_set :@user, User.new(:name => 'leo', :city => 'LA', :age => 12)
|
303
|
-
template.render(scope)
|
304
|
-
end.equals "\x83\xA4name\xA3leo\xA4city\xA2LA\xA3age\f"
|
304
|
+
char_split template.render(scope)
|
305
|
+
end.equals char_split("\x83\xA4name\xA3leo\xA4city\xA2LA\xA3age\f")
|
305
306
|
end
|
306
307
|
|
307
308
|
teardown do
|
data/test/renderer_test.rb
CHANGED
@@ -370,8 +370,8 @@ context "Rabl::Renderer" do
|
|
370
370
|
end
|
371
371
|
|
372
372
|
user = User.new(:name => 'ivan')
|
373
|
-
Rabl::Renderer.msgpack(user, 'test', :view_path => tmp_path)
|
374
|
-
end.equals "\x81\xA4user\x83\xA3age\x18\xA4name\xA4ivan\xA5float\xCB@\x93J=p\xA3\xD7\n"
|
373
|
+
char_split Rabl::Renderer.msgpack(user, 'test', :view_path => tmp_path)
|
374
|
+
end.equals char_split("\x81\xA4user\x83\xA3age\x18\xA4name\xA4ivan\xA5float\xCB@\x93J=p\xA3\xD7\n")
|
375
375
|
end
|
376
376
|
|
377
377
|
context '.plist' do
|
data/test/teststrap.rb
CHANGED
@@ -24,9 +24,13 @@ end
|
|
24
24
|
Riot.pretty_dots
|
25
25
|
|
26
26
|
class Riot::Situation
|
27
|
-
|
27
|
+
def char_split(str)
|
28
|
+
str.force_encoding("iso-8859-1").split("").sort
|
29
|
+
end
|
28
30
|
end
|
29
31
|
|
30
32
|
class Riot::Context
|
31
|
-
|
33
|
+
def char_split(str)
|
34
|
+
str.force_encoding("iso-8859-1").split("").sort
|
35
|
+
end
|
32
36
|
end
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.9.0.pre
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Nathan Esquenazi
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-09-03 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: activesupport
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ! '>='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: riot
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rr
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rake
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ! '>='
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ! '>='
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: tilt
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ! '>='
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,6 @@ dependencies:
|
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - ! '>='
|
92
81
|
- !ruby/object:Gem::Version
|
@@ -94,7 +83,6 @@ dependencies:
|
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: oj
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
87
|
- - ! '>='
|
100
88
|
- !ruby/object:Gem::Version
|
@@ -102,7 +90,6 @@ dependencies:
|
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
94
|
- - ! '>='
|
108
95
|
- !ruby/object:Gem::Version
|
@@ -110,7 +97,6 @@ dependencies:
|
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: msgpack
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
101
|
- - ~>
|
116
102
|
- !ruby/object:Gem::Version
|
@@ -118,7 +104,6 @@ dependencies:
|
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
108
|
- - ~>
|
124
109
|
- !ruby/object:Gem::Version
|
@@ -126,7 +111,6 @@ dependencies:
|
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: bson
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
115
|
- - ~>
|
132
116
|
- !ruby/object:Gem::Version
|
@@ -134,7 +118,6 @@ dependencies:
|
|
134
118
|
type: :development
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
122
|
- - ~>
|
140
123
|
- !ruby/object:Gem::Version
|
@@ -142,7 +125,6 @@ dependencies:
|
|
142
125
|
- !ruby/object:Gem::Dependency
|
143
126
|
name: plist
|
144
127
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
128
|
requirements:
|
147
129
|
- - ! '>='
|
148
130
|
- !ruby/object:Gem::Version
|
@@ -150,7 +132,6 @@ dependencies:
|
|
150
132
|
type: :development
|
151
133
|
prerelease: false
|
152
134
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
135
|
requirements:
|
155
136
|
- - ! '>='
|
156
137
|
- !ruby/object:Gem::Version
|
@@ -367,6 +348,58 @@ files:
|
|
367
348
|
- fixtures/rails3_2/vendor/assets/javascripts/.gitkeep
|
368
349
|
- fixtures/rails3_2/vendor/assets/stylesheets/.gitkeep
|
369
350
|
- fixtures/rails3_2/vendor/plugins/.gitkeep
|
351
|
+
- fixtures/rails4/.gitignore
|
352
|
+
- fixtures/rails4/Gemfile
|
353
|
+
- fixtures/rails4/README.rdoc
|
354
|
+
- fixtures/rails4/Rakefile
|
355
|
+
- fixtures/rails4/app/assets/javascripts/application.js
|
356
|
+
- fixtures/rails4/app/assets/stylesheets/application.css
|
357
|
+
- fixtures/rails4/app/controllers/application_controller.rb
|
358
|
+
- fixtures/rails4/app/controllers/concerns/.keep
|
359
|
+
- fixtures/rails4/app/controllers/posts_controller.rb
|
360
|
+
- fixtures/rails4/app/controllers/users_controller.rb
|
361
|
+
- fixtures/rails4/app/helpers/application_helper.rb
|
362
|
+
- fixtures/rails4/app/mailers/.keep
|
363
|
+
- fixtures/rails4/bin/bundle
|
364
|
+
- fixtures/rails4/bin/rails
|
365
|
+
- fixtures/rails4/bin/rake
|
366
|
+
- fixtures/rails4/config.ru
|
367
|
+
- fixtures/rails4/config/application.rb
|
368
|
+
- fixtures/rails4/config/boot.rb
|
369
|
+
- fixtures/rails4/config/database.yml
|
370
|
+
- fixtures/rails4/config/environment.rb
|
371
|
+
- fixtures/rails4/config/environments/development.rb
|
372
|
+
- fixtures/rails4/config/environments/production.rb
|
373
|
+
- fixtures/rails4/config/environments/test.rb
|
374
|
+
- fixtures/rails4/config/initializers/backtrace_silencers.rb
|
375
|
+
- fixtures/rails4/config/initializers/filter_parameter_logging.rb
|
376
|
+
- fixtures/rails4/config/initializers/inflections.rb
|
377
|
+
- fixtures/rails4/config/initializers/mime_types.rb
|
378
|
+
- fixtures/rails4/config/initializers/secret_token.rb
|
379
|
+
- fixtures/rails4/config/initializers/session_store.rb
|
380
|
+
- fixtures/rails4/config/initializers/wrap_parameters.rb
|
381
|
+
- fixtures/rails4/config/locales/en.yml
|
382
|
+
- fixtures/rails4/config/routes.rb
|
383
|
+
- fixtures/rails4/db/seeds.rb
|
384
|
+
- fixtures/rails4/lib/assets/.keep
|
385
|
+
- fixtures/rails4/lib/tasks/.keep
|
386
|
+
- fixtures/rails4/log/.keep
|
387
|
+
- fixtures/rails4/public/404.html
|
388
|
+
- fixtures/rails4/public/422.html
|
389
|
+
- fixtures/rails4/public/500.html
|
390
|
+
- fixtures/rails4/public/favicon.ico
|
391
|
+
- fixtures/rails4/public/robots.txt
|
392
|
+
- fixtures/rails4/test/controllers/.keep
|
393
|
+
- fixtures/rails4/test/fixtures/.keep
|
394
|
+
- fixtures/rails4/test/functional/posts_controller_test.rb
|
395
|
+
- fixtures/rails4/test/functional/users_controller_test.rb
|
396
|
+
- fixtures/rails4/test/helpers/.keep
|
397
|
+
- fixtures/rails4/test/integration/.keep
|
398
|
+
- fixtures/rails4/test/mailers/.keep
|
399
|
+
- fixtures/rails4/test/models/.keep
|
400
|
+
- fixtures/rails4/test/test_helper.rb
|
401
|
+
- fixtures/rails4/vendor/assets/javascripts/.keep
|
402
|
+
- fixtures/rails4/vendor/assets/stylesheets/.keep
|
370
403
|
- fixtures/sinatra_test/Gemfile
|
371
404
|
- fixtures/sinatra_test/Rakefile
|
372
405
|
- fixtures/sinatra_test/app.rb
|
@@ -378,12 +411,14 @@ files:
|
|
378
411
|
- lib/rabl/builder.rb
|
379
412
|
- lib/rabl/cache_engine.rb
|
380
413
|
- lib/rabl/configuration.rb
|
414
|
+
- lib/rabl/digestor.rb
|
381
415
|
- lib/rabl/engine.rb
|
382
416
|
- lib/rabl/helpers.rb
|
383
417
|
- lib/rabl/partials.rb
|
384
418
|
- lib/rabl/railtie.rb
|
385
419
|
- lib/rabl/renderer.rb
|
386
420
|
- lib/rabl/template.rb
|
421
|
+
- lib/rabl/tracker.rb
|
387
422
|
- lib/rabl/version.rb
|
388
423
|
- rabl.gemspec
|
389
424
|
- test.watchr
|
@@ -395,6 +430,8 @@ files:
|
|
395
430
|
- test/integration/posts_controller_test.rb
|
396
431
|
- test/integration/rails3_2/posts_controller_test.rb
|
397
432
|
- test/integration/rails3_2/users_controller_test.rb
|
433
|
+
- test/integration/rails4/posts_controller_test.rb
|
434
|
+
- test/integration/rails4/users_controller_test.rb
|
398
435
|
- test/integration/test_init.rb
|
399
436
|
- test/integration/users_controller_test.rb
|
400
437
|
- test/models/ormless.rb
|
@@ -409,33 +446,26 @@ files:
|
|
409
446
|
- test/xml_test.rb
|
410
447
|
homepage: https://github.com/nesquena/rabl
|
411
448
|
licenses: []
|
449
|
+
metadata: {}
|
412
450
|
post_install_message:
|
413
451
|
rdoc_options: []
|
414
452
|
require_paths:
|
415
453
|
- lib
|
416
454
|
required_ruby_version: !ruby/object:Gem::Requirement
|
417
|
-
none: false
|
418
455
|
requirements:
|
419
456
|
- - ! '>='
|
420
457
|
- !ruby/object:Gem::Version
|
421
458
|
version: '0'
|
422
|
-
segments:
|
423
|
-
- 0
|
424
|
-
hash: 3931971749616157374
|
425
459
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
426
|
-
none: false
|
427
460
|
requirements:
|
428
|
-
- - ! '
|
461
|
+
- - ! '>'
|
429
462
|
- !ruby/object:Gem::Version
|
430
|
-
version:
|
431
|
-
segments:
|
432
|
-
- 0
|
433
|
-
hash: 3931971749616157374
|
463
|
+
version: 1.3.1
|
434
464
|
requirements: []
|
435
465
|
rubyforge_project: rabl
|
436
|
-
rubygems_version:
|
466
|
+
rubygems_version: 2.0.7
|
437
467
|
signing_key:
|
438
|
-
specification_version:
|
468
|
+
specification_version: 4
|
439
469
|
summary: General ruby templating with json, bson, xml and msgpack support
|
440
470
|
test_files:
|
441
471
|
- test/bson_engine_test.rb
|
@@ -446,6 +476,8 @@ test_files:
|
|
446
476
|
- test/integration/posts_controller_test.rb
|
447
477
|
- test/integration/rails3_2/posts_controller_test.rb
|
448
478
|
- test/integration/rails3_2/users_controller_test.rb
|
479
|
+
- test/integration/rails4/posts_controller_test.rb
|
480
|
+
- test/integration/rails4/users_controller_test.rb
|
449
481
|
- test/integration/test_init.rb
|
450
482
|
- test/integration/users_controller_test.rb
|
451
483
|
- test/models/ormless.rb
|