transient_objects 0.0.1.alpha → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2013 YOURNAME
1
+ Copyright 2013 Gregory Silcox
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Transient Objects [![Build Status](https://travis-ci.org/GregSilcox/transient_objects.png?branch=master)](https://travis-ci.org/GregSilcox/transient_objects)
2
+
3
+ Transient objects is a set of non-persitent objects that support persistent object, i.e. those with database tables. It also supports controllers, views, printing, emailing, etc. Because there are no persistent objects, there is no need to migrate a database, making testing very fast.
data/Rakefile CHANGED
@@ -27,6 +27,12 @@ load 'rails/tasks/engine.rake'
27
27
 
28
28
  Bundler::GemHelper.install_tasks
29
29
 
30
+ # rspec
31
+ require 'rspec/core/rake_task'
32
+
33
+ RSpec::Core::RakeTask.new(:spec)
34
+
35
+ #test::unit
30
36
  require 'rake/testtask'
31
37
 
32
38
  Rake::TestTask.new(:test) do |t|
@@ -37,4 +43,5 @@ Rake::TestTask.new(:test) do |t|
37
43
  end
38
44
 
39
45
 
40
- task :default => :test
46
+ # task default: :spec
47
+ task default: :test
@@ -0,0 +1,33 @@
1
+ module TransientObjects
2
+ class FamilyMemberMerger # < ActiveRecord::Base
3
+ # attr_accessible :title, :body
4
+ def initialize families
5
+ @families = families
6
+ end
7
+
8
+ def families_with_duplicate_members
9
+ families = Array.new
10
+ @families.each do |family|
11
+ duplicate_members = find_duplicate_members family
12
+ families.push( [family, duplicate_members] ) unless
13
+ duplicate_members.empty?
14
+ end
15
+ families
16
+ end
17
+
18
+ def find_duplicate_members family
19
+ duplicate_members = Array.new
20
+ family.members.each do |member|
21
+ family.members.each do |other|
22
+ if member.name == other.name && member != other
23
+ duplicate_members.push [member, other]
24
+ end
25
+ end
26
+ end
27
+ duplicate_members
28
+ end
29
+
30
+ end
31
+ end
32
+
33
+
@@ -0,0 +1,28 @@
1
+ module TransientObjects
2
+ class UserMerger # < ActiveRecord::Base
3
+ # attr_accessible :title, :body
4
+ def initialize users
5
+ @users = users
6
+ end
7
+
8
+ def users_with_multiple_families
9
+ users_multi = Array.new
10
+ @users.each do |user|
11
+ users_multi.push( user ) if user.families.uniq.count > 1
12
+ end
13
+ users_multi
14
+ end
15
+
16
+ def families
17
+ families = Array.new
18
+ @users.each do |user|
19
+ fmm = FamilyMemberMerger.new user.families
20
+ dups = fmm.families_with_duplicate_members
21
+ families.push( [ user, dups ] ) unless
22
+ dups.empty?
23
+ end
24
+ families
25
+ end
26
+
27
+ end
28
+ end
@@ -1,5 +1,7 @@
1
+ require 'transient_objects/version'
2
+
1
3
  module TransientObjects
2
- class Engine < ::Rails::Engine
4
+ class Engine < Rails::Engine
3
5
  isolate_namespace TransientObjects
4
6
  end
5
7
  end
@@ -1,3 +1,3 @@
1
1
  module TransientObjects
2
- VERSION = "0.0.1.alpha"
2
+ VERSION = "0.1.0"
3
3
  end
Binary file
@@ -0,0 +1,16 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 0) do
15
+
16
+ end
File without changes
@@ -0,0 +1,6 @@
1
+ Connecting to database specified by database.yml
2
+  (0.1ms) select sqlite_version(*)
3
+  (167.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
4
+  (145.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
6
+ Connecting to database specified by database.yml
@@ -0,0 +1,631 @@
1
+ Connecting to database specified by database.yml
2
+  (0.3ms) begin transaction
3
+  (0.0ms) rollback transaction
4
+ Connecting to database specified by database.yml
5
+  (0.3ms) begin transaction
6
+  (0.0ms) rollback transaction
7
+ Connecting to database specified by database.yml
8
+  (0.3ms) begin transaction
9
+  (0.0ms) rollback transaction
10
+ Connecting to database specified by database.yml
11
+  (0.3ms) begin transaction
12
+  (0.0ms) rollback transaction
13
+ Connecting to database specified by database.yml
14
+  (0.3ms) begin transaction
15
+  (0.1ms) rollback transaction
16
+ Connecting to database specified by database.yml
17
+  (0.3ms) begin transaction
18
+  (0.0ms) rollback transaction
19
+ Connecting to database specified by database.yml
20
+  (0.3ms) begin transaction
21
+  (0.0ms) rollback transaction
22
+ Connecting to database specified by database.yml
23
+  (0.4ms) begin transaction
24
+  (0.0ms) rollback transaction
25
+  (0.0ms) begin transaction
26
+  (0.0ms) rollback transaction
27
+ Connecting to database specified by database.yml
28
+  (0.3ms) begin transaction
29
+  (0.0ms) rollback transaction
30
+  (0.0ms) begin transaction
31
+  (0.0ms) rollback transaction
32
+ Connecting to database specified by database.yml
33
+  (0.3ms) begin transaction
34
+  (0.0ms) rollback transaction
35
+  (0.1ms) begin transaction
36
+  (0.0ms) rollback transaction
37
+  (0.0ms) begin transaction
38
+  (0.0ms) rollback transaction
39
+ Connecting to database specified by database.yml
40
+  (0.3ms) begin transaction
41
+  (0.0ms) rollback transaction
42
+  (0.1ms) begin transaction
43
+  (0.0ms) rollback transaction
44
+  (0.0ms) begin transaction
45
+  (0.0ms) rollback transaction
46
+ Connecting to database specified by database.yml
47
+  (0.3ms) begin transaction
48
+  (0.0ms) rollback transaction
49
+  (0.2ms) begin transaction
50
+  (0.0ms) rollback transaction
51
+  (0.0ms) begin transaction
52
+  (0.0ms) rollback transaction
53
+ Connecting to database specified by database.yml
54
+  (0.4ms) begin transaction
55
+  (0.0ms) rollback transaction
56
+  (0.1ms) begin transaction
57
+  (0.0ms) rollback transaction
58
+  (0.0ms) begin transaction
59
+  (0.0ms) rollback transaction
60
+ Connecting to database specified by database.yml
61
+  (0.3ms) begin transaction
62
+  (0.1ms) rollback transaction
63
+  (0.1ms) begin transaction
64
+  (0.0ms) rollback transaction
65
+  (0.0ms) begin transaction
66
+  (0.0ms) rollback transaction
67
+ Connecting to database specified by database.yml
68
+  (0.5ms) begin transaction
69
+  (0.1ms) rollback transaction
70
+  (0.1ms) begin transaction
71
+  (0.0ms) rollback transaction
72
+  (0.0ms) begin transaction
73
+  (0.1ms) rollback transaction
74
+ Connecting to database specified by database.yml
75
+  (0.3ms) begin transaction
76
+  (0.1ms) rollback transaction
77
+  (0.1ms) begin transaction
78
+  (0.0ms) rollback transaction
79
+  (0.0ms) begin transaction
80
+  (0.0ms) rollback transaction
81
+ Connecting to database specified by database.yml
82
+  (0.4ms) begin transaction
83
+  (0.0ms) rollback transaction
84
+  (0.1ms) begin transaction
85
+  (0.0ms) rollback transaction
86
+  (0.0ms) begin transaction
87
+  (0.0ms) rollback transaction
88
+ Connecting to database specified by database.yml
89
+  (0.3ms) begin transaction
90
+  (0.1ms) rollback transaction
91
+  (0.0ms) begin transaction
92
+  (0.0ms) rollback transaction
93
+  (0.0ms) begin transaction
94
+  (0.0ms) rollback transaction
95
+ Connecting to database specified by database.yml
96
+  (0.3ms) begin transaction
97
+  (0.1ms) rollback transaction
98
+  (0.1ms) begin transaction
99
+  (0.0ms) rollback transaction
100
+  (0.0ms) begin transaction
101
+  (0.0ms) rollback transaction
102
+ Connecting to database specified by database.yml
103
+  (0.3ms) begin transaction
104
+  (0.1ms) rollback transaction
105
+  (0.1ms) begin transaction
106
+  (0.0ms) rollback transaction
107
+  (0.0ms) begin transaction
108
+  (0.0ms) rollback transaction
109
+ Connecting to database specified by database.yml
110
+  (16.3ms) begin transaction
111
+  (0.1ms) rollback transaction
112
+  (0.0ms) begin transaction
113
+  (0.0ms) rollback transaction
114
+  (0.0ms) begin transaction
115
+  (0.0ms) rollback transaction
116
+  (0.1ms) begin transaction
117
+  (0.0ms) rollback transaction
118
+  (0.0ms) begin transaction
119
+  (0.0ms) rollback transaction
120
+  (0.0ms) begin transaction
121
+  (0.0ms) rollback transaction
122
+  (0.1ms) begin transaction
123
+  (0.1ms) rollback transaction
124
+ Connecting to database specified by database.yml
125
+  (0.4ms) begin transaction
126
+  (0.1ms) rollback transaction
127
+  (0.0ms) begin transaction
128
+  (0.0ms) rollback transaction
129
+  (0.0ms) begin transaction
130
+  (0.0ms) rollback transaction
131
+  (0.1ms) begin transaction
132
+  (0.0ms) rollback transaction
133
+  (0.0ms) begin transaction
134
+  (0.0ms) rollback transaction
135
+  (0.0ms) begin transaction
136
+  (0.0ms) rollback transaction
137
+  (0.1ms) begin transaction
138
+  (0.0ms) rollback transaction
139
+ Connecting to database specified by database.yml
140
+  (0.3ms) begin transaction
141
+  (0.1ms) rollback transaction
142
+  (0.0ms) begin transaction
143
+  (0.0ms) rollback transaction
144
+  (0.0ms) begin transaction
145
+  (0.0ms) rollback transaction
146
+ Connecting to database specified by database.yml
147
+  (0.3ms) begin transaction
148
+  (0.1ms) rollback transaction
149
+  (0.0ms) begin transaction
150
+  (0.0ms) rollback transaction
151
+  (0.0ms) begin transaction
152
+  (0.0ms) rollback transaction
153
+ Connecting to database specified by database.yml
154
+  (0.4ms) begin transaction
155
+  (0.1ms) rollback transaction
156
+  (0.0ms) begin transaction
157
+  (0.0ms) rollback transaction
158
+  (0.0ms) begin transaction
159
+  (0.0ms) rollback transaction
160
+  (0.1ms) begin transaction
161
+  (0.0ms) rollback transaction
162
+  (0.0ms) begin transaction
163
+  (0.0ms) rollback transaction
164
+  (0.0ms) begin transaction
165
+  (0.0ms) rollback transaction
166
+  (0.1ms) begin transaction
167
+  (0.0ms) rollback transaction
168
+ Connecting to database specified by database.yml
169
+  (0.3ms) begin transaction
170
+  (0.1ms) rollback transaction
171
+  (0.0ms) begin transaction
172
+  (0.0ms) rollback transaction
173
+  (0.0ms) begin transaction
174
+  (0.0ms) rollback transaction
175
+  (0.1ms) begin transaction
176
+  (0.0ms) rollback transaction
177
+  (0.0ms) begin transaction
178
+  (0.0ms) rollback transaction
179
+  (0.0ms) begin transaction
180
+  (0.0ms) rollback transaction
181
+  (0.1ms) begin transaction
182
+  (0.1ms) rollback transaction
183
+ Connecting to database specified by database.yml
184
+  (0.4ms) begin transaction
185
+  (0.1ms) rollback transaction
186
+  (0.0ms) begin transaction
187
+  (0.0ms) rollback transaction
188
+  (0.0ms) begin transaction
189
+  (0.0ms) rollback transaction
190
+ Connecting to database specified by database.yml
191
+  (0.4ms) begin transaction
192
+  (0.1ms) rollback transaction
193
+  (0.1ms) begin transaction
194
+  (0.0ms) rollback transaction
195
+  (0.0ms) begin transaction
196
+  (0.0ms) rollback transaction
197
+  (0.1ms) begin transaction
198
+  (0.0ms) rollback transaction
199
+  (0.1ms) begin transaction
200
+  (0.0ms) rollback transaction
201
+  (0.1ms) begin transaction
202
+  (0.0ms) rollback transaction
203
+  (0.1ms) begin transaction
204
+  (0.2ms) rollback transaction
205
+ Connecting to database specified by database.yml
206
+  (0.4ms) begin transaction
207
+  (0.1ms) rollback transaction
208
+  (0.0ms) begin transaction
209
+  (0.0ms) rollback transaction
210
+  (0.0ms) begin transaction
211
+  (0.0ms) rollback transaction
212
+  (0.1ms) begin transaction
213
+  (0.0ms) rollback transaction
214
+  (0.1ms) begin transaction
215
+  (0.0ms) rollback transaction
216
+  (0.0ms) begin transaction
217
+  (0.0ms) rollback transaction
218
+  (0.1ms) begin transaction
219
+  (0.1ms) rollback transaction
220
+ Connecting to database specified by database.yml
221
+  (0.4ms) begin transaction
222
+  (0.1ms) rollback transaction
223
+  (0.0ms) begin transaction
224
+  (0.0ms) rollback transaction
225
+  (0.0ms) begin transaction
226
+  (0.0ms) rollback transaction
227
+ Connecting to database specified by database.yml
228
+  (0.4ms) begin transaction
229
+  (0.1ms) rollback transaction
230
+  (0.0ms) begin transaction
231
+  (0.0ms) rollback transaction
232
+  (0.0ms) begin transaction
233
+  (0.0ms) rollback transaction
234
+ Connecting to database specified by database.yml
235
+  (0.4ms) begin transaction
236
+  (0.1ms) rollback transaction
237
+  (0.0ms) begin transaction
238
+  (0.0ms) rollback transaction
239
+  (0.0ms) begin transaction
240
+  (0.0ms) rollback transaction
241
+ Connecting to database specified by database.yml
242
+  (0.3ms) begin transaction
243
+  (0.1ms) rollback transaction
244
+  (0.0ms) begin transaction
245
+  (0.0ms) rollback transaction
246
+  (0.0ms) begin transaction
247
+  (0.0ms) rollback transaction
248
+  (0.1ms) begin transaction
249
+  (0.0ms) rollback transaction
250
+  (0.0ms) begin transaction
251
+  (0.0ms) rollback transaction
252
+  (0.0ms) begin transaction
253
+  (0.0ms) rollback transaction
254
+  (0.0ms) begin transaction
255
+  (0.0ms) rollback transaction
256
+ Connecting to database specified by database.yml
257
+  (0.4ms) begin transaction
258
+  (0.1ms) rollback transaction
259
+  (0.0ms) begin transaction
260
+  (0.0ms) rollback transaction
261
+  (0.0ms) begin transaction
262
+  (0.0ms) rollback transaction
263
+ Connecting to database specified by database.yml
264
+  (0.4ms) begin transaction
265
+  (0.1ms) rollback transaction
266
+  (0.0ms) begin transaction
267
+  (0.0ms) rollback transaction
268
+  (0.0ms) begin transaction
269
+  (0.0ms) rollback transaction
270
+ Connecting to database specified by database.yml
271
+  (0.4ms) begin transaction
272
+  (0.0ms) rollback transaction
273
+  (0.1ms) begin transaction
274
+  (0.0ms) rollback transaction
275
+  (0.0ms) begin transaction
276
+  (0.0ms) rollback transaction
277
+ Connecting to database specified by database.yml
278
+  (0.4ms) begin transaction
279
+  (0.0ms) rollback transaction
280
+  (0.1ms) begin transaction
281
+  (0.1ms) rollback transaction
282
+  (0.0ms) begin transaction
283
+  (0.0ms) rollback transaction
284
+ Connecting to database specified by database.yml
285
+  (0.4ms) begin transaction
286
+  (0.1ms) rollback transaction
287
+  (0.1ms) begin transaction
288
+  (0.0ms) rollback transaction
289
+  (0.0ms) begin transaction
290
+  (0.0ms) rollback transaction
291
+ Connecting to database specified by database.yml
292
+  (0.3ms) begin transaction
293
+  (0.0ms) rollback transaction
294
+  (0.1ms) begin transaction
295
+  (0.0ms) rollback transaction
296
+  (0.0ms) begin transaction
297
+  (0.0ms) rollback transaction
298
+  (0.1ms) begin transaction
299
+  (0.0ms) rollback transaction
300
+  (0.0ms) begin transaction
301
+  (0.0ms) rollback transaction
302
+  (0.0ms) begin transaction
303
+  (0.0ms) rollback transaction
304
+  (0.1ms) begin transaction
305
+  (0.0ms) rollback transaction
306
+ Connecting to database specified by database.yml
307
+  (0.4ms) begin transaction
308
+  (0.0ms) rollback transaction
309
+  (0.1ms) begin transaction
310
+  (0.0ms) rollback transaction
311
+  (0.1ms) begin transaction
312
+  (0.0ms) rollback transaction
313
+ Connecting to database specified by database.yml
314
+  (0.4ms) begin transaction
315
+  (0.0ms) rollback transaction
316
+  (0.1ms) begin transaction
317
+  (0.0ms) rollback transaction
318
+  (0.0ms) begin transaction
319
+  (0.0ms) rollback transaction
320
+ Connecting to database specified by database.yml
321
+  (0.4ms) begin transaction
322
+  (0.1ms) rollback transaction
323
+  (0.1ms) begin transaction
324
+  (0.0ms) rollback transaction
325
+  (0.1ms) begin transaction
326
+  (0.0ms) rollback transaction
327
+ Connecting to database specified by database.yml
328
+  (0.3ms) begin transaction
329
+  (0.1ms) rollback transaction
330
+  (0.1ms) begin transaction
331
+  (0.1ms) rollback transaction
332
+  (0.0ms) begin transaction
333
+  (0.0ms) rollback transaction
334
+ Connecting to database specified by database.yml
335
+  (0.4ms) begin transaction
336
+  (0.0ms) rollback transaction
337
+  (0.1ms) begin transaction
338
+  (0.1ms) rollback transaction
339
+  (0.0ms) begin transaction
340
+  (0.0ms) rollback transaction
341
+ Connecting to database specified by database.yml
342
+  (0.3ms) begin transaction
343
+  (0.0ms) rollback transaction
344
+  (0.1ms) begin transaction
345
+  (0.0ms) rollback transaction
346
+  (0.0ms) begin transaction
347
+  (0.0ms) rollback transaction
348
+ Connecting to database specified by database.yml
349
+  (0.3ms) begin transaction
350
+  (0.1ms) rollback transaction
351
+  (0.1ms) begin transaction
352
+  (0.1ms) rollback transaction
353
+  (0.0ms) begin transaction
354
+  (0.1ms) rollback transaction
355
+ Connecting to database specified by database.yml
356
+  (0.4ms) begin transaction
357
+  (0.1ms) rollback transaction
358
+  (0.1ms) begin transaction
359
+  (0.1ms) rollback transaction
360
+  (0.0ms) begin transaction
361
+  (0.0ms) rollback transaction
362
+ Connecting to database specified by database.yml
363
+  (0.4ms) begin transaction
364
+  (0.0ms) rollback transaction
365
+  (0.1ms) begin transaction
366
+  (0.1ms) rollback transaction
367
+  (0.0ms) begin transaction
368
+  (0.0ms) rollback transaction
369
+ Connecting to database specified by database.yml
370
+  (0.4ms) begin transaction
371
+  (0.0ms) rollback transaction
372
+  (0.1ms) begin transaction
373
+  (0.0ms) rollback transaction
374
+  (0.0ms) begin transaction
375
+  (0.0ms) rollback transaction
376
+ Connecting to database specified by database.yml
377
+  (0.4ms) begin transaction
378
+  (0.0ms) rollback transaction
379
+  (0.1ms) begin transaction
380
+  (0.0ms) rollback transaction
381
+  (0.0ms) begin transaction
382
+  (0.0ms) rollback transaction
383
+ Connecting to database specified by database.yml
384
+  (0.4ms) begin transaction
385
+  (0.1ms) rollback transaction
386
+  (0.1ms) begin transaction
387
+  (0.1ms) rollback transaction
388
+  (0.0ms) begin transaction
389
+  (0.0ms) rollback transaction
390
+ Connecting to database specified by database.yml
391
+  (0.3ms) begin transaction
392
+  (0.1ms) rollback transaction
393
+  (0.1ms) begin transaction
394
+  (0.1ms) rollback transaction
395
+  (0.0ms) begin transaction
396
+  (0.0ms) rollback transaction
397
+ Connecting to database specified by database.yml
398
+  (0.3ms) begin transaction
399
+  (0.0ms) rollback transaction
400
+  (0.1ms) begin transaction
401
+  (0.0ms) rollback transaction
402
+  (0.0ms) begin transaction
403
+  (0.0ms) rollback transaction
404
+ Connecting to database specified by database.yml
405
+  (0.3ms) begin transaction
406
+  (0.0ms) rollback transaction
407
+  (0.1ms) begin transaction
408
+  (0.0ms) rollback transaction
409
+  (0.0ms) begin transaction
410
+  (0.0ms) rollback transaction
411
+ Connecting to database specified by database.yml
412
+  (0.3ms) begin transaction
413
+  (0.1ms) rollback transaction
414
+  (0.1ms) begin transaction
415
+  (0.0ms) rollback transaction
416
+  (0.0ms) begin transaction
417
+  (0.0ms) rollback transaction
418
+ Connecting to database specified by database.yml
419
+  (0.4ms) begin transaction
420
+  (0.1ms) rollback transaction
421
+  (0.0ms) begin transaction
422
+  (0.1ms) rollback transaction
423
+  (0.0ms) begin transaction
424
+  (0.1ms) rollback transaction
425
+ Connecting to database specified by database.yml
426
+  (0.3ms) begin transaction
427
+  (0.1ms) rollback transaction
428
+  (0.1ms) begin transaction
429
+  (0.1ms) rollback transaction
430
+  (0.0ms) begin transaction
431
+  (0.1ms) rollback transaction
432
+ Connecting to database specified by database.yml
433
+  (0.3ms) begin transaction
434
+  (0.0ms) rollback transaction
435
+  (0.1ms) begin transaction
436
+  (0.0ms) rollback transaction
437
+  (0.0ms) begin transaction
438
+  (0.0ms) rollback transaction
439
+ Connecting to database specified by database.yml
440
+  (0.3ms) begin transaction
441
+  (0.1ms) rollback transaction
442
+  (0.0ms) begin transaction
443
+  (0.0ms) rollback transaction
444
+  (0.0ms) begin transaction
445
+  (0.0ms) rollback transaction
446
+ Connecting to database specified by database.yml
447
+  (0.3ms) begin transaction
448
+  (0.0ms) rollback transaction
449
+  (0.1ms) begin transaction
450
+  (0.0ms) rollback transaction
451
+  (0.0ms) begin transaction
452
+  (0.0ms) rollback transaction
453
+ Connecting to database specified by database.yml
454
+  (0.3ms) begin transaction
455
+  (0.1ms) rollback transaction
456
+  (0.0ms) begin transaction
457
+  (0.0ms) rollback transaction
458
+  (0.0ms) begin transaction
459
+  (0.0ms) rollback transaction
460
+ Connecting to database specified by database.yml
461
+  (0.4ms) begin transaction
462
+  (0.0ms) rollback transaction
463
+  (0.1ms) begin transaction
464
+  (0.0ms) rollback transaction
465
+  (0.0ms) begin transaction
466
+  (0.0ms) rollback transaction
467
+ Connecting to database specified by database.yml
468
+  (0.3ms) begin transaction
469
+  (0.1ms) rollback transaction
470
+  (0.1ms) begin transaction
471
+  (0.0ms) rollback transaction
472
+  (0.0ms) begin transaction
473
+  (0.0ms) rollback transaction
474
+ Connecting to database specified by database.yml
475
+  (0.4ms) begin transaction
476
+  (0.1ms) rollback transaction
477
+  (0.1ms) begin transaction
478
+  (0.0ms) rollback transaction
479
+  (0.0ms) begin transaction
480
+  (0.0ms) rollback transaction
481
+ Connecting to database specified by database.yml
482
+  (0.3ms) begin transaction
483
+  (0.0ms) rollback transaction
484
+  (0.1ms) begin transaction
485
+  (0.0ms) rollback transaction
486
+  (0.0ms) begin transaction
487
+  (0.1ms) rollback transaction
488
+ Connecting to database specified by database.yml
489
+  (0.4ms) begin transaction
490
+  (0.1ms) rollback transaction
491
+  (0.0ms) begin transaction
492
+  (0.1ms) rollback transaction
493
+  (0.0ms) begin transaction
494
+  (0.1ms) rollback transaction
495
+ Connecting to database specified by database.yml
496
+  (0.4ms) begin transaction
497
+  (0.1ms) rollback transaction
498
+  (0.1ms) begin transaction
499
+  (0.0ms) rollback transaction
500
+  (0.0ms) begin transaction
501
+  (0.1ms) rollback transaction
502
+ Connecting to database specified by database.yml
503
+  (0.3ms) begin transaction
504
+  (0.0ms) rollback transaction
505
+  (0.1ms) begin transaction
506
+  (0.0ms) rollback transaction
507
+  (0.0ms) begin transaction
508
+  (0.0ms) rollback transaction
509
+ Connecting to database specified by database.yml
510
+  (0.3ms) begin transaction
511
+  (0.1ms) rollback transaction
512
+  (0.0ms) begin transaction
513
+  (0.0ms) rollback transaction
514
+  (0.0ms) begin transaction
515
+  (0.0ms) rollback transaction
516
+ Connecting to database specified by database.yml
517
+  (0.4ms) begin transaction
518
+  (0.1ms) rollback transaction
519
+  (0.1ms) begin transaction
520
+  (0.0ms) rollback transaction
521
+  (0.0ms) begin transaction
522
+  (0.0ms) rollback transaction
523
+ Connecting to database specified by database.yml
524
+  (0.4ms) begin transaction
525
+  (0.1ms) rollback transaction
526
+  (0.0ms) begin transaction
527
+  (0.0ms) rollback transaction
528
+  (0.0ms) begin transaction
529
+  (0.0ms) rollback transaction
530
+ Connecting to database specified by database.yml
531
+  (0.4ms) begin transaction
532
+  (0.1ms) rollback transaction
533
+  (0.0ms) begin transaction
534
+  (0.0ms) rollback transaction
535
+  (0.1ms) begin transaction
536
+  (0.0ms) rollback transaction
537
+ Connecting to database specified by database.yml
538
+  (0.3ms) begin transaction
539
+  (0.2ms) rollback transaction
540
+  (0.0ms) begin transaction
541
+  (0.0ms) rollback transaction
542
+  (0.0ms) begin transaction
543
+  (0.0ms) rollback transaction
544
+ Connecting to database specified by database.yml
545
+  (0.3ms) begin transaction
546
+  (0.1ms) rollback transaction
547
+  (0.0ms) begin transaction
548
+  (0.1ms) rollback transaction
549
+  (0.0ms) begin transaction
550
+  (0.1ms) rollback transaction
551
+ Connecting to database specified by database.yml
552
+  (0.3ms) begin transaction
553
+  (0.1ms) rollback transaction
554
+  (0.0ms) begin transaction
555
+  (0.0ms) rollback transaction
556
+  (0.0ms) begin transaction
557
+  (0.0ms) rollback transaction
558
+ Connecting to database specified by database.yml
559
+  (0.4ms) begin transaction
560
+  (0.1ms) rollback transaction
561
+  (0.0ms) begin transaction
562
+  (0.0ms) rollback transaction
563
+  (0.0ms) begin transaction
564
+  (0.0ms) rollback transaction
565
+ Connecting to database specified by database.yml
566
+  (0.4ms) begin transaction
567
+  (0.1ms) rollback transaction
568
+  (0.1ms) begin transaction
569
+  (0.0ms) rollback transaction
570
+  (0.0ms) begin transaction
571
+  (0.0ms) rollback transaction
572
+ Connecting to database specified by database.yml
573
+  (0.3ms) begin transaction
574
+  (0.0ms) rollback transaction
575
+  (0.1ms) begin transaction
576
+  (0.0ms) rollback transaction
577
+  (0.0ms) begin transaction
578
+  (0.0ms) rollback transaction
579
+  (0.1ms) begin transaction
580
+  (0.0ms) rollback transaction
581
+  (0.0ms) begin transaction
582
+  (0.0ms) rollback transaction
583
+  (0.0ms) begin transaction
584
+  (0.0ms) rollback transaction
585
+  (0.1ms) begin transaction
586
+  (0.0ms) rollback transaction
587
+ Connecting to database specified by database.yml
588
+  (0.3ms) begin transaction
589
+  (0.1ms) rollback transaction
590
+  (0.1ms) begin transaction
591
+  (0.0ms) rollback transaction
592
+  (0.1ms) begin transaction
593
+  (0.0ms) rollback transaction
594
+  (0.1ms) begin transaction
595
+  (0.1ms) rollback transaction
596
+  (0.0ms) begin transaction
597
+  (0.0ms) rollback transaction
598
+  (0.0ms) begin transaction
599
+  (0.0ms) rollback transaction
600
+  (0.0ms) begin transaction
601
+  (0.0ms) rollback transaction
602
+ Connecting to database specified by database.yml
603
+  (0.3ms) begin transaction
604
+  (0.0ms) rollback transaction
605
+  (0.1ms) begin transaction
606
+  (0.0ms) rollback transaction
607
+  (0.0ms) begin transaction
608
+  (0.0ms) rollback transaction
609
+  (0.0ms) begin transaction
610
+  (0.0ms) rollback transaction
611
+  (0.0ms) begin transaction
612
+  (0.0ms) rollback transaction
613
+  (0.0ms) begin transaction
614
+  (0.0ms) rollback transaction
615
+  (0.1ms) begin transaction
616
+  (0.0ms) rollback transaction
617
+ Connecting to database specified by database.yml
618
+  (0.4ms) begin transaction
619
+  (0.0ms) rollback transaction
620
+  (0.0ms) begin transaction
621
+  (0.0ms) rollback transaction
622
+  (0.0ms) begin transaction
623
+  (0.0ms) rollback transaction
624
+  (0.0ms) begin transaction
625
+  (0.0ms) rollback transaction
626
+  (0.0ms) begin transaction
627
+  (0.0ms) rollback transaction
628
+  (0.0ms) begin transaction
629
+  (0.0ms) rollback transaction
630
+  (0.0ms) begin transaction
631
+  (0.0ms) rollback transaction
data/test/test_helper.rb CHANGED
@@ -1,15 +1,14 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
1
+ require 'rubygems'
2
+ require 'spork'
3
+ # require 'spork/ext/ruby-debug'
3
4
 
4
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
- require "rails/test_help"
5
+ Spork.prefork do
6
+ ENV["RAILS_ENV"] = "test"
7
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
8
+ require "rails/test_help"
6
9
 
7
- Rails.backtrace_cleaner.remove_silencers!
8
-
9
- # Load support files
10
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
10
+ Rails.backtrace_cleaner.remove_silencers!
11
+ end
11
12
 
12
- # Load fixtures from the engine
13
- if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
- ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
13
+ Spork.each_run do
15
14
  end
@@ -0,0 +1,49 @@
1
+ require 'test_helper'
2
+
3
+ module TransientObjects
4
+ class Family
5
+ attr_accessor :name, :members
6
+
7
+ def initialize name
8
+ @name = name
9
+ @members = Array.new
10
+ end
11
+
12
+ end
13
+
14
+ class User
15
+ attr_accessor :name
16
+
17
+ def initialize name
18
+ @name = name
19
+ end
20
+ end
21
+
22
+ class FamilyMemberMergerTest < ActiveSupport::TestCase
23
+ def setup
24
+ @flintstones = Family.new "Flintstone, Fred & Wilma"
25
+ @flintstones.members = [ User.new( "Fred" ), User.new( "Fred" ) ]
26
+
27
+ @rubbles = Family.new "Rubble, Barney & Betty"
28
+ @rubbles.members = [ User.new( "Fred" ), User.new( "Barney" ) ]
29
+
30
+ @families = [ @flintstones, @rubbles ]
31
+ @fmm = FamilyMemberMerger.new( @families )
32
+ end
33
+
34
+ test "initialize" do
35
+ assert_equal FamilyMemberMerger, @fmm.class
36
+ end
37
+
38
+ test "families_with_duplicate_members" do
39
+ dups = @fmm.families_with_duplicate_members
40
+ assert_equal 1, dups.size
41
+ assert_equal @flintstones, dups[ 0 ][ 0 ]
42
+ end
43
+
44
+ test "find_duplicate_members" do
45
+ assert_equal 0, @fmm.find_duplicate_members( @rubbles ).size
46
+ assert_equal 2, @fmm.find_duplicate_members( @flintstones ).size
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,49 @@
1
+ require 'test_helper'
2
+
3
+ module TransientObjects
4
+ class Family
5
+ attr_accessor :name, :members
6
+
7
+ def initialize name
8
+ @name = name
9
+ @members = Array.new
10
+ end
11
+ end
12
+
13
+ class User
14
+ attr_accessor :name, :families
15
+
16
+ def initialize name
17
+ @name = name
18
+ end
19
+ end
20
+
21
+ class UserMergerTest < ActiveSupport::TestCase
22
+ def setup
23
+ @flintstones = Family.new( "Flintstone, Fred & Wilma" )
24
+ @rubbles = Family.new( "Rubble, Barney & Betty" )
25
+
26
+ @fred = User.new( "Fred" )
27
+ @fred.families = [ @flintstones, @rubbles ]
28
+
29
+ @barney = User.new( "Barney" )
30
+ @barney.families = [ @rubbles ]
31
+
32
+ @flintstones.members = [ User.new( "Fred" ), User.new( "Fred" ) ]
33
+ @um = UserMerger.new [ @fred, @barney ]
34
+ end
35
+
36
+ test "initialize" do
37
+ assert_equal UserMerger, @um.class
38
+ end
39
+
40
+ test "users with multiple families" do
41
+ assert_equal 1, @um.users_with_multiple_families.size
42
+ end
43
+
44
+ test "families" do
45
+ assert_equal 1, @um.families.size
46
+ end
47
+ end
48
+
49
+ end
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transient_objects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha
5
- prerelease: 6
4
+ version: 0.1.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Gregory Silcox
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-02 00:00:00.000000000 Z
12
+ date: 2013-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &72310340 !ruby/object:Gem::Requirement
16
+ requirement: &76405080 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.2.10
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *72310340
24
+ version_requirements: *76405080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sqlite3
27
- requirement: &72309720 !ruby/object:Gem::Requirement
27
+ requirement: &76402990 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,117 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *72309720
35
+ version_requirements: *76402990
36
+ - !ruby/object:Gem::Dependency
37
+ name: rake
38
+ requirement: &76402260 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *76402260
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec-rails
49
+ requirement: &76401870 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *76401870
58
+ - !ruby/object:Gem::Dependency
59
+ name: supermodel
60
+ requirement: &76400920 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *76400920
69
+ - !ruby/object:Gem::Dependency
70
+ name: spork
71
+ requirement: &76398680 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *76398680
80
+ - !ruby/object:Gem::Dependency
81
+ name: spork-rails
82
+ requirement: &76423880 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: *76423880
91
+ - !ruby/object:Gem::Dependency
92
+ name: spork-testunit
93
+ requirement: &76422200 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ type: :development
100
+ prerelease: false
101
+ version_requirements: *76422200
102
+ - !ruby/object:Gem::Dependency
103
+ name: guard-spork
104
+ requirement: &76420910 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: *76420910
113
+ - !ruby/object:Gem::Dependency
114
+ name: guard-test
115
+ requirement: &76418900 !ruby/object:Gem::Requirement
116
+ none: false
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ type: :development
122
+ prerelease: false
123
+ version_requirements: *76418900
124
+ - !ruby/object:Gem::Dependency
125
+ name: rb-inotify
126
+ requirement: &76417870 !ruby/object:Gem::Requirement
127
+ none: false
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: *76417870
135
+ - !ruby/object:Gem::Dependency
136
+ name: libnotify
137
+ requirement: &76441870 !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ type: :development
144
+ prerelease: false
145
+ version_requirements: *76441870
36
146
  description: These objects are non-persistent, and only support persistent objects,
37
147
  controllers or views.
38
148
  email:
@@ -45,6 +155,8 @@ files:
45
155
  - app/assets/javascripts/transient_objects/application.js
46
156
  - app/views/layouts/transient_objects/application.html.erb
47
157
  - app/controllers/transient_objects/application_controller.rb
158
+ - app/models/transient_objects/user_merger.rb
159
+ - app/models/transient_objects/family_member_merger.rb
48
160
  - app/helpers/transient_objects/application_helper.rb
49
161
  - config/routes.rb
50
162
  - lib/transient_objects.rb
@@ -53,8 +165,13 @@ files:
53
165
  - lib/tasks/transient_objects_tasks.rake
54
166
  - MIT-LICENSE
55
167
  - Rakefile
56
- - README.rdoc
168
+ - README.md
57
169
  - test/dummy/config.ru
170
+ - test/dummy/db/development.sqlite3
171
+ - test/dummy/db/schema.rb
172
+ - test/dummy/db/test.sqlite3
173
+ - test/dummy/log/test.log
174
+ - test/dummy/log/development.log
58
175
  - test/dummy/config/application.rb
59
176
  - test/dummy/config/initializers/session_store.rb
60
177
  - test/dummy/config/initializers/secret_token.rb
@@ -82,6 +199,8 @@ files:
82
199
  - test/dummy/app/controllers/application_controller.rb
83
200
  - test/dummy/app/helpers/application_helper.rb
84
201
  - test/dummy/README.rdoc
202
+ - test/unit/transient_objects/family_member_merger_test.rb
203
+ - test/unit/transient_objects/user_merger_test.rb
85
204
  - test/integration/navigation_test.rb
86
205
  - test/test_helper.rb
87
206
  - test/transient_objects_test.rb
@@ -99,13 +218,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
218
  version: '0'
100
219
  segments:
101
220
  - 0
102
- hash: -31867775
221
+ hash: 941647983
103
222
  required_rubygems_version: !ruby/object:Gem::Requirement
104
223
  none: false
105
224
  requirements:
106
- - - ! '>'
225
+ - - ! '>='
107
226
  - !ruby/object:Gem::Version
108
- version: 1.3.1
227
+ version: '0'
228
+ segments:
229
+ - 0
230
+ hash: 941647983
109
231
  requirements: []
110
232
  rubyforge_project:
111
233
  rubygems_version: 1.8.15
@@ -114,6 +236,11 @@ specification_version: 3
114
236
  summary: Support objects that require no database.
115
237
  test_files:
116
238
  - test/dummy/config.ru
239
+ - test/dummy/db/development.sqlite3
240
+ - test/dummy/db/schema.rb
241
+ - test/dummy/db/test.sqlite3
242
+ - test/dummy/log/test.log
243
+ - test/dummy/log/development.log
117
244
  - test/dummy/config/application.rb
118
245
  - test/dummy/config/initializers/session_store.rb
119
246
  - test/dummy/config/initializers/secret_token.rb
@@ -141,6 +268,8 @@ test_files:
141
268
  - test/dummy/app/controllers/application_controller.rb
142
269
  - test/dummy/app/helpers/application_helper.rb
143
270
  - test/dummy/README.rdoc
271
+ - test/unit/transient_objects/family_member_merger_test.rb
272
+ - test/unit/transient_objects/user_merger_test.rb
144
273
  - test/integration/navigation_test.rb
145
274
  - test/test_helper.rb
146
275
  - test/transient_objects_test.rb
data/README.rdoc DELETED
@@ -1,3 +0,0 @@
1
- = TransientObjects
2
-
3
- This project rocks and uses MIT-LICENSE.