middleware_autocomplete 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83b22cefcf7c585981197dd1fb72555e155f6476
4
- data.tar.gz: 4078dd93c6872ee571d2a1438d5e6030d2c230b9
3
+ metadata.gz: 46292853444a9cce5aaa263ecff353c2c5ecd696
4
+ data.tar.gz: eadd20d77d072ea44b3d687a856da39f84c7ce70
5
5
  SHA512:
6
- metadata.gz: ce20706fbe73f88a928e062ec33ab36c04787e3788f394899ac8ce10f9749cfa24a1ac135f4b4745bdfde4e0654231a61354a7f5fb5783386acb79e85f42160d
7
- data.tar.gz: 0dd638df1356dfbafcf5ddccd39da9de96e314fd944e8b298dba4c8564a2574b70053af18e0945d72eb9457fe80a2f0b528fed8fbb5124e49b586611a68e9ccc
6
+ metadata.gz: 35cbcd283e43f462b985f92e73ad7f3cddcab19cceceacbfee4f6ddfa28b03262b382006727c5c951592e78e20a706008181930ae2af49c25bcf30f01d89e53f
7
+ data.tar.gz: 419c20af7308a5ec30ca9b772468629fd54dba44dcb2057a20db6445b465880f139c81b6d178592978e874a13fb7c02ec63cb664a864d28e91ce8c081b67c10b
@@ -19,7 +19,7 @@ module MiddlewareAutocomplete
19
19
 
20
20
  # Full path to the Autocomplete class
21
21
  def route
22
- [namespace, path].join('/')
22
+ [namespace, path].reject(&:blank?).join('/').prepend('/')
23
23
  end
24
24
 
25
25
  # Path without namespace
@@ -33,7 +33,7 @@ module MiddlewareAutocomplete
33
33
  end
34
34
 
35
35
  def namespace
36
- @namespace || MiddlewareAutocomplete.namespace
36
+ (@namespace || MiddlewareAutocomplete.namespace).sub(/\A\//, '')
37
37
  end
38
38
 
39
39
  def use_with_connection
@@ -60,11 +60,11 @@ module MiddlewareAutocomplete
60
60
  private
61
61
 
62
62
  def default_route_name
63
- "autocomplete_#{default_path}"
63
+ [namespace, default_path].reject(&:blank?).join('_').tr('/', '_')
64
64
  end
65
65
 
66
66
  def default_path
67
- name.demodulize.sub(/Autocomplete\Z/, '').underscore
67
+ name.sub(/Autocomplete\Z/, '').underscore
68
68
  end
69
69
 
70
70
  def with_connection
@@ -1,3 +1,3 @@
1
1
  module MiddlewareAutocomplete
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -7,7 +7,7 @@ module MiddlewareAutocomplete
7
7
 
8
8
  # Path namespace for autocompletes
9
9
  mattr_accessor :namespace
10
- @@namespace = '/autocomplete'
10
+ @@namespace = 'autocomplete'
11
11
 
12
12
  # Default content_type
13
13
  mattr_accessor :content_type
Binary file
@@ -1,10 +0,0 @@
1
-  (127.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
2
-  (0.1ms) select sqlite_version(*)
3
-  (59.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
- Migrating to CreatePosts (20140414220337)
6
-  (0.1ms) begin transaction
7
-  (0.6ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "created_at" datetime, "updated_at" datetime)
8
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140414220337"]]
9
-  (70.7ms) commit transaction
10
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
@@ -1,475 +1,40 @@
1
1
   (0.1ms) begin transaction
2
2
  --------------------------------------
3
3
  MiddlewareAutocompleteTest: test_truth
4
- --------------------------------------
5
-  (0.1ms) rollback transaction
6
-  (0.1ms) begin transaction
7
- ---------------------------------------------------------
8
- NavigationTest: test_returns_json_from_autocomplete_route
9
- ---------------------------------------------------------
10
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:16:32 +0300
11
-  (0.1ms) rollback transaction
12
-  (0.1ms) begin transaction
13
- ---------------------------------------------
14
- MiddlewareAutocompleteTest: test_loads_routes
15
- ---------------------------------------------
16
-  (0.0ms) rollback transaction
17
-  (0.0ms) begin transaction
18
- --------------------------------------
19
- MiddlewareAutocompleteTest: test_truth
20
4
  --------------------------------------
21
5
   (0.0ms) rollback transaction
22
6
   (0.1ms) begin transaction
23
- ---------------------------------------------------------
24
- NavigationTest: test_returns_json_from_autocomplete_route
25
- ---------------------------------------------------------
26
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:17:42 +0300
27
-  (0.1ms) rollback transaction
28
-  (0.0ms) begin transaction
29
- ---------------------------------------------
30
- MiddlewareAutocompleteTest: test_loads_routes
31
- ---------------------------------------------
32
-  (0.0ms) rollback transaction
33
-  (0.0ms) begin transaction
34
7
  --------------------------------------
35
8
  MiddlewareAutocompleteTest: test_truth
36
9
  --------------------------------------
37
10
   (0.0ms) rollback transaction
38
11
   (0.1ms) begin transaction
39
- ---------------------------------------------------------
40
- NavigationTest: test_returns_json_from_autocomplete_route
41
- ---------------------------------------------------------
42
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:18:22 +0300
43
-  (0.2ms) rollback transaction
44
-  (0.1ms) begin transaction
45
- ---------------------------------------------
46
- MiddlewareAutocompleteTest: test_loads_routes
47
- ---------------------------------------------
48
-  (0.1ms) rollback transaction
49
-  (0.1ms) begin transaction
50
12
  --------------------------------------
51
13
  MiddlewareAutocompleteTest: test_truth
52
14
  --------------------------------------
53
-  (0.1ms) rollback transaction
54
-  (0.1ms) begin transaction
55
- ---------------------------------------------------------
56
- NavigationTest: test_returns_json_from_autocomplete_route
57
- ---------------------------------------------------------
58
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:21:44 +0300
59
-  (0.1ms) rollback transaction
60
-  (0.1ms) begin transaction
61
- ---------------------------------------------
62
- MiddlewareAutocompleteTest: test_loads_routes
63
- ---------------------------------------------
64
-  (0.1ms) rollback transaction
65
-  (0.1ms) begin transaction
66
- --------------------------------------
67
- MiddlewareAutocompleteTest: test_truth
68
- --------------------------------------
69
-  (0.1ms) rollback transaction
70
-  (0.1ms) begin transaction
71
- ---------------------------------------------------------
72
- NavigationTest: test_returns_json_from_autocomplete_route
73
- ---------------------------------------------------------
74
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:26:35 +0300
75
15
   (0.0ms) rollback transaction
76
16
   (0.1ms) begin transaction
77
- ---------------------------------------------
78
- MiddlewareAutocompleteTest: test_loads_routes
79
- ---------------------------------------------
80
-  (0.0ms) rollback transaction
81
-  (0.0ms) begin transaction
82
17
  --------------------------------------
83
18
  MiddlewareAutocompleteTest: test_truth
84
19
  --------------------------------------
85
20
   (0.0ms) rollback transaction
86
21
   (0.1ms) begin transaction
87
- ---------------------------------------------------------
88
- NavigationTest: test_returns_json_from_autocomplete_route
89
- ---------------------------------------------------------
90
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:26:38 +0300
91
-  (0.1ms) rollback transaction
92
-  (0.1ms) begin transaction
93
- ---------------------------------------------
94
- MiddlewareAutocompleteTest: test_loads_routes
95
- ---------------------------------------------
96
-  (0.1ms) rollback transaction
97
-  (0.0ms) begin transaction
98
- --------------------------------------
99
- MiddlewareAutocompleteTest: test_truth
100
- --------------------------------------
101
22
   (0.0ms) rollback transaction
102
-  (0.1ms) begin transaction
103
- ---------------------------------------------------------
104
- NavigationTest: test_returns_json_from_autocomplete_route
105
- ---------------------------------------------------------
106
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:27:23 +0300
107
-  (0.1ms) rollback transaction
108
-  (0.1ms) begin transaction
109
- ---------------------------------------------
110
- MiddlewareAutocompleteTest: test_loads_routes
111
- ---------------------------------------------
112
-  (0.1ms) rollback transaction
113
-  (0.1ms) begin transaction
114
- --------------------------------------
115
- MiddlewareAutocompleteTest: test_truth
116
- --------------------------------------
117
-  (0.1ms) rollback transaction
118
-  (0.1ms) begin transaction
119
- ---------------------------------------------------------
120
- NavigationTest: test_returns_json_from_autocomplete_route
121
- ---------------------------------------------------------
122
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:29:38 +0300
123
-  (0.1ms) rollback transaction
124
23
   (0.0ms) begin transaction
125
- ---------------------------------------------
126
- MiddlewareAutocompleteTest: test_loads_routes
127
- ---------------------------------------------
128
24
   (0.0ms) rollback transaction
129
-  (0.0ms) begin transaction
130
- --------------------------------------
131
- MiddlewareAutocompleteTest: test_truth
132
- --------------------------------------
133
-  (0.0ms) rollback transaction
134
-  (0.1ms) begin transaction
135
-  (0.0ms) rollback transaction
136
-  (0.0ms) begin transaction
137
-  (0.0ms) rollback transaction
138
-  (0.1ms) begin transaction
139
-  (0.0ms) rollback transaction
140
-  (0.1ms) begin transaction
141
-  (0.0ms) rollback transaction
142
-  (0.1ms) begin transaction
143
-  (0.0ms) rollback transaction
144
-  (0.1ms) begin transaction
145
-  (0.0ms) rollback transaction
146
-  (0.1ms) begin transaction
147
-  (0.0ms) rollback transaction
148
-  (0.0ms) begin transaction
149
-  (0.1ms) rollback transaction
150
25
   (0.1ms) begin transaction
151
- ---------------------------------------------------------
152
- NavigationTest: test_returns_json_from_autocomplete_route
153
- ---------------------------------------------------------
154
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:35:51 +0300
155
-  (0.0ms) rollback transaction
156
-  (0.0ms) begin transaction
157
- ---------------------------------------------
158
- MiddlewareAutocompleteTest: test_loads_routes
159
- ---------------------------------------------
160
-  (0.0ms) rollback transaction
161
-  (0.0ms) begin transaction
162
- --------------------------------------
163
- MiddlewareAutocompleteTest: test_truth
164
- --------------------------------------
165
26
   (0.0ms) rollback transaction
166
27
   (0.1ms) begin transaction
167
28
   (0.0ms) rollback transaction
168
-  (0.0ms) begin transaction
29
+  (0.3ms) begin transaction
169
30
   (0.0ms) rollback transaction
170
-  (122.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
31
+  (130.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
171
32
   (0.1ms) select sqlite_version(*)
172
-  (59.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
33
+  (133.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
173
34
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
174
35
  Migrating to CreatePosts (20140414220337)
175
36
   (0.1ms) begin transaction
176
-  (0.5ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "created_at" datetime, "updated_at" datetime)
37
+  (0.3ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "created_at" datetime, "updated_at" datetime)
177
38
  SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140414220337"]]
178
-  (73.5ms) commit transaction
179
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
180
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
181
-  (0.1ms) begin transaction
182
- Fixture Delete (0.1ms) DELETE FROM "posts"
183
- Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-14 22:38:03', '2014-04-14 22:38:03', 980190962)
184
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-14 22:38:03', '2014-04-14 22:38:03', 298486374)
185
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-14 22:38:03', '2014-04-14 22:38:03', 113629430)
186
-  (97.5ms) commit transaction
187
-  (0.1ms) begin transaction
188
- ---------------------------------------------
189
- MiddlewareAutocompleteTest: test_loads_routes
190
- ---------------------------------------------
191
-  (0.1ms) rollback transaction
192
-  (0.1ms) begin transaction
193
- --------------------------------------
194
- MiddlewareAutocompleteTest: test_truth
195
- --------------------------------------
196
-  (0.1ms) rollback transaction
39
+  (159.9ms) commit transaction
197
40
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
198
-  (0.1ms) begin transaction
199
- Fixture Delete (0.2ms) DELETE FROM "posts"
200
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-14 22:40:17', '2014-04-14 22:40:17', 980190962)
201
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-14 22:40:17', '2014-04-14 22:40:17', 298486374)
202
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-14 22:40:17', '2014-04-14 22:40:17', 113629430)
203
-  (91.4ms) commit transaction
204
-  (0.1ms) begin transaction
205
- ---------------------------------------------
206
- MiddlewareAutocompleteTest: test_loads_routes
207
- ---------------------------------------------
208
-  (0.1ms) rollback transaction
209
-  (0.1ms) begin transaction
210
- --------------------------------------
211
- MiddlewareAutocompleteTest: test_truth
212
- --------------------------------------
213
-  (0.1ms) rollback transaction
214
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
215
-  (0.1ms) begin transaction
216
- Fixture Delete (0.2ms) DELETE FROM "posts"
217
- Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-14 22:40:37', '2014-04-14 22:40:37', 980190962)
218
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-14 22:40:37', '2014-04-14 22:40:37', 298486374)
219
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-14 22:40:37', '2014-04-14 22:40:37', 113629430)
220
-  (126.1ms) commit transaction
221
-  (0.1ms) begin transaction
222
- --------------------------------------
223
- MiddlewareAutocompleteTest: test_truth
224
- --------------------------------------
225
-  (0.1ms) rollback transaction
226
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
227
-  (0.1ms) begin transaction
228
- Fixture Delete (0.1ms) DELETE FROM "posts"
229
- Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-14 22:43:58', '2014-04-14 22:43:58', 980190962)
230
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-14 22:43:58', '2014-04-14 22:43:58', 298486374)
231
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-14 22:43:58', '2014-04-14 22:43:58', 113629430)
232
-  (132.1ms) commit transaction
233
-  (0.1ms) begin transaction
234
- --------------------------------------
235
- MiddlewareAutocompleteTest: test_truth
236
- --------------------------------------
237
-  (0.1ms) rollback transaction
238
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
239
-  (0.1ms) begin transaction
240
- Fixture Delete (0.1ms) DELETE FROM "posts"
241
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-14 22:44:35', '2014-04-14 22:44:35', 980190962)
242
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-14 22:44:35', '2014-04-14 22:44:35', 298486374)
243
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-14 22:44:35', '2014-04-14 22:44:35', 113629430)
244
-  (131.8ms) commit transaction
245
-  (0.2ms) begin transaction
246
- --------------------------------------
247
- MiddlewareAutocompleteTest: test_truth
248
- --------------------------------------
249
-  (0.1ms) rollback transaction
250
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
251
-  (0.1ms) begin transaction
252
- Fixture Delete (0.1ms) DELETE FROM "posts"
253
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:17:23', '2014-04-15 06:17:23', 980190962)
254
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:17:23', '2014-04-15 06:17:23', 298486374)
255
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:17:23', '2014-04-15 06:17:23', 113629430)
256
-  (78.8ms) commit transaction
257
-  (0.1ms) begin transaction
258
- --------------------------------------
259
- MiddlewareAutocompleteTest: test_truth
260
- --------------------------------------
261
-  (0.0ms) rollback transaction
262
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
263
-  (0.1ms) begin transaction
264
- Fixture Delete (0.1ms) DELETE FROM "posts"
265
- Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:17:34', '2014-04-15 06:17:34', 980190962)
266
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:17:34', '2014-04-15 06:17:34', 298486374)
267
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:17:34', '2014-04-15 06:17:34', 113629430)
268
-  (114.0ms) commit transaction
269
-  (0.1ms) begin transaction
270
- ---------------------------------------------------------
271
- NavigationTest: test_returns_json_from_autocomplete_route
272
- ---------------------------------------------------------
273
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:17:34 +0300
274
-  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') LIMIT 10
275
-  (0.1ms) rollback transaction
276
-  (0.1ms) begin transaction
277
- --------------------------------------
278
- MiddlewareAutocompleteTest: test_truth
279
- --------------------------------------
280
-  (0.0ms) rollback transaction
281
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
282
-  (0.1ms) begin transaction
283
- Fixture Delete (0.1ms) DELETE FROM "posts"
284
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:19:18', '2014-04-15 06:19:18', 980190962)
285
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:19:18', '2014-04-15 06:19:18', 298486374)
286
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:19:18', '2014-04-15 06:19:18', 113629430)
287
-  (114.3ms) commit transaction
288
-  (0.1ms) begin transaction
289
- ---------------------------------------------------------
290
- NavigationTest: test_returns_json_from_autocomplete_route
291
- ---------------------------------------------------------
292
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:19:18 +0300
293
-  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') LIMIT 10
294
-  (0.1ms) rollback transaction
295
-  (0.0ms) begin transaction
296
- --------------------------------------
297
- MiddlewareAutocompleteTest: test_truth
298
- --------------------------------------
299
-  (0.0ms) rollback transaction
300
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
301
-  (0.1ms) begin transaction
302
- Fixture Delete (0.1ms) DELETE FROM "posts"
303
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:20:12', '2014-04-15 06:20:12', 980190962)
304
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:20:12', '2014-04-15 06:20:12', 298486374)
305
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:20:12', '2014-04-15 06:20:12', 113629430)
306
-  (109.4ms) commit transaction
307
-  (0.1ms) begin transaction
308
- ---------------------------------------------------------
309
- NavigationTest: test_returns_json_from_autocomplete_route
310
- ---------------------------------------------------------
311
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:20:12 +0300
312
-  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') LIMIT 10
313
-  (0.2ms) rollback transaction
314
-  (0.1ms) begin transaction
315
- --------------------------------------
316
- MiddlewareAutocompleteTest: test_truth
317
- --------------------------------------
318
-  (0.1ms) rollback transaction
319
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
320
-  (0.1ms) begin transaction
321
- Fixture Delete (0.2ms) DELETE FROM "posts"
322
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:21:26', '2014-04-15 06:21:26', 980190962)
323
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:21:26', '2014-04-15 06:21:26', 298486374)
324
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:21:26', '2014-04-15 06:21:26', 113629430)
325
-  (76.3ms) commit transaction
326
-  (0.1ms) begin transaction
327
- ---------------------------------------------------------
328
- NavigationTest: test_returns_json_from_autocomplete_route
329
- ---------------------------------------------------------
330
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:21:26 +0300
331
-  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') ORDER BY "posts"."title" ASC LIMIT 10
332
-  (0.2ms) rollback transaction
333
-  (0.1ms) begin transaction
334
- --------------------------------------
335
- MiddlewareAutocompleteTest: test_truth
336
- --------------------------------------
337
-  (0.1ms) rollback transaction
338
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
339
-  (0.1ms) begin transaction
340
- Fixture Delete (0.1ms) DELETE FROM "posts"
341
- Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:21:55', '2014-04-15 06:21:55', 980190962)
342
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:21:55', '2014-04-15 06:21:55', 298486374)
343
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:21:55', '2014-04-15 06:21:55', 113629430)
344
-  (81.3ms) commit transaction
345
-  (0.1ms) begin transaction
346
- ---------------------------------------------------------
347
- NavigationTest: test_returns_json_from_autocomplete_route
348
- ---------------------------------------------------------
349
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:21:55 +0300
350
-  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') ORDER BY "posts"."title" ASC LIMIT 10
351
-  (0.1ms) rollback transaction
352
-  (0.1ms) begin transaction
353
- --------------------------------------
354
- MiddlewareAutocompleteTest: test_truth
355
- --------------------------------------
356
-  (0.0ms) rollback transaction
357
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
358
-  (0.1ms) begin transaction
359
- Fixture Delete (0.1ms) DELETE FROM "posts"
360
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:22:45', '2014-04-15 06:22:45', 980190962)
361
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:22:45', '2014-04-15 06:22:45', 298486374)
362
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:22:45', '2014-04-15 06:22:45', 113629430)
363
-  (110.5ms) commit transaction
364
-  (0.1ms) begin transaction
365
- ------------------------------------------
366
- NavigationTest: test_passes_request_params
367
- ------------------------------------------
368
- Started GET "/autocomplete/posts?q=Another" for 127.0.0.1 at 2014-04-15 09:22:45 +0300
369
-  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE 'Another_%') ORDER BY "posts"."title" ASC LIMIT 10
370
-  (0.1ms) rollback transaction
371
-  (0.0ms) begin transaction
372
- ---------------------------------------------------------
373
- NavigationTest: test_returns_json_from_autocomplete_route
374
- ---------------------------------------------------------
375
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:22:45 +0300
376
-  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') ORDER BY "posts"."title" ASC LIMIT 10
377
-  (0.1ms) rollback transaction
378
-  (0.1ms) begin transaction
379
- --------------------------------------
380
- MiddlewareAutocompleteTest: test_truth
381
- --------------------------------------
382
-  (0.0ms) rollback transaction
383
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
384
-  (0.1ms) begin transaction
385
- Fixture Delete (0.2ms) DELETE FROM "posts"
386
- Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:24:24', '2014-04-15 06:24:24', 980190962)
387
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:24:24', '2014-04-15 06:24:24', 298486374)
388
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:24:24', '2014-04-15 06:24:24', 113629430)
389
-  (115.5ms) commit transaction
390
-  (0.1ms) begin transaction
391
- ------------------------------------------
392
- NavigationTest: test_passes_request_params
393
- ------------------------------------------
394
- Started GET "/autocomplete/posts?q=Another" for 127.0.0.1 at 2014-04-15 09:24:24 +0300
395
-  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE 'Another_%') ORDER BY "posts"."title" ASC LIMIT 10
396
-  (0.1ms) rollback transaction
397
-  (0.0ms) begin transaction
398
- ---------------------------------------------------------
399
- NavigationTest: test_returns_json_from_autocomplete_route
400
- ---------------------------------------------------------
401
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:24:24 +0300
402
-  (0.1ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') ORDER BY "posts"."title" ASC LIMIT 10
403
-  (0.1ms) rollback transaction
404
-  (0.0ms) begin transaction
405
- ---------------------------------------------
406
- MiddlewareAutocompleteTest: test_loads_routes
407
- ---------------------------------------------
408
-  (0.0ms) rollback transaction
409
-  (0.1ms) begin transaction
410
- --------------------------------------
411
- MiddlewareAutocompleteTest: test_truth
412
- --------------------------------------
413
-  (0.0ms) rollback transaction
414
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
415
-  (0.1ms) begin transaction
416
- Fixture Delete (0.2ms) DELETE FROM "posts"
417
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:24:36', '2014-04-15 06:24:36', 980190962)
418
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:24:36', '2014-04-15 06:24:36', 298486374)
419
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:24:36', '2014-04-15 06:24:36', 113629430)
420
-  (75.1ms) commit transaction
421
-  (0.1ms) begin transaction
422
- ------------------------------------------
423
- NavigationTest: test_passes_request_params
424
- ------------------------------------------
425
- Started GET "/autocomplete/posts?q=Another" for 127.0.0.1 at 2014-04-15 09:24:36 +0300
426
-  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE 'Another_%') ORDER BY "posts"."title" ASC LIMIT 10
427
-  (0.1ms) rollback transaction
428
-  (0.1ms) begin transaction
429
- ---------------------------------------------------------
430
- NavigationTest: test_returns_json_from_autocomplete_route
431
- ---------------------------------------------------------
432
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:24:36 +0300
433
-  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') ORDER BY "posts"."title" ASC LIMIT 10
434
-  (0.1ms) rollback transaction
435
-  (0.1ms) begin transaction
436
- ---------------------------------------------
437
- MiddlewareAutocompleteTest: test_loads_routes
438
- ---------------------------------------------
439
-  (0.0ms) rollback transaction
440
-  (0.0ms) begin transaction
441
- --------------------------------------
442
- MiddlewareAutocompleteTest: test_truth
443
- --------------------------------------
444
-  (0.0ms) rollback transaction
445
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
446
-  (0.1ms) begin transaction
447
- Fixture Delete (0.1ms) DELETE FROM "posts"
448
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:44:46', '2014-04-15 06:44:46', 980190962)
449
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:44:46', '2014-04-15 06:44:46', 298486374)
450
- Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:44:46', '2014-04-15 06:44:46', 113629430)
451
-  (77.2ms) commit transaction
452
-  (0.1ms) begin transaction
453
- ------------------------------------------
454
- NavigationTest: test_passes_request_params
455
- ------------------------------------------
456
- Started GET "/autocomplete/posts?q=Another" for 127.0.0.1 at 2014-04-15 09:44:47 +0300
457
-  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE 'Another_%') ORDER BY "posts"."title" ASC LIMIT 10
458
-  (0.1ms) rollback transaction
459
-  (0.0ms) begin transaction
460
- ---------------------------------------------------------
461
- NavigationTest: test_returns_json_from_autocomplete_route
462
- ---------------------------------------------------------
463
- Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:44:47 +0300
464
-  (0.1ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') ORDER BY "posts"."title" ASC LIMIT 10
465
-  (0.1ms) rollback transaction
466
-  (0.0ms) begin transaction
467
- ---------------------------------------------
468
- MiddlewareAutocompleteTest: test_loads_routes
469
- ---------------------------------------------
470
-  (0.0ms) rollback transaction
471
-  (0.0ms) begin transaction
472
- --------------------------------------
473
- MiddlewareAutocompleteTest: test_truth
474
- --------------------------------------
475
-  (0.0ms) rollback transaction
data/test/test_helper.rb CHANGED
@@ -1,8 +1,13 @@
1
1
  # Configure Rails Environment
2
2
  ENV["RAILS_ENV"] = "test"
3
3
 
4
+ require 'simplecov'
4
5
  require 'coveralls'
5
- Coveralls.wear!
6
+
7
+ SimpleCov.formatter = Coveralls::SimpleCov::Formatter
8
+ SimpleCov.start do
9
+ add_filter 'test'
10
+ end
6
11
 
7
12
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
8
13
  require "rails/test_help"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleware_autocomplete
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Ilchenko
@@ -80,7 +80,8 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description: Generates autocomplete response straight from your middleware for Rails
83
+ description: Rails middleware that generates responses for your requests without hitting
84
+ your ApplicationController
84
85
  email:
85
86
  - konstantin@ilchenko.by
86
87
  executables: []
@@ -124,7 +125,6 @@ files:
124
125
  - test/dummy/config/locales/en.yml
125
126
  - test/dummy/config/routes.rb
126
127
  - test/dummy/config/secrets.yml
127
- - test/dummy/db/development.sqlite3
128
128
  - test/dummy/db/migrate/20140414220337_create_posts.rb
129
129
  - test/dummy/db/schema.rb
130
130
  - test/dummy/db/test.sqlite3
@@ -161,49 +161,48 @@ rubyforge_project:
161
161
  rubygems_version: 2.2.2
162
162
  signing_key:
163
163
  specification_version: 4
164
- summary: Fast autocomplete for Rails.
164
+ summary: Fast autocomplete for Rails
165
165
  test_files:
166
166
  - test/middleware_autocomplete_test.rb
167
- - test/test_helper.rb
168
- - test/dummy/db/development.sqlite3
169
- - test/dummy/db/test.sqlite3
170
- - test/dummy/db/migrate/20140414220337_create_posts.rb
171
- - test/dummy/db/schema.rb
172
- - test/dummy/README.rdoc
167
+ - test/dummy/Rakefile
173
168
  - test/dummy/config.ru
169
+ - test/dummy/log/development.log
170
+ - test/dummy/log/test.log
171
+ - test/dummy/bin/bundle
172
+ - test/dummy/bin/rails
173
+ - test/dummy/bin/rake
174
+ - test/dummy/app/models/post.rb
175
+ - test/dummy/app/autocompletes/posts_autocomplete.rb
176
+ - test/dummy/app/controllers/application_controller.rb
177
+ - test/dummy/app/views/layouts/application.html.erb
178
+ - test/dummy/app/helpers/application_helper.rb
179
+ - test/dummy/app/assets/stylesheets/application.css
180
+ - test/dummy/app/assets/javascripts/application.js
181
+ - test/dummy/test/fixtures/posts.yml
174
182
  - test/dummy/public/favicon.ico
183
+ - test/dummy/public/500.html
175
184
  - test/dummy/public/422.html
176
185
  - test/dummy/public/404.html
177
- - test/dummy/public/500.html
178
- - test/dummy/bin/rails
179
- - test/dummy/bin/bundle
180
- - test/dummy/bin/rake
181
- - test/dummy/config/boot.rb
182
- - test/dummy/config/environment.rb
183
- - test/dummy/config/secrets.yml
184
- - test/dummy/config/application.rb
186
+ - test/dummy/README.rdoc
187
+ - test/dummy/config/environments/development.rb
185
188
  - test/dummy/config/environments/test.rb
186
189
  - test/dummy/config/environments/production.rb
187
- - test/dummy/config/environments/development.rb
190
+ - test/dummy/config/environment.rb
188
191
  - test/dummy/config/routes.rb
189
- - test/dummy/config/initializers/wrap_parameters.rb
190
- - test/dummy/config/initializers/session_store.rb
192
+ - test/dummy/config/secrets.yml
193
+ - test/dummy/config/application.rb
194
+ - test/dummy/config/locales/en.yml
195
+ - test/dummy/config/initializers/filter_parameter_logging.rb
191
196
  - test/dummy/config/initializers/backtrace_silencers.rb
192
- - test/dummy/config/initializers/mime_types.rb
193
197
  - test/dummy/config/initializers/cookies_serializer.rb
194
- - test/dummy/config/initializers/filter_parameter_logging.rb
198
+ - test/dummy/config/initializers/mime_types.rb
199
+ - test/dummy/config/initializers/wrap_parameters.rb
195
200
  - test/dummy/config/initializers/inflections.rb
201
+ - test/dummy/config/initializers/session_store.rb
202
+ - test/dummy/config/boot.rb
196
203
  - test/dummy/config/database.yml
197
- - test/dummy/config/locales/en.yml
198
- - test/dummy/Rakefile
199
- - test/dummy/app/helpers/application_helper.rb
200
- - test/dummy/app/views/layouts/application.html.erb
201
- - test/dummy/app/models/post.rb
202
- - test/dummy/app/controllers/application_controller.rb
203
- - test/dummy/app/autocompletes/posts_autocomplete.rb
204
- - test/dummy/app/assets/javascripts/application.js
205
- - test/dummy/app/assets/stylesheets/application.css
206
- - test/dummy/test/fixtures/posts.yml
207
- - test/dummy/log/development.log
208
- - test/dummy/log/test.log
204
+ - test/dummy/db/test.sqlite3
205
+ - test/dummy/db/schema.rb
206
+ - test/dummy/db/migrate/20140414220337_create_posts.rb
207
+ - test/test_helper.rb
209
208
  - test/integration/navigation_test.rb
Binary file