pilha 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/lib/pilha.rb +7 -10
  2. data/lib/pilha/stack_overflow/answer.rb +7 -8
  3. data/lib/pilha/stack_overflow/badge.rb +8 -6
  4. data/lib/pilha/stack_overflow/base.rb +27 -0
  5. data/lib/pilha/stack_overflow/comment.rb +21 -9
  6. data/lib/pilha/stack_overflow/question.rb +41 -0
  7. data/lib/pilha/stack_overflow/statistics.rb +7 -6
  8. data/lib/pilha/stack_overflow/user.rb +5 -8
  9. data/pilha.gemspec +8 -21
  10. data/spec/fixtures/answer_comments.json +37 -0
  11. data/spec/fixtures/answers_by_question_id.json +430 -0
  12. data/spec/fixtures/answers_by_question_id.json.gz +0 -0
  13. data/spec/fixtures/badges_name.json +400 -0
  14. data/spec/fixtures/badges_name.json.gz +0 -0
  15. data/spec/fixtures/comments_by_mentioned_user_id.json +117 -0
  16. data/spec/fixtures/comments_by_mentioned_user_id.json.gz +0 -0
  17. data/spec/fixtures/comments_by_question_id.json +22 -0
  18. data/spec/fixtures/comments_by_question_id.json.gz +0 -0
  19. data/spec/fixtures/comments_by_user_id.json +464 -0
  20. data/spec/fixtures/comments_by_user_id.json.gz +0 -0
  21. data/spec/fixtures/comments_by_user_id_to_mentioned_user_id.json.gz +0 -0
  22. data/spec/fixtures/comments_by_user_to_mentioned_user.json +29 -0
  23. data/spec/fixtures/comments_by_user_to_mentioned_user.json.gz +0 -0
  24. data/spec/fixtures/comments_by_user_to_mentioned_user_id.json.gz +0 -0
  25. data/spec/fixtures/question_by_id.json +162 -0
  26. data/spec/fixtures/question_by_id.json.gz +0 -0
  27. data/spec/fixtures/question_by_id_with_body.json +169 -0
  28. data/spec/fixtures/question_by_id_with_body.json.gz +0 -0
  29. data/spec/fixtures/question_by_user_id.json.gz +0 -0
  30. data/spec/fixtures/questions.json +1773 -0
  31. data/spec/fixtures/questions.json.gz +0 -0
  32. data/spec/fixtures/questions.part +859 -0
  33. data/spec/fixtures/questions_by_user_id.json +35 -0
  34. data/spec/fixtures/questions_by_user_id.json.gz +0 -0
  35. data/spec/fixtures/users.json +983 -0
  36. data/spec/fixtures/users_by_id.json +40 -0
  37. data/spec/fixtures/users_by_id.json.gz +0 -0
  38. data/spec/pilha/stack_overflow/badge_spec.rb +3 -3
  39. data/spec/pilha/stack_overflow/comment_spec.rb +52 -1
  40. data/spec/pilha/stack_overflow/question_spec.rb +63 -0
  41. data/spec/pilha/stack_overflow/stack_overflow_spec.rb +2 -4
  42. data/spec/spec_helper.rb +7 -1
  43. metadata +53 -22
@@ -0,0 +1,22 @@
1
+ {
2
+ "total": 1,
3
+ "page": 1,
4
+ "pagesize": 30,
5
+ "comments": [
6
+ {
7
+ "comment_id": 858028,
8
+ "creation_date": 1245970256,
9
+ "owner": {
10
+ "user_id": 52963,
11
+ "user_type": "registered",
12
+ "display_name": "system PAUSE",
13
+ "reputation": 2143,
14
+ "email_hash": "4e47334ae70850cd210b952cdb0cb9be"
15
+ },
16
+ "post_id": 549,
17
+ "post_type": "question",
18
+ "score": 0,
19
+ "body": "Why exclude HTTP Basic Authentication? It can work in HTML Forms via Ajax: <a href=\"http://www.peej.co.uk/articles/http-auth-with-html-forms.html\" rel=\"nofollow\">peej.co.uk/articles/&hellip;</a>"
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,464 @@
1
+ {
2
+ "total": 117,
3
+ "page": 1,
4
+ "pagesize": 30,
5
+ "comments": [
6
+ {
7
+ "comment_id": 2739275,
8
+ "creation_date": 1272292520,
9
+ "owner": {
10
+ "user_id": 549,
11
+ "user_type": "registered",
12
+ "display_name": "Josh Kodroff",
13
+ "reputation": 1542,
14
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
15
+ },
16
+ "post_id": 2580831,
17
+ "post_type": "answer",
18
+ "score": 0,
19
+ "body": "Thanks so much for this. I had a devilish time finding this in JetBrains' documentation."
20
+ },
21
+ {
22
+ "comment_id": 2288595,
23
+ "creation_date": 1266945979,
24
+ "owner": {
25
+ "user_id": 549,
26
+ "user_type": "registered",
27
+ "display_name": "Josh Kodroff",
28
+ "reputation": 1542,
29
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
30
+ },
31
+ "post_id": 2320184,
32
+ "post_type": "answer",
33
+ "score": 0,
34
+ "body": "Yeah, the point is that I do not want a big old list of 200 countries sent across the wire on every postback since it's really not necessary. We're currently using EnableViewState=&quot;true&quot; and doing things in OnLoad."
35
+ },
36
+ {
37
+ "comment_id": 2288414,
38
+ "creation_date": 1266944454,
39
+ "owner": {
40
+ "user_id": 549,
41
+ "user_type": "registered",
42
+ "display_name": "Josh Kodroff",
43
+ "reputation": 1542,
44
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
45
+ },
46
+ "post_id": 2174334,
47
+ "post_type": "question",
48
+ "score": 1,
49
+ "body": "Duplicate of this: <a href=\"http://stackoverflow.com/questions/1976981/asp-net-mvc-filtering-results-in-a-list-grid/1977055#1977055\" rel=\"nofollow\" title=\"asp net mvc filtering results in a list grid\">stackoverflow.com/questions/1976981/&hellip;</a>"
50
+ },
51
+ {
52
+ "comment_id": 2205389,
53
+ "creation_date": 1265920319,
54
+ "owner": {
55
+ "user_id": 549,
56
+ "user_type": "registered",
57
+ "display_name": "Josh Kodroff",
58
+ "reputation": 1542,
59
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
60
+ },
61
+ "post_id": 2246567,
62
+ "post_type": "answer",
63
+ "score": 0,
64
+ "body": "I missed your last comment while I was posting the last one. I'll do some more homework and checkout that other question."
65
+ },
66
+ {
67
+ "comment_id": 2205380,
68
+ "creation_date": 1265920240,
69
+ "owner": {
70
+ "user_id": 549,
71
+ "user_type": "registered",
72
+ "display_name": "Josh Kodroff",
73
+ "reputation": 1542,
74
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
75
+ },
76
+ "post_id": 2246567,
77
+ "post_type": "answer",
78
+ "score": 0,
79
+ "body": "Here's the thing I'm not getting: The FooManager class is going to get a heterogeneous list of a FooDomain descendents: SuperFooDomain1, SuperFooDomain2, etc. Can you elaborate on how I get from type discriminator to an instance of the appropriate FooDomain descendent? Is there going to be a big switch statement somewhere?"
80
+ },
81
+ {
82
+ "comment_id": 2204836,
83
+ "creation_date": 1265915830,
84
+ "owner": {
85
+ "user_id": 549,
86
+ "user_type": "registered",
87
+ "display_name": "Josh Kodroff",
88
+ "reputation": 1542,
89
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
90
+ },
91
+ "post_id": 2246567,
92
+ "post_type": "answer",
93
+ "score": 0,
94
+ "body": "And I might add the ToC for the book you're working on has got me quite interested. It looks like a great way to present the topic."
95
+ },
96
+ {
97
+ "comment_id": 2204799,
98
+ "creation_date": 1265915532,
99
+ "owner": {
100
+ "user_id": 549,
101
+ "user_type": "registered",
102
+ "display_name": "Josh Kodroff",
103
+ "reputation": 1542,
104
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
105
+ },
106
+ "post_id": 2246567,
107
+ "post_type": "answer",
108
+ "score": 0,
109
+ "body": "I read your blog post on the Service Locator earlier today and thought it was fantastically written. Sorry for the page of code - couldn't figure out a way to express the object hierarchy any more succintly."
110
+ },
111
+ {
112
+ "comment_id": 2185363,
113
+ "creation_date": 1265730589,
114
+ "owner": {
115
+ "user_id": 549,
116
+ "user_type": "registered",
117
+ "display_name": "Josh Kodroff",
118
+ "reputation": 1542,
119
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
120
+ },
121
+ "post_id": 2230286,
122
+ "post_type": "question",
123
+ "score": 0,
124
+ "body": "Does functional testing == integration testing?"
125
+ },
126
+ {
127
+ "comment_id": 2098123,
128
+ "creation_date": 1264688534,
129
+ "owner": {
130
+ "user_id": 549,
131
+ "user_type": "registered",
132
+ "display_name": "Josh Kodroff",
133
+ "reputation": 1542,
134
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
135
+ },
136
+ "reply_to_user": {
137
+ "user_id": 5274,
138
+ "user_type": "registered",
139
+ "display_name": "Jonathan Allen",
140
+ "reputation": 6409,
141
+ "email_hash": "205db6eb5e26b56ab69cd4bffbbc9b3d"
142
+ },
143
+ "post_id": 2150581,
144
+ "post_type": "question",
145
+ "score": 0,
146
+ "body": "@Jonathan Allen - Can you point me to an article that explains more about how the memory leak could occur? I'd really like to learn more. Most of my experience with event handlers has been in Windows Forms and I nearly always create forms within a using block so I figured I didn't have to worry about leaks."
147
+ },
148
+ {
149
+ "comment_id": 2093277,
150
+ "creation_date": 1264630327,
151
+ "owner": {
152
+ "user_id": 549,
153
+ "user_type": "registered",
154
+ "display_name": "Josh Kodroff",
155
+ "reputation": 1542,
156
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
157
+ },
158
+ "post_id": 2150538,
159
+ "post_type": "question",
160
+ "score": 0,
161
+ "body": "Is the exception occurring in the rendering of the view or in the controller action?"
162
+ },
163
+ {
164
+ "comment_id": 2093245,
165
+ "creation_date": 1264630121,
166
+ "owner": {
167
+ "user_id": 549,
168
+ "user_type": "registered",
169
+ "display_name": "Josh Kodroff",
170
+ "reputation": 1542,
171
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
172
+ },
173
+ "post_id": 2150581,
174
+ "post_type": "question",
175
+ "score": 0,
176
+ "body": "Should have added above: The idea of the lambda expression removing itself as the event handler seems very spaghetti-ish."
177
+ },
178
+ {
179
+ "comment_id": 2093234,
180
+ "creation_date": 1264630057,
181
+ "owner": {
182
+ "user_id": 549,
183
+ "user_type": "registered",
184
+ "display_name": "Josh Kodroff",
185
+ "reputation": 1542,
186
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
187
+ },
188
+ "post_id": 2150581,
189
+ "post_type": "question",
190
+ "score": 0,
191
+ "body": "Out of curiosity, why not just use a member variable boolean flag that gets set once the event fires, then do &quot;if (flag) return;&quot;?"
192
+ },
193
+ {
194
+ "comment_id": 2089394,
195
+ "creation_date": 1264602365,
196
+ "owner": {
197
+ "user_id": 549,
198
+ "user_type": "registered",
199
+ "display_name": "Josh Kodroff",
200
+ "reputation": 1542,
201
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
202
+ },
203
+ "post_id": 2142355,
204
+ "post_type": "answer",
205
+ "score": 0,
206
+ "body": "Can you add the exception you get to your post?"
207
+ },
208
+ {
209
+ "comment_id": 2083746,
210
+ "creation_date": 1264539452,
211
+ "owner": {
212
+ "user_id": 549,
213
+ "user_type": "registered",
214
+ "display_name": "Josh Kodroff",
215
+ "reputation": 1542,
216
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
217
+ },
218
+ "post_id": 2142505,
219
+ "post_type": "answer",
220
+ "score": 0,
221
+ "body": "Or ClassType if it's a lookup."
222
+ },
223
+ {
224
+ "comment_id": 2083702,
225
+ "creation_date": 1264539105,
226
+ "owner": {
227
+ "user_id": 549,
228
+ "user_type": "registered",
229
+ "display_name": "Josh Kodroff",
230
+ "reputation": 1542,
231
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
232
+ },
233
+ "post_id": 2075288,
234
+ "post_type": "question",
235
+ "score": 0,
236
+ "body": "Why do you need a DTO at all? Why not just bind to your entity class?"
237
+ },
238
+ {
239
+ "comment_id": 2083654,
240
+ "creation_date": 1264538682,
241
+ "owner": {
242
+ "user_id": 549,
243
+ "user_type": "registered",
244
+ "display_name": "Josh Kodroff",
245
+ "reputation": 1542,
246
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
247
+ },
248
+ "post_id": 2141410,
249
+ "post_type": "question",
250
+ "score": 0,
251
+ "body": "I'd be very, very careful to make sure using externals would save you as much time as you think. I've heard nothing but problems when externals are involved."
252
+ },
253
+ {
254
+ "comment_id": 2083590,
255
+ "creation_date": 1264538243,
256
+ "owner": {
257
+ "user_id": 549,
258
+ "user_type": "registered",
259
+ "display_name": "Josh Kodroff",
260
+ "reputation": 1542,
261
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
262
+ },
263
+ "post_id": 2141946,
264
+ "post_type": "question",
265
+ "score": 0,
266
+ "body": "What language are you writing in? There are definitely charting and graphing apps for .NET if you can call .NET libraries from whatever you're developing in."
267
+ },
268
+ {
269
+ "comment_id": 2083568,
270
+ "creation_date": 1264538125,
271
+ "owner": {
272
+ "user_id": 549,
273
+ "user_type": "registered",
274
+ "display_name": "Josh Kodroff",
275
+ "reputation": 1542,
276
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
277
+ },
278
+ "post_id": 2142044,
279
+ "post_type": "question",
280
+ "score": 0,
281
+ "body": "If my answer is completely off the mark and you have to use Oracle 10 Client, could you post the specific error message you're getting?"
282
+ },
283
+ {
284
+ "comment_id": 2081029,
285
+ "creation_date": 1264519692,
286
+ "owner": {
287
+ "user_id": 549,
288
+ "user_type": "registered",
289
+ "display_name": "Josh Kodroff",
290
+ "reputation": 1542,
291
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
292
+ },
293
+ "post_id": 2135325,
294
+ "post_type": "answer",
295
+ "score": 0,
296
+ "body": "Normally you wouldn't have a SqlCommand parameter in the BLL, but you should be able to do it through the DAL. You would then expose a wrapper method in the BLL that calls the DAL method. Is it possible for you to add such a wrapper in the BLL?"
297
+ },
298
+ {
299
+ "comment_id": 2072458,
300
+ "creation_date": 1264432361,
301
+ "owner": {
302
+ "user_id": 549,
303
+ "user_type": "registered",
304
+ "display_name": "Josh Kodroff",
305
+ "reputation": 1542,
306
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
307
+ },
308
+ "post_id": 2118911,
309
+ "post_type": "answer",
310
+ "score": 0,
311
+ "body": "I was surprised that there weren't oodles of examples out there when I was searching for stuff. Added link to answer."
312
+ },
313
+ {
314
+ "comment_id": 2057202,
315
+ "creation_date": 1264190962,
316
+ "owner": {
317
+ "user_id": 549,
318
+ "user_type": "registered",
319
+ "display_name": "Josh Kodroff",
320
+ "reputation": 1542,
321
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
322
+ },
323
+ "post_id": 2118837,
324
+ "post_type": "question",
325
+ "score": 0,
326
+ "body": "Glad my answer worked for you. Go team!"
327
+ },
328
+ {
329
+ "comment_id": 2057024,
330
+ "creation_date": 1264189738,
331
+ "owner": {
332
+ "user_id": 549,
333
+ "user_type": "registered",
334
+ "display_name": "Josh Kodroff",
335
+ "reputation": 1542,
336
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
337
+ },
338
+ "post_id": 2119134,
339
+ "post_type": "answer",
340
+ "score": 0,
341
+ "body": "Unfortunately, the space thing is not going to work. The text in question is a user's username (which can be an email address) so I need to render it literally."
342
+ },
343
+ {
344
+ "comment_id": 2045868,
345
+ "creation_date": 1264089446,
346
+ "owner": {
347
+ "user_id": 549,
348
+ "user_type": "registered",
349
+ "display_name": "Josh Kodroff",
350
+ "reputation": 1542,
351
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
352
+ },
353
+ "post_id": 2088916,
354
+ "post_type": "question",
355
+ "score": 0,
356
+ "body": "Is there perhaps a way to disable the triggers within the scope of the transaction you want to execute?"
357
+ },
358
+ {
359
+ "comment_id": 2022177,
360
+ "creation_date": 1263853615,
361
+ "owner": {
362
+ "user_id": 549,
363
+ "user_type": "registered",
364
+ "display_name": "Josh Kodroff",
365
+ "reputation": 1542,
366
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
367
+ },
368
+ "post_id": 2088916,
369
+ "post_type": "question",
370
+ "score": 0,
371
+ "body": "Are you transferring data between two databases permanently or are they two production systems you have to keep in sync in more or less real time? Can this job be done nightly?"
372
+ },
373
+ {
374
+ "comment_id": 1951910,
375
+ "creation_date": 1262965251,
376
+ "owner": {
377
+ "user_id": 549,
378
+ "user_type": "registered",
379
+ "display_name": "Josh Kodroff",
380
+ "reputation": 1542,
381
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
382
+ },
383
+ "post_id": 2016293,
384
+ "post_type": "answer",
385
+ "score": 0,
386
+ "body": "Ok, then what you'll need to do is cut out the entire build script and add it back piece-by-piece until you find the section that's causing the problem. &quot;My build script times out&quot; isn't something someone can help you fix - you'll need to do some more digging until you get to a more specific issue."
387
+ },
388
+ {
389
+ "comment_id": 1945104,
390
+ "creation_date": 1262890223,
391
+ "owner": {
392
+ "user_id": 549,
393
+ "user_type": "registered",
394
+ "display_name": "Josh Kodroff",
395
+ "reputation": 1542,
396
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
397
+ },
398
+ "post_id": 2022416,
399
+ "post_type": "answer",
400
+ "score": 0,
401
+ "body": "I never experienced an exception being thrown with EnableVisualStyles, but don't take that as an authoritative answer as I was working on an internal app so the machines were all on the same version of XP. That said, if it works on SP2 and SP3, you're probably safe."
402
+ },
403
+ {
404
+ "comment_id": 1944742,
405
+ "creation_date": 1262887657,
406
+ "owner": {
407
+ "user_id": 549,
408
+ "user_type": "registered",
409
+ "display_name": "Josh Kodroff",
410
+ "reputation": 1542,
411
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
412
+ },
413
+ "post_id": 2016293,
414
+ "post_type": "answer",
415
+ "score": 0,
416
+ "body": "You'll need to isolate and post the section of the build script that's timing out in order for us to answer your question."
417
+ },
418
+ {
419
+ "comment_id": 1944532,
420
+ "creation_date": 1262886350,
421
+ "owner": {
422
+ "user_id": 549,
423
+ "user_type": "registered",
424
+ "display_name": "Josh Kodroff",
425
+ "reputation": 1542,
426
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
427
+ },
428
+ "post_id": 2017413,
429
+ "post_type": "answer",
430
+ "score": 0,
431
+ "body": "Sayed, do you have a source for this? Could you post a link?"
432
+ },
433
+ {
434
+ "comment_id": 1937759,
435
+ "creation_date": 1262812822,
436
+ "owner": {
437
+ "user_id": 549,
438
+ "user_type": "registered",
439
+ "display_name": "Josh Kodroff",
440
+ "reputation": 1542,
441
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
442
+ },
443
+ "post_id": 2016258,
444
+ "post_type": "question",
445
+ "score": 0,
446
+ "body": "Could you re-title the question? You'll probably get more answers if you have a more meaningful title."
447
+ },
448
+ {
449
+ "comment_id": 1927065,
450
+ "creation_date": 1262706369,
451
+ "owner": {
452
+ "user_id": 549,
453
+ "user_type": "registered",
454
+ "display_name": "Josh Kodroff",
455
+ "reputation": 1542,
456
+ "email_hash": "9e7ef08258f04dab37b43842d261aea8"
457
+ },
458
+ "post_id": 1172729,
459
+ "post_type": "answer",
460
+ "score": 2,
461
+ "body": "I had the same issue several times and in my experience it's been the Recycle Bin that's been the culprit."
462
+ }
463
+ ]
464
+ }