lazier 4.0.6 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5d481e8bd9cdd8693a72d52fb2511aceb4dd5db
4
- data.tar.gz: 193b2ae20ea19e1eb29f65c2a4ada418b1cc4ff5
3
+ metadata.gz: 277583fb9b09fef0d3a4dc69aa24e5e5249635c1
4
+ data.tar.gz: 42ff9e00f10b055f440966b472d526414e0bcca7
5
5
  SHA512:
6
- metadata.gz: 9fd71ebea9d562cc6db18b3b3e636e7b49c22d9d2c33a971b5eed05c884e922c1b7df2f107a6653d32ae54fc1632c585a4654bf99490a8381f3385ac456f46af
7
- data.tar.gz: fbc89a2e2d3348e4efcbc8eb92c51078f71d3472dcae49525c2412a3bc8ee31f0da6a3eb238396d7dfb95b7ddb98a6b8aff3da5dc520986c526b358f28c362ca
6
+ metadata.gz: a390fe4c68ecac659ca9a95338027753d985f31c5bee642c674b4a11aa71985a2d67d5151ce4e04215ea20086e1d3761f5716a64f1bb3cd28c222a8a7fe3a204
7
+ data.tar.gz: 8d55abd0bf5882c08b7fa9e7ea050047fb3d24adf970485d8dcbfcd3b31b15a9b1bb5067bf1254697f4238e0d1d923425e0a3883bd56ca99b59f7733d1de2c91
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 4.1.0 / 2014-10-02
2
+
3
+ * Added `Lazier.loaded_modules` and `Lazier.modules_loaded?`.
4
+
1
5
  ### 4.0.6 / 2014-09-29
2
6
 
3
7
  * Include fallback mechanism for translations lookup.
data/doc/Lazier.html CHANGED
@@ -373,6 +373,52 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
373
373
  <span class="summary_desc"><div class='inline'><p>Loads String extensions.</p>
374
374
  </div></span>
375
375
 
376
+ </li>
377
+
378
+
379
+ <li class="public ">
380
+ <span class="summary_signature">
381
+
382
+ <a href="#loaded_modules-class_method" title="loaded_modules (class method)">+ (Array) <strong>loaded_modules</strong> </a>
383
+
384
+
385
+
386
+ </span>
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+ <span class="summary_desc"><div class='inline'><p>Returns the list of loaded Lazier modules.</p>
397
+ </div></span>
398
+
399
+ </li>
400
+
401
+
402
+ <li class="public ">
403
+ <span class="summary_signature">
404
+
405
+ <a href="#modules_loaded%3F-class_method" title="modules_loaded? (class method)">+ (Boolean) <strong>modules_loaded?</strong>(*modules) </a>
406
+
407
+
408
+
409
+ </span>
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+ <span class="summary_desc"><div class='inline'><p>Checks if <em>all</em> of the specified modules have been loaded.</p>
420
+ </div></span>
421
+
376
422
  </li>
377
423
 
378
424
 
@@ -523,13 +569,13 @@ otherwise the duration alone as a number.</p>
523
569
  <pre class="lines">
524
570
 
525
571
 
526
- 146
527
- 147
528
- 148
529
- 149</pre>
572
+ 160
573
+ 161
574
+ 162
575
+ 163</pre>
530
576
  </td>
531
577
  <td>
532
- <pre class="code"><span class="info file"># File 'lib/lazier.rb', line 146</span>
578
+ <pre class="code"><span class="info file"># File 'lib/lazier.rb', line 160</span>
533
579
 
534
580
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_benchmark'>benchmark</span><span class='lparen'>(</span><span class='label'>message:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>precision:</span> <span class='int'>0</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
535
581
  <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='const'>Benchmark</span><span class='period'>.</span><span class='id identifier rubyid_ms'>ms</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
@@ -636,18 +682,18 @@ Otherwise the class of the object will returned.</p>
636
682
  <pre class="lines">
637
683
 
638
684
 
639
- 129
640
- 130
641
- 131
642
- 132
643
- 133
644
- 134
645
- 135
646
- 136
647
- 137</pre>
685
+ 143
686
+ 144
687
+ 145
688
+ 146
689
+ 147
690
+ 148
691
+ 149
692
+ 150
693
+ 151</pre>
648
694
  </td>
649
695
  <td>
650
- <pre class="code"><span class="info file"># File 'lib/lazier.rb', line 129</span>
696
+ <pre class="code"><span class="info file"># File 'lib/lazier.rb', line 143</span>
651
697
 
