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 'pathname'
2
+ require 'erb'
3
+ require 'yaml'
4
+
5
+ module Configy
6
+ class ConfigFile
7
+ def initialize(path, section)
8
+ @path = Pathname.new(path)
9
+ @section = section
10
+ end
11
+
12
+ def config
13
+ ConfigStore.new(load_file).compile(@section)
14
+ end
15
+
16
+ def load_file
17
+ YAML::load( ERB.new(@path.read).result )
18
+ rescue Errno::ENOENT
19
+ {}
20
+ end
21
+
22
+ def mtime
23
+ @path.mtime
24
+ rescue Errno::ENOENT
25
+ Time.at(0)
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,823 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 55
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 5
23
+ 7
24
+ 2
25
+ 64
26
+ 47
27
+ 49
28
+ 1
29
+ 1
30
+ 15
31
+ 5
32
+ 7
33
+ 3
34
+ 64
35
+ 47
36
+ 49
37
+ 1
38
+ 1
39
+ 15
40
+ 99
41
+ 7
42
+ 4
43
+ 65
44
+ 49
45
+ 5
46
+ 2
47
+ 13
48
+ 99
49
+ 12
50
+ 7
51
+ 6
52
+ 12
53
+ 7
54
+ 7
55
+ 12
56
+ 65
57
+ 12
58
+ 49
59
+ 8
60
+ 4
61
+ 15
62
+ 49
63
+ 6
64
+ 0
65
+ 15
66
+ 2
67
+ 11
68
+ I
69
+ 6
70
+ I
71
+ 0
72
+ I
73
+ 0
74
+ I
75
+ 0
76
+ n
77
+ p
78
+ 9
79
+ s
80
+ 8
81
+ pathname
82
+ x
83
+ 7
84
+ require
85
+ s
86
+ 3
87
+ erb
88
+ s
89
+ 4
90
+ yaml
91
+ x
92
+ 7
93
+ Configy
94
+ x
95
+ 11
96
+ open_module
97
+ x
98
+ 15
99
+ __module_init__
100
+ M
101
+ 1
102
+ n
103
+ n
104
+ x
105
+ 7
106
+ Configy
107
+ i
108
+ 29
109
+ 5
110
+ 66
111
+ 99
112
+ 7
113
+ 0
114
+ 1
115
+ 65
116
+ 49
117
+ 1
118
+ 3
119
+ 13
120
+ 99
121
+ 12
122
+ 7
123
+ 2
124
+ 12
125
+ 7
126
+ 3
127
+ 12
128
+ 65
129
+ 12
130
+ 49
131
+ 4
132
+ 4
133
+ 15
134
+ 49
135
+ 2
136
+ 0
137
+ 11
138
+ I
139
+ 6
140
+ I
141
+ 0
142
+ I
143
+ 0
144
+ I
145
+ 0
146
+ n
147
+ p
148
+ 5
149
+ x
150
+ 10
151
+ ConfigFile
152
+ x
153
+ 10
154
+ open_class
155
+ x
156
+ 14
157
+ __class_init__
158
+ M
159
+ 1
160
+ n
161
+ n
162
+ x
163
+ 10
164
+ ConfigFile
165
+ i
166
+ 58
167
+ 5
168
+ 66
169
+ 99
170
+ 7
171
+ 0
172
+ 7
173
+ 1
174
+ 65
175
+ 67
176
+ 49
177
+ 2
178
+ 0
179
+ 49
180
+ 3
181
+ 4
182
+ 15
183
+ 99
184
+ 7
185
+ 4
186
+ 7
187
+ 5
188
+ 65
189
+ 67
190
+ 49
191
+ 2
192
+ 0
193
+ 49
194
+ 3
195
+ 4
196
+ 15
197
+ 99
198
+ 7
199
+ 6
200
+ 7
201
+ 7
202
+ 65
203
+ 67
204
+ 49
205
+ 2
206
+ 0
207
+ 49
208
+ 3
209
+ 4
210
+ 15
211
+ 99
212
+ 7
213
+ 8
214
+ 7
215
+ 9
216
+ 65
217
+ 67
218
+ 49
219
+ 2
220
+ 0
221
+ 49
222
+ 3
223
+ 4
224
+ 11
225
+ I
226
+ 5
227
+ I
228
+ 0
229
+ I
230
+ 0
231
+ I
232
+ 0
233
+ n
234
+ p
235
+ 10
236
+ x
237
+ 10
238
+ initialize
239
+ M
240
+ 1
241
+ n
242
+ n
243
+ x
244
+ 10
245
+ initialize
246
+ i
247
+ 36
248
+ 45
249
+ 0
250
+ 1
251
+ 13
252
+ 71
253
+ 2
254
+ 47
255
+ 9
256
+ 23
257
+ 47
258
+ 49
259
+ 3
260
+ 0
261
+ 13
262
+ 20
263
+ 0
264
+ 47
265
+ 49
266
+ 4
267
+ 1
268
+ 15
269
+ 8
270
+ 28
271
+ 20
272
+ 0
273
+ 49
274
+ 2
275
+ 1
276
+ 38
277
+ 5
278
+ 15
279
+ 20
280
+ 1
281
+ 38
282
+ 6
283
+ 11
284
+ I
285
+ 5
286
+ I
287
+ 2
288
+ I
289
+ 2
290
+ I
291
+ 2
292
+ n
293
+ p
294
+ 7
295
+ x
296
+ 8
297
+ Pathname
298
+ n
299
+ x
300
+ 3
301
+ new
302
+ x
303
+ 8
304
+ allocate
305
+ x
306
+ 10
307
+ initialize
308
+ x
309
+ 5
310
+ @path
311
+ x
312
+ 8
313
+ @section
314
+ p
315
+ 7
316
+ I
317
+ 0
318
+ I
319
+ 7
320
+ I
321
+ 0
322
+ I
323
+ 8
324
+ I
325
+ 1f
326
+ I
327
+ 9
328
+ I
329
+ 24
330
+ x
331
+ 67
332
+ /Users/gabevarela/work/ruby/gems/configy/lib/configy/config_file.rb
333
+ p
334
+ 2
335
+ x
336
+ 4
337
+ path
338
+ x
339
+ 7
340
+ section
341
+ x
342
+ 17
343
+ method_visibility
344
+ x
345
+ 15
346
+ add_defn_method
347
+ x
348
+ 6
349
+ config
350
+ M
351
+ 1
352
+ n
353
+ n
354
+ x
355
+ 6
356
+ config
357
+ i
358
+ 36
359
+ 45
360
+ 0
361
+ 1
362
+ 13
363
+ 71
364
+ 2
365
+ 47
366
+ 9
367
+ 24
368
+ 47
369
+ 49
370
+ 3
371
+ 0
372
+ 13
373
+ 5
374
+ 48
375
+ 4
376
+ 47
377
+ 49
378
+ 5
379
+ 1
380
+ 15
381
+ 8
382
+ 30
383
+ 5
384
+ 48
385
+ 4
386
+ 49
387
+ 2
388
+ 1
389
+ 39
390
+ 6
391
+ 49
392
+ 7
393
+ 1
394
+ 11
395
+ I
396
+ 3
397
+ I
398
+ 0
399
+ I
400
+ 0
401
+ I
402
+ 0
403
+ n
404
+ p
405
+ 8
406
+ x
407
+ 11
408
+ ConfigStore
409
+ n
410
+ x
411
+ 3
412
+ new
413
+ x
414
+ 8
415
+ allocate
416
+ x
417
+ 9
418
+ load_file
419
+ x
420
+ 10
421
+ initialize
422
+ x
423
+ 8
424
+ @section
425
+ x
426
+ 7
427
+ compile
428
+ p
429
+ 5
430
+ I
431
+ 0
432
+ I
433
+ c
434
+ I
435
+ 0
436
+ I
437
+ d
438
+ I
439
+ 24
440
+ x
441
+ 67
442
+ /Users/gabevarela/work/ruby/gems/configy/lib/configy/config_file.rb
443
+ p
444
+ 0
445
+ x
446
+ 9
447
+ load_file
448
+ M
449
+ 1
450
+ n
451
+ n
452
+ x
453
+ 9
454
+ load_file
455
+ i
456
+ 92
457
+ 26
458
+ 93
459
+ 0
460
+ 15
461
+ 29
462
+ 53
463
+ 0
464
+ 45
465
+ 0
466
+ 1
467
+ 45
468
+ 2
469
+ 3
470
+ 13
471
+ 71
472
+ 4
473
+ 47
474
+ 9
475
+ 36
476
+ 47
477
+ 49
478
+ 5
479
+ 0
480
+ 13
481
+ 39
482
+ 6
483
+ 49
484
+ 7
485
+ 0
486
+ 47
487
+ 49
488
+ 8
489
+ 1
490
+ 15
491
+ 8
492
+ 44
493
+ 39
494
+ 6
495
+ 49
496
+ 7
497
+ 0
498
+ 49
499
+ 4
500
+ 1
501
+ 49
502
+ 9
503
+ 0
504
+ 49
505
+ 10
506
+ 1
507
+ 30
508
+ 8
509
+ 88
510
+ 26
511
+ 93
512
+ 1
513
+ 15
514
+ 24
515
+ 13
516
+ 45
517
+ 11
518
+ 12
519
+ 43
520
+ 13
521
+ 12
522
+ 49
523
+ 14
524
+ 1
525
+ 10
526
+ 72
527
+ 8
528
+ 83
529
+ 15
530
+ 44
531
+ 43
532
+ 15
533
+ 78
534
+ 49
535
+ 16
536
+ 1
537
+ 25
538
+ 8
539
+ 88
540
+ 15
541
+ 92
542
+ 1
543
+ 27
544
+ 34
545
+ 92
546
+ 0
547
+ 27
548
+ 11
549
+ I
550
+ 6
551
+ I
552
+ 0
553
+ I
554
+ 0
555
+ I
556
+ 0
557
+ n
558
+ p
559
+ 17
560
+ x
561
+ 4
562
+ YAML
563
+ n
564
+ x
565
+ 3
566
+ ERB
567
+ n
568
+ x
569
+ 3
570
+ new
571
+ x
572
+ 8
573
+ allocate
574
+ x
575
+ 5
576
+ @path
577
+ x
578
+ 4
579
+ read
580
+ x
581
+ 10
582
+ initialize
583
+ x
584
+ 6
585
+ result
586
+ x
587
+ 4
588
+ load
589
+ x
590
+ 5
591
+ Errno
592
+ n
593
+ x
594
+ 6
595
+ ENOENT
596
+ x
597
+ 3
598
+ ===
599
+ x
600
+ 4
601
+ Hash
602
+ x
603
+ 16
604
+ new_from_literal
605
+ p
606
+ 9
607
+ I
608
+ 0
609
+ I
610
+ 10
611
+ I
612
+ 0
613
+ I
614
+ 11
615
+ I
616
+ 3a
617
+ I
618
+ 12
619
+ I
620
+ 49
621
+ I
622
+ 13
623
+ I
624
+ 5c
625
+ x
626
+ 67
627
+ /Users/gabevarela/work/ruby/gems/configy/lib/configy/config_file.rb
628
+ p
629
+ 0
630
+ x
631
+ 5
632
+ mtime
633
+ M
634
+ 1
635
+ n
636
+ n
637
+ x
638
+ 5
639
+ mtime
640
+ i
641
+ 54
642
+ 26
643
+ 93
644
+ 0
645
+ 15
646
+ 29
647
+ 15
648
+ 0
649
+ 39
650
+ 0
651
+ 49
652
+ 1
653
+ 0
654
+ 30
655
+ 8
656
+ 50
657
+ 26
658
+ 93
659
+ 1
660
+ 15
661
+ 24
662
+ 13
663
+ 45
664
+ 2
665
+ 3
666
+ 43
667
+ 4
668
+ 12
669
+ 49
670
+ 5
671
+ 1
672
+ 10
673
+ 34
674
+ 8
675
+ 45
676
+ 15
677
+ 45
678
+ 6
679
+ 7
680
+ 78
681
+ 49
682
+ 8
683
+ 1
684
+ 25
685
+ 8
686
+ 50
687
+ 15
688
+ 92
689
+ 1
690
+ 27
691
+ 34
692
+ 92
693
+ 0
694
+ 27
695
+ 11
696
+ I
697
+ 5
698
+ I
699
+ 0
700
+ I
701
+ 0
702
+ I
703
+ 0
704
+ n
705
+ p
706
+ 9
707
+ x
708
+ 5
709
+ @path
710
+ x
711
+ 5
712
+ mtime
713
+ x
714
+ 5
715
+ Errno
716
+ n
717
+ x
718
+ 6
719
+ ENOENT
720
+ x
721
+ 3
722
+ ===
723
+ x
724
+ 4
725
+ Time
726
+ n
727
+ x
728
+ 2
729
+ at
730
+ p
731
+ 9
732
+ I
733
+ 0
734
+ I
735
+ 16
736
+ I
737
+ 0
738
+ I
739
+ 17
740
+ I
741
+ 14
742
+ I
743
+ 18
744
+ I
745
+ 23
746
+ I
747
+ 19
748
+ I
749
+ 36
750
+ x
751
+ 67
752
+ /Users/gabevarela/work/ruby/gems/configy/lib/configy/config_file.rb
753
+ p
754
+ 0
755
+ p
756
+ 9
757
+ I
758
+ 2
759
+ I
760
+ 7
761
+ I
762
+ 10
763
+ I
764
+ c
765
+ I
766
+ 1e
767
+ I
768
+ 10
769
+ I
770
+ 2c
771
+ I
772
+ 16
773
+ I
774
+ 3a
775
+ x
776
+ 67
777
+ /Users/gabevarela/work/ruby/gems/configy/lib/configy/config_file.rb
778
+ p
779
+ 0
780
+ x
781
+ 13
782
+ attach_method
783
+ p
784
+ 3
785
+ I
786
+ 2
787
+ I
788
+ 6
789
+ I
790
+ 1d
791
+ x
792
+ 67
793
+ /Users/gabevarela/work/ruby/gems/configy/lib/configy/config_file.rb
794
+ p
795
+ 0
796
+ x
797
+ 13
798
+ attach_method
799
+ p
800
+ 9
801
+ I
802
+ 0
803
+ I
804
+ 1
805
+ I
806
+ 9
807
+ I
808
+ 2
809
+ I
810
+ 12
811
+ I
812
+ 3
813
+ I
814
+ 1b
815
+ I
816
+ 5
817
+ I
818
+ 37
819
+ x
820
+ 67
821
+ /Users/gabevarela/work/ruby/gems/configy/lib/configy/config_file.rb
822
+ p
823
+ 0