configy 0.0.4 → 1.0.0

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.
@@ -0,0 +1,28 @@
1
+ require 'test_helper'
2
+
3
+ class ConfigFileTest < MiniTest::Unit::TestCase
4
+ def test_should_load_a_config_from_a_file
5
+ with_config_file( { 'common' => {'a' => '1', 'b' => '2' } }, 'app_config' ) do |file, hash|
6
+ configfile = Configy::ConfigFile.new(file, 'development')
7
+ assert_equal hash, configfile.load_file
8
+ end
9
+ end
10
+
11
+ def test_should_create_an_instance_of_config_store
12
+ with_config_file( { 'common' => {'a' => '1', 'b' => '2' } }, 'app_config' ) do |file, hash|
13
+ configfile = Configy::ConfigFile.new(file, 'development')
14
+ assert_instance_of Configy::ConfigStore, configfile.config
15
+ end
16
+ end
17
+
18
+ def test_should_be_aware_of_a_files_mtime
19
+ configfile = Configy::ConfigFile.new('nonexistent/file', 'development')
20
+ assert_equal Time.at(0), configfile.mtime
21
+
22
+ with_config_file( { 'common' => {'a' => '1', 'b' => '2' } }, 'app_config' ) do |file, hash|
23
+ configfile = Configy::ConfigFile.new(file, 'development')
24
+ assert_equal File.mtime(file), configfile.mtime
25
+ end
26
+ end
27
+
28
+ end
@@ -0,0 +1,1125 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 44
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 99
23
+ 7
24
+ 2
25
+ 45
26
+ 3
27
+ 4
28
+ 43
29
+ 5
30
+ 43
31
+ 6
32
+ 65
33
+ 49
34
+ 7
35
+ 3
36
+ 13
37
+ 99
38
+ 12
39
+ 7
40
+ 8
41
+ 12
42
+ 7
43
+ 9
44
+ 12
45
+ 65
46
+ 12
47
+ 49
48
+ 10
49
+ 4
50
+ 15
51
+ 49
52
+ 8
53
+ 0
54
+ 15
55
+ 2
56
+ 11
57
+ I
58
+ 6
59
+ I
60
+ 0
61
+ I
62
+ 0
63
+ I
64
+ 0
65
+ n
66
+ p
67
+ 11
68
+ s
69
+ 11
70
+ test_helper
71
+ x
72
+ 7
73
+ require
74
+ x
75
+ 14
76
+ ConfigFileTest
77
+ x
78
+ 8
79
+ MiniTest
80
+ n
81
+ x
82
+ 4
83
+ Unit
84
+ x
85
+ 8
86
+ TestCase
87
+ x
88
+ 10
89
+ open_class
90
+ x
91
+ 14
92
+ __class_init__
93
+ M
94
+ 1
95
+ n
96
+ n
97
+ x
98
+ 14
99
+ ConfigFileTest
100
+ i
101
+ 44
102
+ 5
103
+ 66
104
+ 99
105
+ 7
106
+ 0
107
+ 7
108
+ 1
109
+ 65
110
+ 67
111
+ 49
112
+ 2
113
+ 0
114
+ 49
115
+ 3
116
+ 4
117
+ 15
118
+ 99
119
+ 7
120
+ 4
121
+ 7
122
+ 5
123
+ 65
124
+ 67
125
+ 49
126
+ 2
127
+ 0
128
+ 49
129
+ 3
130
+ 4
131
+ 15
132
+ 99
133
+ 7
134
+ 6
135
+ 7
136
+ 7
137
+ 65
138
+ 67
139
+ 49
140
+ 2
141
+ 0
142
+ 49
143
+ 3
144
+ 4
145
+ 11
146
+ I
147
+ 5
148
+ I
149
+ 0
150
+ I
151
+ 0
152
+ I
153
+ 0
154
+ n
155
+ p
156
+ 8
157
+ x
158
+ 37
159
+ test_should_load_a_config_from_a_file
160
+ M
161
+ 1
162
+ n
163
+ n
164
+ x
165
+ 37
166
+ test_should_load_a_config_from_a_file
167
+ i
168
+ 55
169
+ 5
170
+ 44
171
+ 43
172
+ 0
173
+ 79
174
+ 49
175
+ 1
176
+ 1
177
+ 13
178
+ 7
179
+ 2
180
+ 64
181
+ 44
182
+ 43
183
+ 0
184
+ 80
185
+ 49
186
+ 1
187
+ 1
188
+ 13
189
+ 7
190
+ 3
191
+ 64
192
+ 7
193
+ 4
194
+ 64
195
+ 49
196
+ 5
197
+ 2
198
+ 15
199
+ 13
200
+ 7
201
+ 6
202
+ 64
203
+ 7
204
+ 7
205
+ 64
206
+ 49
207
+ 5
208
+ 2
209
+ 15
210
+ 49
211
+ 5
212
+ 2
213
+ 15
214
+ 7
215
+ 8
216
+ 64
217
+ 56
218
+ 9
219
+ 47
220
+ 50
221
+ 10
222
+ 2
223
+ 11
224
+ I
225
+ 8
226
+ I
227
+ 0
228
+ I
229
+ 0
230
+ I
231
+ 0
232
+ n
233
+ p
234
+ 11
235
+ x
236
+ 4
237
+ Hash
238
+ x
239
+ 16
240
+ new_from_literal
241
+ s
242
+ 6
243
+ common
244
+ s
245
+ 1
246
+ a
247
+ s
248
+ 1
249
+ 1
250
+ x
251
+ 3
252
+ []=
253
+ s
254
+ 1
255
+ b
256
+ s
257
+ 1
258
+ 2
259
+ s
260
+ 10
261
+ app_config
262
+ M
263
+ 1
264
+ p
265
+ 2
266
+ x
267
+ 9
268
+ for_block
269
+ t
270
+ n
271
+ x
272
+ 37
273
+ test_should_load_a_config_from_a_file
274
+ i
275
+ 62
276
+ 58
277
+ 37
278
+ 19
279
+ 0
280
+ 15
281
+ 37
282
+ 19
283
+ 1
284
+ 15
285
+ 15
286
+ 45
287
+ 0
288
+ 1
289
+ 43
290
+ 2
291
+ 13
292
+ 71
293
+ 3
294
+ 47
295
+ 9
296
+ 38
297
+ 47
298
+ 49
299
+ 4
300
+ 0
301
+ 13
302
+ 20
303
+ 0
304
+ 7
305
+ 5
306
+ 64
307
+ 47
308
+ 49
309
+ 6
310
+ 2
311
+ 15
312
+ 8
313
+ 46
314
+ 20
315
+ 0
316
+ 7
317
+ 5
318
+ 64
319
+ 49
320
+ 3
321
+ 2
322
+ 19
323
+ 2
324
+ 15
325
+ 5
326
+ 20
327
+ 1
328
+ 20
329
+ 2
330
+ 49
331
+ 7
332
+ 0
333
+ 47
334
+ 49
335
+ 8
336
+ 2
337
+ 11
338
+ I
339
+ 8
340
+ I
341
+ 3
342
+ I
343
+ 2
344
+ I
345
+ 2
346
+ n
347
+ p
348
+ 9
349
+ x
350
+ 7
351
+ Configy
352
+ n
353
+ x
354
+ 10
355
+ ConfigFile
356
+ x
357
+ 3
358
+ new
359
+ x
360
+ 8
361
+ allocate
362
+ s
363
+ 11
364
+ development
365
+ x
366
+ 10
367
+ initialize
368
+ x
369
+ 9
370
+ load_file
371
+ x
372
+ 12
373
+ assert_equal
374
+ p
375
+ 7
376
+ I
377
+ 0
378
+ I
379
+ 5
380
+ I
381
+ a
382
+ I
383
+ 6
384
+ I
385
+ 31
386
+ I
387
+ 7
388
+ I
389
+ 3e
390
+ x
391
+ 65
392
+ /Users/gabevarela/work/ruby/gems/configy/test/config_file_test.rb
393
+ p
394
+ 3
395
+ x
396
+ 4
397
+ file
398
+ x
399
+ 4
400
+ hash
401
+ x
402
+ 10
403
+ configfile
404
+ x
405
+ 16
406
+ with_config_file
407
+ p
408
+ 5
409
+ I
410
+ 0
411
+ I
412
+ 4
413
+ I
414
+ 0
415
+ I
416
+ 5
417
+ I
418
+ 37
419
+ x
420
+ 65
421
+ /Users/gabevarela/work/ruby/gems/configy/test/config_file_test.rb
422
+ p
423
+ 0
424
+ x
425
+ 17
426
+ method_visibility
427
+ x
428
+ 15
429
+ add_defn_method
430
+ x
431
+ 46
432
+ test_should_create_an_instance_of_config_store
433
+ M
434
+ 1
435
+ n
436
+ n
437
+ x
438
+ 46
439
+ test_should_create_an_instance_of_config_store
440
+ i
441
+ 55
442
+ 5
443
+ 44
444
+ 43
445
+ 0
446
+ 79
447
+ 49
448
+ 1
449
+ 1
450
+ 13
451
+ 7
452
+ 2
453
+ 64
454
+ 44
455
+ 43
456
+ 0
457
+ 80
458
+ 49
459
+ 1
460
+ 1
461
+ 13
462
+ 7
463
+ 3
464
+ 64
465
+ 7
466
+ 4
467
+ 64
468
+ 49
469
+ 5
470
+ 2
471
+ 15
472
+ 13
473
+ 7
474
+ 6
475
+ 64
476
+ 7
477
+ 7
478
+ 64
479
+ 49
480
+ 5
481
+ 2
482
+ 15
483
+ 49
484
+ 5
485
+ 2
486
+ 15
487
+ 7
488
+ 8
489
+ 64
490
+ 56
491
+ 9
492
+ 47
493
+ 50
494
+ 10
495
+ 2
496
+ 11
497
+ I
498
+ 8
499
+ I
500
+ 0
501
+ I
502
+ 0
503
+ I
504
+ 0
505
+ n
506
+ p
507
+ 11
508
+ x
509
+ 4
510
+ Hash
511
+ x
512
+ 16
513
+ new_from_literal
514
+ s
515
+ 6
516
+ common
517
+ s
518
+ 1
519
+ a
520
+ s
521
+ 1
522
+ 1
523
+ x
524
+ 3
525
+ []=
526
+ s
527
+ 1
528
+ b
529
+ s
530
+ 1
531
+ 2
532
+ s
533
+ 10
534
+ app_config
535
+ M
536
+ 1
537
+ p
538
+ 2
539
+ x
540
+ 9
541
+ for_block
542
+ t
543
+ n
544
+ x
545
+ 46
546
+ test_should_create_an_instance_of_config_store
547
+ i
548
+ 65
549
+ 58
550
+ 37
551
+ 19
552
+ 0
553
+ 15
554
+ 37
555
+ 19
556
+ 1
557
+ 15
558
+ 15
559
+ 45
560
+ 0
561
+ 1
562
+ 43
563
+ 2
564
+ 13
565
+ 71
566
+ 3
567
+ 47
568
+ 9
569
+ 38
570
+ 47
571
+ 49
572
+ 4
573
+ 0
574
+ 13
575
+ 20
576
+ 0
577
+ 7
578
+ 5
579
+ 64
580
+ 47
581
+ 49
582
+ 6
583
+ 2
584
+ 15
585
+ 8
586
+ 46
587
+ 20
588
+ 0
589
+ 7
590
+ 5
591
+ 64
592
+ 49
593
+ 3
594
+ 2
595
+ 19
596
+ 2
597
+ 15
598
+ 5
599
+ 45
600
+ 0
601
+ 7
602
+ 43
603
+ 8
604
+ 20
605
+ 2
606
+ 49
607
+ 9
608
+ 0
609
+ 47
610
+ 49
611
+ 10
612
+ 2
613
+ 11
614
+ I
615
+ 8
616
+ I
617
+ 3
618
+ I
619
+ 2
620
+ I
621
+ 2
622
+ n
623
+ p
624
+ 11
625
+ x
626
+ 7
627
+ Configy
628
+ n
629
+ x
630
+ 10
631
+ ConfigFile
632
+ x
633
+ 3
634
+ new
635
+ x
636
+ 8
637
+ allocate
638
+ s
639
+ 11
640
+ development
641
+ x
642
+ 10
643
+ initialize
644
+ n
645
+ x
646
+ 11
647
+ ConfigStore
648
+ x
649
+ 6
650
+ config
651
+ x
652
+ 18
653
+ assert_instance_of
654
+ p
655
+ 7
656
+ I
657
+ 0
658
+ I
659
+ c
660
+ I
661
+ a
662
+ I
663
+ d
664
+ I
665
+ 31
666
+ I
667
+ e
668
+ I
669
+ 41
670
+ x
671
+ 65
672
+ /Users/gabevarela/work/ruby/gems/configy/test/config_file_test.rb
673
+ p
674
+ 3
675
+ x
676
+ 4
677
+ file
678
+ x
679
+ 4
680
+ hash
681
+ x
682
+ 10
683
+ configfile
684
+ x
685
+ 16
686
+ with_config_file
687
+ p
688
+ 5
689
+ I
690
+ 0
691
+ I
692
+ b
693
+ I
694
+ 0
695
+ I
696
+ c
697
+ I
698
+ 37
699
+ x
700
+ 65
701
+ /Users/gabevarela/work/ruby/gems/configy/test/config_file_test.rb
702
+ p
703
+ 0
704
+ x
705
+ 37
706
+ test_should_be_aware_of_a_files_mtime
707
+ M
708
+ 1
709
+ n
710
+ n
711
+ x
712
+ 37
713
+ test_should_be_aware_of_a_files_mtime
714
+ i
715
+ 114
716
+ 45
717
+ 0
718
+ 1
719
+ 43
720
+ 2
721
+ 13
722
+ 71
723
+ 3
724
+ 47
725
+ 9
726
+ 29
727
+ 47
728
+ 49
729
+ 4
730
+ 0
731
+ 13
732
+ 7
733
+ 5
734
+ 64
735
+ 7
736
+ 6
737
+ 64
738
+ 47
739
+ 49
740
+ 7
741
+ 2
742
+ 15
743
+ 8
744
+ 38
745
+ 7
746
+ 5
747
+ 64
748
+ 7
749
+ 6
750
+ 64
751
+ 49
752
+ 3
753
+ 2
754
+ 19
755
+ 0
756
+ 15
757
+ 5
758
+ 45
759
+ 8
760
+ 9
761
+ 78
762
+ 49
763
+ 10
764
+ 1
765
+ 20
766
+ 0
767
+ 49
768
+ 11
769
+ 0
770
+ 47
771
+ 49
772
+ 12
773
+ 2
774
+ 15
775
+ 5
776
+ 44
777
+ 43
778
+ 13
779
+ 79
780
+ 49
781
+ 14
782
+ 1
783
+ 13
784
+ 7
785
+ 15
786
+ 64
787
+ 44
788
+ 43
789
+ 13
790
+ 80
791
+ 49
792
+ 14
793
+ 1
794
+ 13
795
+ 7
796
+ 16
797
+ 64
798
+ 7
799
+ 17
800
+ 64
801
+ 49
802
+ 18
803
+ 2
804
+ 15
805
+ 13
806
+ 7
807
+ 19
808
+ 64
809
+ 7
810
+ 20
811
+ 64
812
+ 49
813
+ 18
814
+ 2
815
+ 15
816
+ 49
817
+ 18
818
+ 2
819
+ 15
820
+ 7
821
+ 21
822
+ 64
823
+ 56
824
+ 22
825
+ 47
826
+ 50
827
+ 23
828
+ 2
829
+ 11
830
+ I
831
+ 9
832
+ I
833
+ 1
834
+ I
835
+ 0
836
+ I
837
+ 0
838
+ n
839
+ p
840
+ 24
841
+ x
842
+ 7
843
+ Configy
844
+ n
845
+ x
846
+ 10
847
+ ConfigFile
848
+ x
849
+ 3
850
+ new
851
+ x
852
+ 8
853
+ allocate
854
+ s
855
+ 16
856
+ nonexistent/file
857
+ s
858
+ 11
859
+ development
860
+ x
861
+ 10
862
+ initialize
863
+ x
864
+ 4
865
+ Time
866
+ n
867
+ x
868
+ 2
869
+ at
870
+ x
871
+ 5
872
+ mtime
873
+ x
874
+ 12
875
+ assert_equal
876
+ x
877
+ 4
878
+ Hash
879
+ x
880
+ 16
881
+ new_from_literal
882
+ s
883
+ 6
884
+ common
885
+ s
886
+ 1
887
+ a
888
+ s
889
+ 1
890
+ 1
891
+ x
892
+ 3
893
+ []=
894
+ s
895
+ 1
896
+ b
897
+ s
898
+ 1
899
+ 2
900
+ s
901
+ 10
902
+ app_config
903
+ M
904
+ 1
905
+ p
906
+ 2
907
+ x
908
+ 9
909
+ for_block
910
+ t
911
+ n
912
+ x
913
+ 37
914
+ test_should_be_aware_of_a_files_mtime
915
+ i
916
+ 70
917
+ 58
918
+ 37
919
+ 19
920
+ 0
921
+ 15
922
+ 37
923
+ 19
924
+ 1
925
+ 15
926
+ 15
927
+ 45
928
+ 0
929
+ 1
930
+ 43
931
+ 2
932
+ 13
933
+ 71
934
+ 3
935
+ 47
936
+ 9
937
+ 38
938
+ 47
939
+ 49
940
+ 4
941
+ 0
942
+ 13
943
+ 20
944
+ 0
945
+ 7
946
+ 5
947
+ 64
948
+ 47
949
+ 49
950
+ 6
951
+ 2
952
+ 15
953
+ 8
954
+ 46
955
+ 20
956
+ 0
957
+ 7
958
+ 5
959
+ 64
960
+ 49
961
+ 3
962
+ 2
963
+ 22
964
+ 1
965
+ 0
966
+ 15
967
+ 5
968
+ 45
969
+ 7
970
+ 8
971
+ 20
972
+ 0
973
+ 49
974
+ 9
975
+ 1
976
+ 21
977
+ 1
978
+ 0
979
+ 49
980
+ 9
981
+ 0
982
+ 47
983
+ 49
984
+ 10
985
+ 2
986
+ 11
987
+ I
988
+ 7
989
+ I
990
+ 2
991
+ I
992
+ 2
993
+ I
994
+ 2
995
+ n
996
+ p
997
+ 11
998
+ x
999
+ 7
1000
+ Configy
1001
+ n
1002
+ x
1003
+ 10
1004
+ ConfigFile
1005
+ x
1006
+ 3
1007
+ new
1008
+ x
1009
+ 8
1010
+ allocate
1011
+ s
1012
+ 11
1013
+ development
1014
+ x
1015
+ 10
1016
+ initialize
1017
+ x
1018
+ 4
1019
+ File
1020
+ n
1021
+ x
1022
+ 5
1023
+ mtime
1024
+ x
1025
+ 12
1026
+ assert_equal
1027
+ p
1028
+ 7
1029
+ I
1030
+ 0
1031
+ I
1032
+ 16
1033
+ I
1034
+ a
1035
+ I
1036
+ 17
1037
+ I
1038
+ 32
1039
+ I
1040
+ 18
1041
+ I
1042
+ 46
1043
+ x
1044
+ 65
1045
+ /Users/gabevarela/work/ruby/gems/configy/test/config_file_test.rb
1046
+ p
1047
+ 2
1048
+ x
1049
+ 4
1050
+ file
1051
+ x
1052
+ 4
1053
+ hash
1054
+ x
1055
+ 16
1056
+ with_config_file
1057
+ p
1058
+ 9
1059
+ I
1060
+ 0
1061
+ I
1062
+ 12
1063
+ I
1064
+ 0
1065
+ I
1066
+ 13
1067
+ I
1068
+ 29
1069
+ I
1070
+ 14
1071
+ I
1072
+ 3b
1073
+ I
1074
+ 16
1075
+ I
1076
+ 72
1077
+ x
1078
+ 65
1079
+ /Users/gabevarela/work/ruby/gems/configy/test/config_file_test.rb
1080
+ p
1081
+ 1
1082
+ x
1083
+ 10
1084
+ configfile
1085
+ p
1086
+ 7
1087
+ I
1088
+ 2
1089
+ I
1090
+ 4
1091
+ I
1092
+ 10
1093
+ I
1094
+ b
1095
+ I
1096
+ 1e
1097
+ I
1098
+ 12
1099
+ I
1100
+ 2c
1101
+ x
1102
+ 65
1103
+ /Users/gabevarela/work/ruby/gems/configy/test/config_file_test.rb
1104
+ p
1105
+ 0
1106
+ x
1107
+ 13
1108
+ attach_method
1109
+ p
1110
+ 5
1111
+ I
1112
+ 0
1113
+ I
1114
+ 1
1115
+ I
1116
+ 9
1117
+ I
1118
+ 3
1119
+ I
1120
+ 2c
1121
+ x
1122
+ 65
1123
+ /Users/gabevarela/work/ruby/gems/configy/test/config_file_test.rb
1124
+ p
1125
+ 0