652
698
  <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'>&quot;</span><span class='tstring_content'>::@</span><span class='tstring_end'>&quot;</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>
653
699
  <span class='kw'>if</span> <span class='lbracket'>[</span><span class='op'>::</span><span class='const'>String</span><span class='comma'>,</span> <span class='op'>::</span><span class='const'>Symbol</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_cls'>cls</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rparen'>)</span>
@@ -1080,6 +1126,120 @@ Otherwise the class of the object will returned.</p>
1080
1126
  </td>
1081
1127
  </tr>
1082
1128
  </table>
1129
+ </div>
1130
+
1131
+ <div class="method_details ">
1132
+ <h3 class="signature " id="loaded_modules-class_method">
1133
+
1134
+ + (<tt>Array</tt>) <strong>loaded_modules</strong>
1135
+
1136
+
1137
+
1138
+
1139
+
1140
+ </h3><div class="docstring">
1141
+ <div class="discussion">
1142
+ <p>Returns the list of loaded Lazier modules.</p>
1143
+
1144
+
1145
+ </div>
1146
+ </div>
1147
+ <div class="tags">
1148
+
1149
+ <p class="tag_title">Returns:</p>
1150
+ <ul class="return">
1151
+
1152
+ <li>
1153
+
1154
+
1155
+ <span class='type'>(<tt>Array</tt>)</span>
1156
+
1157
+
1158
+
1159
+ &mdash;
1160
+ <div class='inline'><p>The list of loaded Lazier modules.</p>
1161
+ </div>
1162
+
1163
+ </li>
1164
+
1165
+ </ul>
1166
+
1167
+ </div><table class="source_code">
1168
+ <tr>
1169
+ <td>
1170
+ <pre class="lines">
1171
+
1172
+
1173
+ 125
1174
+ 126
1175
+ 127</pre>
1176
+ </td>
1177
+ <td>
1178
+ <pre class="code"><span class="info file"># File 'lib/lazier.rb', line 125</span>
1179
+
1180
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_loaded_modules'>loaded_modules</span>
1181
+ <span class='ivar'>@loaded</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1182
+ <span class='kw'>end</span></pre>
1183
+ </td>
1184
+ </tr>
1185
+ </table>
1186
+ </div>
1187
+
1188
+ <div class="method_details ">
1189
+ <h3 class="signature " id="modules_loaded?-class_method">
1190
+
1191
+ + (<tt><span class='object_link'><a href="Lazier/Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>) <strong>modules_loaded?</strong>(*modules)
1192
+
1193
+
1194
+
1195
+
1196
+
1197
+ </h3><div class="docstring">
1198
+ <div class="discussion">
1199
+ <p>Checks if <em>all</em> of the specified modules have been loaded.</p>
1200
+
1201
+
1202
+ </div>
1203
+ </div>
1204
+ <div class="tags">
1205
+
1206
+ <p class="tag_title">Returns:</p>
1207
+ <ul class="return">
1208
+
1209
+ <li>
1210
+
1211
+
1212
+ <span class='type'>(<tt><span class='object_link'><a href="Lazier/Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
1213
+
1214
+
1215
+
1216
+ &mdash;
1217
+ <div class='inline'><p><code>true</code> if the <em>all</em> of the specified modules has already been loaded, <code>false</code> otherwise.</p>
1218
+ </div>
1219
+
1220
+ </li>
1221
+
1222
+ </ul>
1223
+
1224
+ </div><table class="source_code">
1225
+ <tr>
1226
+ <td>
1227
+ <pre class="lines">
1228
+
1229
+
1230
+ 132
1231
+ 133
1232
+ 134</pre>
1233
+ </td>
1234
+ <td>
1235
+ <pre class="code"><span class="info file"># File 'lib/lazier.rb', line 132</span>
1236
+
1237
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_modules_loaded?'>modules_loaded?</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_modules'>modules</span><span class='rparen'>)</span>
1238
+ <span class='lparen'>(</span><span class='id identifier rubyid_modules'>modules</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:to_sym</span><span class='rparen'>)</span> <span class='op'>-</span> <span class='ivar'>@loaded</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span>
1239
+ <span class='kw'>end</span></pre>
1240
+ </td>
1241
+ </tr>
1242
+ </table>
1083
1243
  </div>
1084
1244
 
1085
1245
  <div class="method_details ">
@@ -1137,20 +1297,20 @@ Otherwise the class of the object will returned.</p>
1137
1297
  <pre class="lines">
1138
1298
 
1139
1299
 
1140
- 155
1141
- 156
1142
- 157
1143
- 158
1144
- 159
1145
- 160
1146
- 161
1147
- 162
1148
- 163
1149
- 164
1150
- 165</pre>
1300
+ 169
1301
+ 170
1302
+ 171
1303
+ 172
1304
+ 173
1305
+ 174
1306
+ 175
1307
+ 176
1308
+ 177
1309
+ 178
1310
+ 179</pre>
1151
1311
  </td>
1152
1312
  <td>
1153
- <pre class="code"><span class="info file"># File 'lib/lazier.rb', line 155</span>
1313
+ <pre class="code"><span class="info file"># File 'lib/lazier.rb', line 169</span>
1154
1314
 
1155
1315
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_platform'>platform</span><span class='lparen'>(</span><span class='id identifier rubyid_force'>force</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
1156
1316
  <span class='ivar'>@platform</span> <span class='op'>=</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_force'>force</span>
@@ -1230,7 +1390,7 @@ Otherwise the class of the object will returned.</p>
1230
1390
  </div>
1231
1391
 
1232
1392
  <div id="footer">
1233
- Generated on Mon Sep 29 16:27:06 2014 by
1393
+ Generated on Thu Oct 2 10:38:44 2014 by
1234
1394
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1235
1395
  0.8.7.4 (ruby-2.1.3).
1236
1396
  </div>
@@ -288,7 +288,7 @@
288
288
  </div>
289
289
 
290
290
  <div id="footer">
291
- Generated on Mon Sep 29 16:27:06 2014 by
291
+ Generated on Thu Oct 2 10:38:44 2014 by
292
292
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
293
293
  0.8.7.4 (ruby-2.1.3).
294
294
  </div>
@@ -360,7 +360,7 @@ Options are as follows:</p>
360
360
  </div>
361
361
 
362
362
  <div id="footer">
363
- Generated on Mon Sep 29 16:27:07 2014 by
363
+ Generated on Thu Oct 2 10:38:45 2014 by
364
364
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
365
365
  0.8.7.4 (ruby-2.1.3).
366
366
  </div>
@@ -466,7 +466,7 @@ DateTime.civil(2013, 6, 1).in_months(2011)
466
466
  </div>
467
467
 
468
468
  <div id="footer">
469
- Generated on Mon Sep 29 16:27:06 2014 by
469
+ Generated on Thu Oct 2 10:38:44 2014 by
470
470
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
471
471
  0.8.7.4 (ruby-2.1.3).
472
472
  </div>
@@ -864,7 +864,7 @@ Date.years(1, true, 2010, true)
864
864
  </div>
865
865
 
866
866
  <div id="footer">
867
- Generated on Mon Sep 29 16:27:06 2014 by
867
+ Generated on Thu Oct 2 10:38:44 2014 by
868
868
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
869
869
  0.8.7.4 (ruby-2.1.3).
870
870
  </div>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Mon Sep 29 16:27:06 2014 by
119
+ Generated on Thu Oct 2 10:38:44 2014 by
120
120
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
121
  0.8.7.4 (ruby-2.1.3).
122
122
  </div>
@@ -124,7 +124,7 @@
124
124
  </div>
125
125
 
126
126
  <div id="footer">
127
- Generated on Mon Sep 29 16:27:07 2014 by
127
+ Generated on Thu Oct 2 10:38:44 2014 by
128
128
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
129
129
  0.8.7.4 (ruby-2.1.3).
130
130
  </div>
@@ -242,7 +242,7 @@
242
242
  </div>
243
243
 
244
244
  <div id="footer">
245
- Generated on Mon Sep 29 16:27:07 2014 by
245
+ Generated on Thu Oct 2 10:38:44 2014 by
246
246
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
247
247
  0.8.7.4 (ruby-2.1.3).
248
248
  </div>
@@ -204,7 +204,7 @@
204
204
  </div>
205
205
 
206
206
  <div id="footer">
207
- Generated on Mon Sep 29 16:27:07 2014 by
207
+ Generated on Thu Oct 2 10:38:44 2014 by
208
208
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
209
209
  0.8.7.4 (ruby-2.1.3).
210
210
  </div>
data/doc/Lazier/Hash.html CHANGED
@@ -552,7 +552,7 @@
552
552
  </div>
553
553
 
554
554
  <div id="footer">
555
- Generated on Mon Sep 29 16:27:06 2014 by
555
+ Generated on Thu Oct 2 10:38:44 2014 by
556
556
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
557
557
  0.8.7.4 (ruby-2.1.3).
558
558
  </div>
data/doc/Lazier/I18n.html CHANGED
@@ -2567,7 +2567,7 @@
2567
2567
  </div>
2568
2568
 
2569
2569
  <div id="footer">
2570
- Generated on Mon Sep 29 16:27:06 2014 by
2570
+ Generated on Thu Oct 2 10:38:44 2014 by
2571
2571
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2572
2572
  0.8.7.4 (ruby-2.1.3).
2573
2573
  </div>
data/doc/Lazier/Math.html CHANGED
@@ -121,7 +121,7 @@
121
121
  </div>
122
122
 
123
123
  <div id="footer">
124
- Generated on Mon Sep 29 16:27:06 2014 by
124
+ Generated on Thu Oct 2 10:38:44 2014 by
125
125
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
126
126
  0.8.7.4 (ruby-2.1.3).
127
127
  </div>
@@ -321,7 +321,7 @@
321
321
  </div>
322
322
 
323
323
  <div id="footer">
324
- Generated on Mon Sep 29 16:27:06 2014 by
324
+ Generated on Thu Oct 2 10:38:44 2014 by
325
325
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
326
326
  0.8.7.4 (ruby-2.1.3).
327
327
  </div>
@@ -2331,7 +2331,7 @@ Passing <code>nil</code> is equal to pass an empty Hash.</p>
2331
2331
  </div>
2332
2332
 
2333
2333
  <div id="footer">
2334
- Generated on Mon Sep 29 16:27:06 2014 by
2334
+ Generated on Thu Oct 2 10:38:44 2014 by
2335
2335
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2336
2336
  0.8.7.4 (ruby-2.1.3).
2337
2337
  </div>
@@ -213,7 +213,7 @@ Pathname.new("/usr/bin/ruby").components
213
213
  </div>
214
214
 
215
215
  <div id="footer">
216
- Generated on Mon Sep 29 16:27:06 2014 by
216
+ Generated on Thu Oct 2 10:38:44 2014 by
217
217
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
218
218
  0.8.7.4 (ruby-2.1.3).
219
219
  </div>
@@ -2413,7 +2413,7 @@
2413
2413
  </div>
2414
2414
 
2415
2415
  <div id="footer">
2416
- Generated on Mon Sep 29 16:27:07 2014 by
2416
+ Generated on Thu Oct 2 10:38:44 2014 by
2417
2417
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2418
2418
  0.8.7.4 (ruby-2.1.3).
2419
2419
  </div>
@@ -563,7 +563,7 @@
563
563
  </div>
564
564
 
565
565
  <div id="footer">
566
- Generated on Mon Sep 29 16:27:06 2014 by
566
+ Generated on Thu Oct 2 10:38:44 2014 by
567
567
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
568
568
  0.8.7.4 (ruby-2.1.3).
569
569
  </div>
@@ -1322,7 +1322,7 @@
1322
1322
  </div>
1323
1323
 
1324
1324
  <div id="footer">
1325
- Generated on Mon Sep 29 16:27:06 2014 by
1325
+ Generated on Thu Oct 2 10:38:44 2014 by
1326
1326
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1327
1327
  0.8.7.4 (ruby-2.1.3).
1328
1328
  </div>
@@ -1005,7 +1005,7 @@ Returns an offset in rational value.</p>
1005
1005
  </div>
1006
1006
 
1007
1007
  <div id="footer">
1008
- Generated on Mon Sep 29 16:27:06 2014 by
1008
+ Generated on Thu Oct 2 10:38:44 2014 by
1009
1009
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1010
1010
  0.8.7.4 (ruby-2.1.3).
1011
1011
  </div>
@@ -134,7 +134,7 @@
134
134
 
135
135
  </div>
136
136
  </dt>
137
- <dd><pre class="code"><span class='int'>0</span></pre></dd>
137
+ <dd><pre class="code"><span class='int'>1</span></pre></dd>
138
138
 
139
139
  <dt id="PATCH-constant" class="">PATCH =
140
140
  <div class="docstring">
@@ -149,7 +149,7 @@
149
149
 
150
150
  </div>
151
151
  </dt>
152
- <dd><pre class="code"><span class='int'>6</span></pre></dd>
152
+ <dd><pre class="code"><span class='int'>0</span></pre></dd>
153
153
 
154
154
  <dt id="STRING-constant" class="">STRING =
155
155
  <div class="docstring">
@@ -180,7 +180,7 @@
180
180
  </div>
181
181
 
182
182
  <div id="footer">
183
- Generated on Mon Sep 29 16:27:06 2014 by
183
+ Generated on Thu Oct 2 10:38:44 2014 by
184
184
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
185
185
  0.8.7.4 (ruby-2.1.3).
186
186
  </div>
data/doc/_index.html CHANGED
@@ -333,7 +333,7 @@
333
333
  </div>
334
334
 
335
335
  <div id="footer">
336
- Generated on Mon Sep 29 16:27:06 2014 by
336
+ Generated on Thu Oct 2 10:38:44 2014 by
337
337
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
338
338
  0.8.7.4 (ruby-2.1.3).
339
339
  </div>
data/doc/file.README.html CHANGED
@@ -110,7 +110,7 @@ See documentation for more informations.</p>
110
110
  </div></div>
111
111
 
112
112
  <div id="footer">
113
- Generated on Mon Sep 29 16:27:06 2014 by
113
+ Generated on Thu Oct 2 10:38:44 2014 by
114
114
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
115
115
  0.8.7.4 (ruby-2.1.3).
116
116
  </div>
data/doc/index.html CHANGED
@@ -110,7 +110,7 @@ See documentation for more informations.</p>
110
110
  </div></div>
111
111
 
112
112
  <div id="footer">
113
- Generated on Mon Sep 29 16:27:06 2014 by
113
+ Generated on Thu Oct 2 10:38:44 2014 by
114
114
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
115
115
  0.8.7.4 (ruby-2.1.3).
116
116
  </div>
data/doc/method_list.html CHANGED
@@ -276,8 +276,8 @@
276
276
 
277
277
 
278
278
  <li class="r1 ">
279
- <span class='object_link'><a href="Lazier/Configuration.html#initialize-instance_method" title="Lazier::Configuration#initialize (method)">#initialize</a></span>
280
- <small>Lazier::Configuration</small>
279
+ <span class='object_link'><a href="Lazier/Settings.html#initialize-instance_method" title="Lazier::Settings#initialize (method)">#initialize</a></span>
280
+ <small>Lazier::Settings</small>
281
281
  </li>
282
282
 
283
283
 
@@ -288,14 +288,14 @@
288
288
 
289
289
 
290
290
  <li class="r1 ">
291
- <span class='object_link'><a href="Lazier/I18n.html#initialize-instance_method" title="Lazier::I18n#initialize (method)">#initialize</a></span>
292
- <small>Lazier::I18n</small>
291
+ <span class='object_link'><a href="Lazier/Configuration.html#initialize-instance_method" title="Lazier::Configuration#initialize (method)">#initialize</a></span>
292
+ <small>Lazier::Configuration</small>
293
293
  </li>
294
294
 
295
295
 
296
296
  <li class="r2 ">
297
- <span class='object_link'><a href="Lazier/Settings.html#initialize-instance_method" title="Lazier::Settings#initialize (method)">#initialize</a></span>
298
- <small>Lazier::Settings</small>
297
+ <span class='object_link'><a href="Lazier/I18n.html#initialize-instance_method" title="Lazier::I18n#initialize (method)">#initialize</a></span>
298
+ <small>Lazier::I18n</small>
299
299
  </li>
300
300
 
301
301
 
@@ -372,29 +372,41 @@
372
372
 
373
373
 
374
374
  <li class="r1 ">
375
+ <span class='object_link'><a href="Lazier.html#loaded_modules-class_method" title="Lazier.loaded_modules (method)">loaded_modules</a></span>
376
+ <small>Lazier</small>
377
+ </li>
378
+
379
+
380
+ <li class="r2 ">
375
381
  <span class='object_link'><a href="Lazier/I18n.html#locale-instance_method" title="Lazier::I18n#locale (method)">#locale</a></span>
376
382
  <small>Lazier::I18n</small>
377
383
  </li>
378
384
 
379
385
 
380
- <li class="r2 ">
386
+ <li class="r1 ">
381
387
  <span class='object_link'><a href="Lazier/I18n.html#locales-instance_method" title="Lazier::I18n#locales (method)">#locales</a></span>
382
388
  <small>Lazier::I18n</small>
383
389
  </li>
384
390
 
385
391
 
386
- <li class="r1 ">
392
+ <li class="r2 ">
387
393
  <span class='object_link'><a href="Lazier/Math/ClassMethods.html#max-instance_method" title="Lazier::Math::ClassMethods#max (method)">#max</a></span>
388
394
  <small>Lazier::Math::ClassMethods</small>
389
395
  </li>
390
396
 
391
397
 
392
- <li class="r2 ">
398
+ <li class="r1 ">
393
399
  <span class='object_link'><a href="Lazier/Math/ClassMethods.html#min-instance_method" title="Lazier::Math::ClassMethods#min (method)">#min</a></span>
394
400
  <small>Lazier::Math::ClassMethods</small>
395
401
  </li>
396
402
 
397
403
 
404
+ <li class="r2 ">
405
+ <span class='object_link'><a href="Lazier.html#modules_loaded%3F-class_method" title="Lazier.modules_loaded? (method)">modules_loaded?</a></span>
406
+ <small>Lazier</small>
407
+ </li>
408
+
409
+
398
410
  <li class="r1 ">
399
411
  <span class='object_link'><a href="Lazier/DateTime/ClassMethods.html#months-instance_method" title="Lazier::DateTime::ClassMethods#months (method)">#months</a></span>
400
412
  <small>Lazier::DateTime::ClassMethods</small>
@@ -103,7 +103,7 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Mon Sep 29 16:27:06 2014 by
106
+ Generated on Thu Oct 2 10:38:44 2014 by
107
107
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
108
  0.8.7.4 (ruby-2.1.3).
109
109
  </div>
data/lazier.gemspec CHANGED
@@ -25,7 +25,6 @@ Gem::Specification.new do |gem|
25
25
 
26
26
  gem.required_ruby_version = ">= 2.1"
27
27
 
28
- # TODO@PI: Drop ActiveSupport requirement
29
28
  gem.add_dependency("activesupport", "~> 4.1")
30
29
  gem.add_dependency("hashie", "~> 3.3")
31
30
 
data/lib/lazier.rb CHANGED
@@ -119,6 +119,20 @@ module Lazier
119
119
  perform_load(:pathname, ::Pathname, ::Lazier::Pathname)
120
120
  end
121
121
 
122
+ # Returns the list of loaded Lazier modules.
123
+ #
124
+ # @return [Array] The list of loaded Lazier modules.
125
+ def self.loaded_modules
126
+ @loaded || []
127
+ end
128
+
129
+ # Checks if *all* of the specified modules have been loaded.
130
+ #
131
+ # @return [Boolean] `true` if the *all* of the specified modules has already been loaded, `false` otherwise.
132
+ def self.modules_loaded?(*modules)
133
+ (modules.flatten.uniq.compact.map(&:to_sym) - @loaded).blank?
134
+ end
135
+
122
136
  # Finds a class to instantiate.
123
137
  #
124
138
  # @param cls [Symbol|String|Object] If a `String` or a `Symbol` or a `Class`, then it will be the class to instantiate.
@@ -183,7 +197,6 @@ module Lazier
183
197
  end
184
198
 
185
199
  # :nodoc:
186
- # TODO@PI: On 4.1, make loaded accessible publicly and add a Lazier.loaded? method.
187
200
  def self.perform_load(mod, target = nil, extension = nil, &block)
188
201
  @loaded ||= []
189
202
 
@@ -12,10 +12,10 @@ module Lazier
12
12
  MAJOR = 4
13
13
 
14
14
  # The minor version.
15
- MINOR = 0
15
+ MINOR = 1
16
16
 
17
17
  # The patch version.
18
- PATCH = 6
18
+ PATCH = 0
19
19
 
20
20
  # The current version of lazier.
21
21
  STRING = [MAJOR, MINOR, PATCH].compact.join(".")
data/spec/lazier_spec.rb CHANGED
@@ -42,6 +42,20 @@ describe Lazier do
42
42
  end
43
43
  end
44
44
 
45
+ describe ".loaded" do
46
+ it "should return the list of loaded modules" do
47
+ expect(Lazier.loaded_modules).to eq([:boolean, :object, :string, :hash, :datetime, :math, :pathname])
48
+ end
49
+ end
50
+
51
+ describe ".modules_loaded?" do
52
+ it "should return true if all specified modules are loaded" do
53
+ expect(Lazier.modules_loaded?(:boolean)).to be_truthy
54
+ expect(Lazier.modules_loaded?(:boolean, [:string, "object"])).to be_truthy
55
+ expect(Lazier.modules_loaded?(:boolean, :foo)).to be_falsey
56
+ end
57
+ end
58
+
45
59
  describe ".find_class" do
46
60
  before(:each) do
47
61
  stub_const("::LazierTest::TestClass", Class.new)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazier
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.6
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shogun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-29 00:00:00.000000000 Z
11
+ date: 2014-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport