lazier 3.1.0 → 3.2.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.
- data/.travis-gemfile +3 -1
- data/.travis.yml +1 -1
- data/Gemfile +4 -4
- data/README.md +1 -0
- data/doc/Lazier.html +35 -35
- data/doc/Lazier/Boolean.html +3 -3
- data/doc/Lazier/Configuration.html +393 -0
- data/doc/Lazier/DateTime.html +3 -3
- data/doc/Lazier/DateTime/ClassMethods.html +3 -3
- data/doc/Lazier/Exceptions.html +3 -3
- data/doc/Lazier/Exceptions/Debug.html +3 -3
- data/doc/Lazier/Exceptions/MissingTranslation.html +3 -3
- data/doc/Lazier/Hash.html +3 -3
- data/doc/Lazier/I18n.html +7 -7
- data/doc/Lazier/Localizer.html +3 -3
- data/doc/Lazier/Math.html +3 -3
- data/doc/Lazier/Math/ClassMethods.html +3 -3
- data/doc/Lazier/Object.html +3 -3
- data/doc/Lazier/Pathname.html +3 -3
- data/doc/Lazier/Settings.html +3 -3
- data/doc/Lazier/String.html +119 -16
- data/doc/Lazier/TimeZone.html +3 -3
- data/doc/Lazier/TimeZone/ClassMethods.html +3 -3
- data/doc/Lazier/Version.html +4 -4
- data/doc/_index.html +15 -8
- data/doc/class_list.html +2 -1
- data/doc/file.README.html +5 -4
- data/doc/file_list.html +1 -0
- data/doc/frames.html +1 -1
- data/doc/index.html +5 -4
- data/doc/js/full_list.js +5 -5
- data/doc/method_list.html +69 -50
- data/doc/top-level-namespace.html +3 -3
- data/lazier.gemspec +1 -1
- data/lib/lazier.rb +1 -0
- data/lib/lazier/configuration.rb +63 -0
- data/lib/lazier/i18n.rb +1 -1
- data/lib/lazier/string.rb +9 -0
- data/lib/lazier/version.rb +1 -1
- data/locales/en.yml +5 -1
- data/locales/it.yml +5 -1
- data/spec/lazier/configuration_spec.rb +31 -0
- data/spec/lazier/string_spec.rb +14 -0
- metadata +9 -5
data/.travis-gemfile
CHANGED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
|
@@ -9,13 +9,13 @@ source "http://rubygems.org"
|
|
|
9
9
|
gemspec
|
|
10
10
|
|
|
11
11
|
# Testing
|
|
12
|
-
gem "rspec", "~> 2.
|
|
13
|
-
gem "rake", "~> 10.0
|
|
12
|
+
gem "rspec", "~> 2.14.1"
|
|
13
|
+
gem "rake", "~> 10.1.0"
|
|
14
14
|
|
|
15
15
|
# Documentation
|
|
16
16
|
gem "simplecov", ">= 0.7.1"
|
|
17
|
-
gem "coveralls", "
|
|
17
|
+
gem "coveralls", ">= 0.6.7", require: false
|
|
18
18
|
gem "pry", ">= 0"
|
|
19
19
|
gem "yard", ">= 0.8.6"
|
|
20
|
-
gem "kramdown", ">= 1.0
|
|
20
|
+
gem "kramdown", ">= 1.1.0"
|
|
21
21
|
gem "github-markup", ">= 0.7.5"
|
data/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
[](https://gemnasium.com/ShogunPanda/lazier)
|
|
5
5
|
[](http://travis-ci.org/ShogunPanda/lazier)
|
|
6
6
|
[](https://codeclimate.com/github/ShogunPanda/lazier)
|
|
7
|
+
[](https://coveralls.io/r/ShogunPanda/lazier)
|
|
7
8
|
|
|
8
9
|
Several Ruby object enhancements.
|
|
9
10
|
|
data/doc/Lazier.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>
|
|
7
7
|
Module: Lazier
|
|
8
8
|
|
|
9
|
-
— Documentation by YARD 0.8.6.
|
|
9
|
+
— Documentation by YARD 0.8.6.2
|
|
10
10
|
|
|
11
11
|
</title>
|
|
12
12
|
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
|
|
81
81
|
<dt class="r1 last">Defined in:</dt>
|
|
82
82
|
<dd class="r1 last">lib/lazier.rb<span class="defines">,<br />
|
|
83
|
-
lib/lazier/hash.rb,<br /> lib/lazier/i18n.rb,<br /> lib/lazier/math.rb,<br /> lib/lazier/
|
|
83
|
+
lib/lazier/hash.rb,<br /> lib/lazier/i18n.rb,<br /> lib/lazier/math.rb,<br /> lib/lazier/string.rb,<br /> lib/lazier/object.rb,<br /> lib/lazier/boolean.rb,<br /> lib/lazier/version.rb,<br /> lib/lazier/datetime.rb,<br /> lib/lazier/settings.rb,<br /> lib/lazier/pathname.rb,<br /> lib/lazier/localizer.rb,<br /> lib/lazier/exceptions.rb,<br /> lib/lazier/configuration.rb</span>
|
|
84
84
|
</dd>
|
|
85
85
|
|
|
86
86
|
</dl>
|
|
@@ -105,7 +105,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
105
105
|
|
|
106
106
|
|
|
107
107
|
|
|
108
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Lazier/Localizer.html" title="Lazier::Localizer (class)">Localizer</a></span>, <span class='object_link'><a href="Lazier/Settings.html" title="Lazier::Settings (class)">Settings</a></span>
|
|
108
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Lazier/Configuration.html" title="Lazier::Configuration (class)">Configuration</a></span>, <span class='object_link'><a href="Lazier/Localizer.html" title="Lazier::Localizer (class)">Localizer</a></span>, <span class='object_link'><a href="Lazier/Settings.html" title="Lazier::Settings (class)">Settings</a></span>
|
|
109
109
|
|
|
110
110
|
|
|
111
111
|
</p>
|
|
@@ -458,7 +458,6 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
458
458
|
<pre class="lines">
|
|
459
459
|
|
|
460
460
|
|
|
461
|
-
114
|
|
462
461
|
115
|
|
463
462
|
116
|
|
464
463
|
117
|
|
@@ -474,10 +473,11 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
474
473
|
127
|
|
475
474
|
128
|
|
476
475
|
129
|
|
477
|
-
130
|
|
476
|
+
130
|
|
477
|
+
131</pre>
|
|
478
478
|
</td>
|
|
479
479
|
<td>
|
|
480
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
|
480
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 115</span>
|
|
481
481
|
|
|
482
482
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_find_class'>find_class</span><span class='lparen'>(</span><span class='id identifier rubyid_cls'>cls</span><span class='comma'>,</span> <span class='id identifier rubyid_scope'>scope</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>::%CLASS%</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_only_in_scope'>only_in_scope</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
|
483
483
|
<span class='kw'>if</span> <span class='id identifier rubyid_cls'>cls</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>String</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_cls'>cls</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Symbol</span><span class='rparen'>)</span> <span class='kw'>then</span>
|
|
@@ -570,14 +570,14 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
570
570
|
<pre class="lines">
|
|
571
571
|
|
|
572
572
|
|
|
573
|
-
48
|
|
574
573
|
49
|
|
575
574
|
50
|
|
576
575
|
51
|
|
577
|
-
52
|
|
576
|
+
52
|
|
577
|
+
53</pre>
|
|
578
578
|
</td>
|
|
579
579
|
<td>
|
|
580
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
|
580
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 49</span>
|
|
581
581
|
|
|
582
582
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load!'>load!</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_what'>what</span><span class='rparen'>)</span>
|
|
583
583
|
<span class='lparen'>(</span><span class='id identifier rubyid_what'>what</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='op'>?</span> <span class='id identifier rubyid_what'>what</span> <span class='op'>:</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>object</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>boolean</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>string</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>hash</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>datetime</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>math</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pathname</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_w'>w</span><span class='op'>|</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>load_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_w'>w</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
@@ -614,7 +614,6 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
614
614
|
<pre class="lines">
|
|
615
615
|
|
|
616
616
|
|
|
617
|
-
60
|
|
618
617
|
61
|
|
619
618
|
62
|
|
620
619
|
63
|
|
@@ -624,10 +623,11 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
624
623
|
67
|
|
625
624
|
68
|
|
626
625
|
69
|
|
627
|
-
70
|
|
626
|
+
70
|
|
627
|
+
71</pre>
|
|
628
628
|
</td>
|
|
629
629
|
<td>
|
|
630
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
|
630
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 61</span>
|
|
631
631
|
|
|
632
632
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_boolean'>load_boolean</span>
|
|
633
633
|
<span class='op'>::</span><span class='const'>TrueClass</span><span class='period'>.</span><span class='id identifier rubyid_class_eval'>class_eval</span> <span class='kw'>do</span>
|
|
@@ -670,7 +670,6 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
670
670
|
<pre class="lines">
|
|
671
671
|
|
|
672
672
|
|
|
673
|
-
86
|
|
674
673
|
87
|
|
675
674
|
88
|
|
676
675
|
89
|
|
@@ -678,10 +677,11 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
678
677
|
91
|
|
679
678
|
92
|
|
680
679
|
93
|
|
681
|
-
94
|
|
680
|
+
94
|
|
681
|
+
95</pre>
|
|
682
682
|
</td>
|
|
683
683
|
<td>
|
|
684
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
|
684
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 87</span>
|
|
685
685
|
|
|
686
686
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_datetime'>load_datetime</span>
|
|
687
687
|
<span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_load_object'>load_object</span>
|
|
@@ -722,15 +722,15 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
722
722
|
<pre class="lines">
|
|
723
723
|
|
|
724
724
|
|
|
725
|
-
78
|
|
726
725
|
79
|
|
727
726
|
80
|
|
728
727
|
81
|
|
729
728
|
82
|
|
730
|
-
83
|
|
729
|
+
83
|
|
730
|
+
84</pre>
|
|
731
731
|
</td>
|
|
732
732
|
<td>
|
|
733
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
|
733
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 79</span>
|
|
734
734
|
|
|
735
735
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_hash'>load_hash</span>
|
|
736
736
|
<span class='op'>::</span><span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_class_eval'>class_eval</span> <span class='kw'>do</span>
|
|
@@ -768,13 +768,13 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
768
768
|
<pre class="lines">
|
|
769
769
|
|
|
770
770
|
|
|
771
|
-
97
|
|
772
771
|
98
|
|
773
772
|
99
|
|
774
|
-
100
|
|
773
|
+
100
|
|
774
|
+
101</pre>
|
|
775
775
|
</td>
|
|
776
776
|
<td>
|
|
777
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
|
777
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 98</span>
|
|
778
778
|
|
|
779
779
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_math'>load_math</span>
|
|
780
780
|
<span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_load_object'>load_object</span>
|
|
@@ -810,12 +810,12 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
810
810
|
<pre class="lines">
|
|
811
811
|
|
|
812
812
|
|
|
813
|
-
55
|
|
814
813
|
56
|
|
815
|
-
57
|
|
814
|
+
57
|
|
815
|
+
58</pre>
|
|
816
816
|
</td>
|
|
817
817
|
<td>
|
|
818
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
|
818
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 56</span>
|
|
819
819
|
|
|
820
820
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_object'>load_object</span>
|
|
821
821
|
<span class='op'>::</span><span class='const'>Object</span><span class='period'>.</span><span class='id identifier rubyid_class_eval'>class_eval</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_include'>include</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='op'>::</span><span class='const'>Object</span> <span class='rbrace'>}</span>
|
|
@@ -850,13 +850,13 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
850
850
|
<pre class="lines">
|
|
851
851
|
|
|
852
852
|
|
|
853
|
-
103
|
|
854
853
|
104
|
|
855
854
|
105
|
|
856
|
-
106
|
|
855
|
+
106
|
|
856
|
+
107</pre>
|
|
857
857
|
</td>
|
|
858
858
|
<td>
|
|
859
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
|
859
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 104</span>
|
|
860
860
|
|
|
861
861
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_pathname'>load_pathname</span>
|
|
862
862
|
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pathname</span><span class='tstring_end'>"</span></span>
|
|
@@ -892,12 +892,12 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
892
892
|
<pre class="lines">
|
|
893
893
|
|
|
894
894
|
|
|
895
|
-
73
|
|
896
895
|
74
|
|
897
|
-
75
|
|
896
|
+
75
|
|
897
|
+
76</pre>
|
|
898
898
|
</td>
|
|
899
899
|
<td>
|
|
900
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
|
900
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 74</span>
|
|
901
901
|
|
|
902
902
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_string'>load_string</span>
|
|
903
903
|
<span class='op'>::</span><span class='const'>String</span><span class='period'>.</span><span class='id identifier rubyid_class_eval'>class_eval</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_include'>include</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='op'>::</span><span class='const'>String</span> <span class='rbrace'>}</span>
|
|
@@ -949,12 +949,12 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
949
949
|
<pre class="lines">
|
|
950
950
|
|
|
951
951
|
|
|
952
|
-
32
|
|
953
952
|
33
|
|
954
|
-
34
|
|
953
|
+
34
|
|
954
|
+
35</pre>
|
|
955
955
|
</td>
|
|
956
956
|
<td>
|
|
957
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
|
957
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 33</span>
|
|
958
958
|
|
|
959
959
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span>
|
|
960
960
|
<span class='op'>::</span><span class='const'>Lazier</span><span class='op'>::</span><span class='const'>Settings</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
|
|
@@ -969,9 +969,9 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
969
969
|
</div>
|
|
970
970
|
|
|
971
971
|
<div id="footer">
|
|
972
|
-
Generated on
|
|
972
|
+
Generated on Sun Jul 14 13:32:00 2013 by
|
|
973
973
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
974
|
-
0.8.6.
|
|
974
|
+
0.8.6.2 (ruby-1.9.3).
|
|
975
975
|
</div>
|
|
976
976
|
|
|
977
977
|
</body>
|
data/doc/Lazier/Boolean.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>
|
|
7
7
|
Module: Lazier::Boolean
|
|
8
8
|
|
|
9
|
-
— Documentation by YARD 0.8.6.
|
|
9
|
+
— Documentation by YARD 0.8.6.2
|
|
10
10
|
|
|
11
11
|
</title>
|
|
12
12
|
|
|
@@ -288,9 +288,9 @@
|
|
|
288
288
|
</div>
|
|
289
289
|
|
|
290
290
|
<div id="footer">
|
|
291
|
-
Generated on
|
|
291
|
+
Generated on Sun Jul 14 13:32:00 2013 by
|
|
292
292
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
293
|
-
0.8.6.
|
|
293
|
+
0.8.6.2 (ruby-1.9.3).
|
|
294
294
|
</div>
|
|
295
295
|
|
|
296
296
|
</body>
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
<title>
|
|
7
|
+
Class: Lazier::Configuration
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.8.6.2
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
|
19
|
+
relpath = '../';
|
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
25
|
+
|
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
</head>
|
|
30
|
+
<body>
|
|
31
|
+
<div id="header">
|
|
32
|
+
<div id="menu">
|
|
33
|
+
|
|
34
|
+
<a href="../_index.html">Index (C)</a> »
|
|
35
|
+
<span class='title'><span class='object_link'><a href="../Lazier.html" title="Lazier (module)">Lazier</a></span></span>
|
|
36
|
+
»
|
|
37
|
+
<span class="title">Configuration</span>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div id="search">
|
|
44
|
+
|
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
|
46
|
+
href="../class_list.html">
|
|
47
|
+
Class List
|
|
48
|
+
</a>
|
|
49
|
+
|
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
|
51
|
+
href="../method_list.html">
|
|
52
|
+
Method List
|
|
53
|
+
</a>
|
|
54
|
+
|
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
|
56
|
+
href="../file_list.html">
|
|
57
|
+
File List
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<iframe id="search_frame"></iframe>
|
|
65
|
+
|
|
66
|
+
<div id="content"><h1>Class: Lazier::Configuration
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</h1>
|
|
71
|
+
|
|
72
|
+
<dl class="box">
|
|
73
|
+
|
|
74
|
+
<dt class="r1">Inherits:</dt>
|
|
75
|
+
<dd class="r1">
|
|
76
|
+
<span class="inheritName">Hashie::Dash</span>
|
|
77
|
+
|
|
78
|
+
<ul class="fullTree">
|
|
79
|
+
<li>Object</li>
|
|
80
|
+
|
|
81
|
+
<li class="next">Hashie::Dash</li>
|
|
82
|
+
|
|
83
|
+
<li class="next">Lazier::Configuration</li>
|
|
84
|
+
|
|
85
|
+
</ul>
|
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
87
|
+
|
|
88
|
+
</dd>
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
<dt class="r2">Includes:</dt>
|
|
96
|
+
<dd class="r2"><span class='object_link'><a href="I18n.html" title="Lazier::I18n (module)">I18n</a></span></dd>
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
<dt class="r1 last">Defined in:</dt>
|
|
103
|
+
<dd class="r1 last">lib/lazier/configuration.rb</dd>
|
|
104
|
+
|
|
105
|
+
</dl>
|
|
106
|
+
<div class="clear"></div>
|
|
107
|
+
|
|
108
|
+
<h2>Overview</h2><div class="docstring">
|
|
109
|
+
<div class="discussion">
|
|
110
|
+
<p>A configuration class to set properties.</p>
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="tags">
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
<h2>Instance Attribute Summary</h2>
|
|
125
|
+
|
|
126
|
+
<h3 class="inherited">Attributes included from <span class='object_link'><a href="I18n.html" title="Lazier::I18n (module)">I18n</a></span></h3>
|
|
127
|
+
<p class="inherited"><span class='object_link'><a href="I18n.html#i18n_locale-instance_method" title="Lazier::I18n#i18n_locale (method)">#i18n_locale</a></span>, <span class='object_link'><a href="I18n.html#i18n_locales_path-instance_method" title="Lazier::I18n#i18n_locales_path (method)">#i18n_locales_path</a></span>, <span class='object_link'><a href="I18n.html#i18n_root-instance_method" title="Lazier::I18n#i18n_root (method)">#i18n_root</a></span></p>
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
<h2>
|
|
132
|
+
Class Method Summary
|
|
133
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
134
|
+
</h2>
|
|
135
|
+
|
|
136
|
+
<ul class="summary">
|
|
137
|
+
|
|
138
|
+
<li class="public ">
|
|
139
|
+
<span class="summary_signature">
|
|
140
|
+
|
|
141
|
+
<a href="#property-class_method" title="property (class method)">+ (Object) <strong>property</strong>(property_name, options = {}) </a>
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
</span>
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
<span class="summary_desc"><div class='inline'><p>Defines a property on the configuration.</p>
|
|
156
|
+
</div></span>
|
|
157
|
+
|
|
158
|
+
</li>
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
</ul>
|
|
162
|
+
|
|
163
|
+
<h2>
|
|
164
|
+
Instance Method Summary
|
|
165
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
166
|
+
</h2>
|
|
167
|
+
|
|
168
|
+
<ul class="summary">
|
|
169
|
+
|
|
170
|
+
<li class="public ">
|
|
171
|
+
<span class="summary_signature">
|
|
172
|
+
|
|
173
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Configuration) <strong>initialize</strong>(attributes = {}, &block) </a>
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
</span>
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
<span class="note title constructor">constructor</span>
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
<span class="summary_desc"><div class='inline'><p>Initializes a new configuration object.</p>
|
|
190
|
+
</div></span>
|
|
191
|
+
|
|
192
|
+
</li>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
</ul>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="I18n.html" title="Lazier::I18n (module)">I18n</a></span></h3>
|
|
208
|
+
<p class="inherited"><span class='object_link'><a href="I18n.html#i18n-instance_method" title="Lazier::I18n#i18n (method)">#i18n</a></span>, <span class='object_link'><a href="I18n.html#i18n%3D-instance_method" title="Lazier::I18n#i18n= (method)">#i18n=</a></span>, <span class='object_link'><a href="I18n.html#i18n_setup-instance_method" title="Lazier::I18n#i18n_setup (method)">#i18n_setup</a></span></p>
|
|
209
|
+
|
|
210
|
+
<div id="constructor_details" class="method_details_list">
|
|
211
|
+
<h2>Constructor Details</h2>
|
|
212
|
+
|
|
213
|
+
<div class="method_details first">
|
|
214
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
215
|
+
|
|
216
|
+
- (<tt><span class='object_link'><a href="" title="Lazier::Configuration (class)">Configuration</a></span></tt>) <strong>initialize</strong>(attributes = {}, &block)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
</h3><div class="docstring">
|
|
223
|
+
<div class="discussion">
|
|
224
|
+
<p>Initializes a new configuration object.</p>
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
<div class="tags">
|
|
230
|
+
<p class="tag_title">Parameters:</p>
|
|
231
|
+
<ul class="param">
|
|
232
|
+
|
|
233
|
+
<li>
|
|
234
|
+
|
|
235
|
+
<span class='name'>attributes</span>
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
<span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>)</span>
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
—
|
|
245
|
+
<div class='inline'><p>The initial values of properties of this configuration.</p>
|
|
246
|
+
</div>
|
|
247
|
+
|
|
248
|
+
</li>
|
|
249
|
+
|
|
250
|
+
</ul>
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
</div><table class="source_code">
|
|
254
|
+
<tr>
|
|
255
|
+
<td>
|
|
256
|
+
<pre class="lines">
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
15
|
|
260
|
+
16
|
|
261
|
+
17
|
|
262
|
+
18</pre>
|
|
263
|
+
</td>
|
|
264
|
+
<td>
|
|
265
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/configuration.rb', line 15</span>
|
|
266
|
+
|
|
267
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_attributes'>attributes</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
268
|
+
<span class='id identifier rubyid_i18n_setup'>i18n_setup</span><span class='lparen'>(</span><span class='symbol'>:lazier</span><span class='comma'>,</span> <span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_absolute_path'>absolute_path</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Pathname</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span><span class='kw'>__FILE__</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/../../locales/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
269
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_attributes'>attributes</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
270
|
+
<span class='kw'>end</span></pre>
|
|
271
|
+
</td>
|
|
272
|
+
</tr>
|
|
273
|
+
</table>
|
|
274
|
+
</div>
|
|
275
|
+
|
|
276
|
+
</div>
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
<div id="class_method_details" class="method_details_list">
|
|
280
|
+
<h2>Class Method Details</h2>
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
<div class="method_details first">
|
|
284
|
+
<h3 class="signature first" id="property-class_method">
|
|
285
|
+
|
|
286
|
+
+ (<tt><span class='object_link'><a href="Object.html" title="Lazier::Object (module)">Object</a></span></tt>) <strong>property</strong>(property_name, options = {})
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
</h3><div class="docstring">
|
|
293
|
+
<div class="discussion">
|
|
294
|
+
<p>Defines a property on the configuration.
|
|
295
|
+
Options are as follows:</p>
|
|
296
|
+
|
|
297
|
+
<ul>
|
|
298
|
+
<li>:default - Specify a default value for this property.</li>
|
|
299
|
+
<li>:required - Specify the value as required for this property, to raise an error if a value is unset in a new or existing configuration.</li>
|
|
300
|
+
<li>:readonly - Specify if the property is readonly, which means that it can only defined during creation of the configuration.</li>
|
|
301
|
+
</ul>
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
<div class="tags">
|
|
307
|
+
<p class="tag_title">Parameters:</p>
|
|
308
|
+
<ul class="param">
|
|
309
|
+
|
|
310
|
+
<li>
|
|
311
|
+
|
|
312
|
+
<span class='name'>property_name</span>
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span>|Symbol</tt>)</span>
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
—
|
|
320
|
+
<div class='inline'><p>The new property name.</p>
|
|
321
|
+
</div>
|
|
322
|
+
|
|
323
|
+
</li>
|
|
324
|
+
|
|
325
|
+
<li>
|
|
326
|
+
|
|
327
|
+
<span class='name'>options</span>
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
<span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>)</span>
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
—
|
|
337
|
+
<div class='inline'><p>The options for the property.</p>
|
|
338
|
+
</div>
|
|
339
|
+
|
|
340
|
+
</li>
|
|
341
|
+
|
|
342
|
+
</ul>
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
</div><table class="source_code">
|
|
346
|
+
<tr>
|
|
347
|
+
<td>
|
|
348
|
+
<pre class="lines">
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
29
|
|
352
|
+
30
|
|
353
|
+
31
|
|
354
|
+
32
|
|
355
|
+
33
|
|
356
|
+
34
|
|
357
|
+
35
|
|
358
|
+
36
|
|
359
|
+
37
|
|
360
|
+
38
|
|
361
|
+
39</pre>
|
|
362
|
+
</td>
|
|
363
|
+
<td>
|
|
364
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/configuration.rb', line 29</span>
|
|
365
|
+
|
|
366
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_property'>property</span><span class='lparen'>(</span><span class='id identifier rubyid_property_name'>property_name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
367
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_property_name'>property_name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
368
|
+
|
|
369
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:readonly</span><span class='rbracket'>]</span> <span class='kw'>then</span>
|
|
370
|
+
<span class='id identifier rubyid_class_eval'>class_eval</span> <span class='heredoc_beg'><<-ACCESSOR</span>
|
|
371
|
+
<span class='tstring_content'> def </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_property_name'>property_name</span><span class='rbrace'>}</span><span class='tstring_content'>=(_)
|
|
372
|
+
raise ArgumentError.new(i18n.configuration.readonly("</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_property_name'>property_name</span><span class='rbrace'>}</span><span class='tstring_content'>", "</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>"))
|
|
373
|
+
end
|
|
374
|
+
</span><span class='heredoc_end'> ACCESSOR
|
|
375
|
+
</span> <span class='kw'>end</span>
|
|
376
|
+
<span class='kw'>end</span></pre>
|
|
377
|
+
</td>
|
|
378
|
+
</tr>
|
|
379
|
+
</table>
|
|
380
|
+
</div>
|
|
381
|
+
|
|
382
|
+
</div>
|
|
383
|
+
|
|
384
|
+
</div>
|
|
385
|
+
|
|
386
|
+
<div id="footer">
|
|
387
|
+
Generated on Sun Jul 14 13:32:02 2013 by
|
|
388
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
389
|
+
0.8.6.2 (ruby-1.9.3).
|
|
390
|
+
</div>
|
|
391
|
+
|
|
392
|
+
</body>
|
|
393
|
+
</html>
|