lazier 3.5.7 → 4.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.
- checksums.yaml +4 -4
- data/.travis-gemfile +5 -4
- data/.travis.yml +2 -2
- data/CHANGELOG.md +65 -8
- data/Gemfile +9 -8
- data/README.md +4 -0
- data/doc/Lazier.html +178 -110
- data/doc/Lazier/Boolean.html +7 -7
- data/doc/Lazier/Configuration.html +24 -50
- data/doc/Lazier/DateTime.html +50 -305
- data/doc/Lazier/DateTime/ClassMethods.html +116 -806
- data/doc/Lazier/Exceptions.html +2 -2
- data/doc/Lazier/Exceptions/Debug.html +1 -1
- data/doc/Lazier/Exceptions/MissingTranslation.html +18 -14
- data/doc/Lazier/Exceptions/TranslationExceptionHandler.html +213 -0
- data/doc/Lazier/Hash.html +19 -155
- data/doc/Lazier/I18n.html +1735 -230
- data/doc/Lazier/Math.html +1 -1
- data/doc/Lazier/Math/ClassMethods.html +13 -13
- data/doc/Lazier/Object.html +353 -339
- data/doc/Lazier/Pathname.html +4 -4
- data/doc/Lazier/Settings.html +150 -304
- data/doc/Lazier/String.html +39 -199
- data/doc/Lazier/TimeZone.html +244 -746
- data/doc/Lazier/TimeZone/ClassMethods.html +109 -127
- data/doc/Lazier/Version.html +4 -4
- data/doc/_index.html +15 -15
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +5 -1
- data/doc/index.html +5 -1
- data/doc/method_list.html +97 -169
- data/doc/top-level-namespace.html +1 -1
- data/lazier.gemspec +9 -6
- data/lib/lazier.rb +41 -50
- data/lib/lazier/boolean.rb +0 -1
- data/lib/lazier/configuration.rb +26 -28
- data/lib/lazier/datetime.rb +33 -127
- data/lib/lazier/exceptions.rb +14 -6
- data/lib/lazier/hash.rb +7 -15
- data/lib/lazier/i18n.rb +130 -48
- data/lib/lazier/math.rb +6 -7
- data/lib/lazier/object.rb +79 -97
- data/lib/lazier/pathname.rb +0 -1
- data/lib/lazier/settings.rb +12 -25
- data/lib/lazier/string.rb +17 -38
- data/lib/lazier/timezone.rb +168 -164
- data/lib/lazier/version.rb +3 -4
- data/locales/en.yml +52 -51
- data/locales/it.yml +51 -50
- data/spec/coverage_helper.rb +0 -1
- data/spec/lazier/boolean_spec.rb +2 -3
- data/spec/lazier/configuration_spec.rb +3 -5
- data/spec/lazier/datetime_spec.rb +34 -95
- data/spec/lazier/exceptions_spec.rb +25 -0
- data/spec/lazier/hash_spec.rb +0 -21
- data/spec/lazier/i18n_spec.rb +135 -51
- data/spec/lazier/math_spec.rb +0 -1
- data/spec/lazier/object_spec.rb +105 -100
- data/spec/lazier/pathname_spec.rb +0 -1
- data/spec/lazier/settings_spec.rb +25 -28
- data/spec/lazier/string_spec.rb +7 -20
- data/spec/lazier/timezone_spec.rb +101 -87
- data/spec/lazier_spec.rb +25 -8
- data/spec/spec_helper.rb +3 -2
- metadata +15 -44
- data/doc/Lazier/Localizer.html +0 -545
- data/lib/lazier/localizer.rb +0 -41
- data/spec/lazier/localizer_spec.rb +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d48944a4e7755dc3bec8db2c4c6901c0b753fbf8
|
4
|
+
data.tar.gz: 7e22f26f1ed087e016226b1ab74e8866a61ce969
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f2c7e57c4b136b1b92bb4357622baf2dfc1a843546ec9077168f8cd72b40acdbb4635fbb1c50f5737e870815e7771bc229aa08905aca66246fad6cd57e9dbe4
|
7
|
+
data.tar.gz: 9423fca454793fbc247cb4be16735ee5fab79c35afc70eaef97515956ebeecefddfeeda6008d2a596e96554e88385024d795e0ec0454b722c5bca4e2667a09fb
|
data/.travis-gemfile
CHANGED
@@ -9,7 +9,8 @@ source "http://rubygems.org"
|
|
9
9
|
gemspec
|
10
10
|
|
11
11
|
# Testing
|
12
|
-
gem "rspec", "~>
|
13
|
-
gem "
|
14
|
-
gem "
|
15
|
-
gem "
|
12
|
+
gem "rspec", "~> 3.0.0.rc1"
|
13
|
+
gem "rspec-support", github: "rspec/rspec-support" if RUBY_ENGINE == "jruby"
|
14
|
+
gem "rake", "~> 10.3"
|
15
|
+
gem "simplecov", "~> 0.8"
|
16
|
+
gem "coveralls", "~> 0.7", require: false
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,67 @@
|
|
1
|
-
###
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
*
|
1
|
+
### 4.0.0 / 2014-06-01
|
2
|
+
|
3
|
+
#### General
|
4
|
+
* **Dropped compatibility for Ruby < 2.1**.
|
5
|
+
* All `is_*?` are renamed without the prefix.
|
6
|
+
* Moved to i18n as I18N backend for `Lazier::I18n`.
|
7
|
+
* Merged `Lazier::I18n` and `Lazier::Localizer` into a new class `Lazier::I18n`.
|
8
|
+
* Changed interface for `Lazier#find_class`.
|
9
|
+
* Changed interface for `Lazier#benchmark`.
|
10
|
+
* Removed `Lazier.load_hash_method_access`.
|
11
|
+
|
12
|
+
#### Lazier::Configuration
|
13
|
+
|
14
|
+
* Changed parameters name for `Lazier::Configuration#property`.
|
15
|
+
|
16
|
+
#### Lazier::Date
|
17
|
+
|
18
|
+
* Changed interface for `Lazier::Date.years`.
|
19
|
+
* Removed `Lazier::Date.timezones`.
|
20
|
+
* Removed `Lazier::Date.list_timezones`.
|
21
|
+
* Removed `Lazier::Date.find_timezone`.
|
22
|
+
* Removed `Lazier::Date.parameterize_zone`.
|
23
|
+
* Removed `Lazier::Date.unparameterize_zone`.
|
24
|
+
* Removed `Lazier::Date.rationalize_offset`.
|
25
|
+
* Removed `Lazier::Date#utc_time`.
|
26
|
+
* Renamed `Lazier::Date#in_months` to `Lazier::Date.months_since_year`.
|
27
|
+
* Merged `Lazier::Date#lstrftime`, `Lazier::Date#local_strftime` and `Lazier::Date#local_lstrftime` to `Lazier::Date#format`.
|
28
|
+
|
29
|
+
#### Lazier::Object
|
30
|
+
|
31
|
+
* Changed parameters name for `Lazier::Object#ensure_string`.
|
32
|
+
* Changed interface for `Lazier::Object#ensure_array`.
|
33
|
+
* Changed interface for `Lazier::Object#ensure_hash`.
|
34
|
+
* Changed parameters name for `Lazier::Object#to_integer`.
|
35
|
+
* Changed parameters name for `Lazier::Object#to_float`.
|
36
|
+
* Changed interface for `Lazier::Object#format_number`.
|
37
|
+
* Changed interface for `Lazier::Object#format_boolean`.
|
38
|
+
* Changed interface for `Lazier::Object#indexize`.
|
39
|
+
* Renamed `Lazier::Object#numeric?` to `Lazier::Object#number?`.
|
40
|
+
* Renamed `Lazier::Object#for_debug` to `Lazier::Object#to_debug` and changed its interface.
|
41
|
+
* Changed interface for `Lazier::Object#ensure_hash`.
|
42
|
+
|
43
|
+
#### Lazier::Settings
|
44
|
+
|
45
|
+
* Changed interface for `Lazier::Settings#setup_format_number`.
|
46
|
+
* Changed interface for `Lazier::Settings#setup_date_names`.
|
47
|
+
* Removed `Lazier::Settings#i18n=`.
|
48
|
+
|
49
|
+
#### Lazier::String
|
50
|
+
|
51
|
+
* Removed `Lazier::String#untitleize`.
|
52
|
+
* Removed `Lazier::String#replace_ampersands`.
|
53
|
+
* Renamed `Lazier::String#split_token` to `Lazier::String#tokenize` and changed its interface.
|
54
|
+
|
55
|
+
#### Lazier::Timezone
|
56
|
+
|
57
|
+
* Renamed `Lazier::Timezone.list_all` to `Lazier::Timezone.list` and changed its interface.
|
58
|
+
* Renamed `Lazier::Timezone.parameterize_zone` to `Lazier::Timezone.parameterize`.
|
59
|
+
* Renamed `Lazier::Timezone.unparameterize_zone` to `Lazier::Timezone.unparameterize` and changed its interface.
|
60
|
+
* Changed interface for `Lazier::Timezone#current_offset`.
|
61
|
+
* Merged `Lazier::Timezone#dst_offset` and `Lazier::Timezone#offset` in `Lazier::Timezone#offset`.
|
62
|
+
* Merged `Lazier::Timezone#dst_name` in `Lazier::Timezone#name`.
|
63
|
+
* Merged `Lazier::Timezone.to_str`, `Lazier::Timezone.to_str_with_dst`, `Lazier::Timezone.to_str_parameterized` and
|
64
|
+
`Lazier::Timezone.to_str_with_dst_parameterized` in `Lazier::Timezone.to_str`.
|
8
65
|
|
9
66
|
### 3.5.5 / 2014-04-11
|
10
67
|
|
@@ -20,7 +77,7 @@
|
|
20
77
|
|
21
78
|
### 3.5.2 / 2014-04-27
|
22
79
|
|
23
|
-
* Added `Lazier::Object#
|
80
|
+
* Added `Lazier::Object#is_number?`.
|
24
81
|
* Metrics and style fixes.
|
25
82
|
|
26
83
|
### 3.5.1 / 2014-02-16
|
data/Gemfile
CHANGED
@@ -9,13 +9,14 @@ source "http://rubygems.org"
|
|
9
9
|
gemspec
|
10
10
|
|
11
11
|
# Testing
|
12
|
-
gem "rspec", "~>
|
13
|
-
gem "
|
12
|
+
gem "rspec", "~> 3.0.0.rc1"
|
13
|
+
gem "rspec-support", github: "rspec/rspec-support" if RUBY_ENGINE == "jruby"
|
14
|
+
gem "rake", "~> 10.3"
|
14
15
|
|
15
16
|
# Documentation
|
16
|
-
gem "simplecov", "
|
17
|
-
gem "coveralls", "
|
18
|
-
gem "pry", "
|
19
|
-
gem "yard", "
|
20
|
-
gem "kramdown", "
|
21
|
-
gem "github-markup", "
|
17
|
+
gem "simplecov", "~> 0.8"
|
18
|
+
gem "coveralls", "~> 0.7", require: false
|
19
|
+
gem "pry", "~> 0"
|
20
|
+
gem "yard", "~> 0.8"
|
21
|
+
gem "kramdown", "~> 1.3"
|
22
|
+
gem "github-markup", "~> 1.2" if RUBY_ENGINE != "jruby"
|
data/README.md
CHANGED
@@ -23,6 +23,10 @@ Lazier.load!
|
|
23
23
|
That's all!
|
24
24
|
See documentation for more informations.
|
25
25
|
|
26
|
+
## Supported implementations.
|
27
|
+
|
28
|
+
A Ruby 2.1 implementation is required. So far, only MRI supports all Ruby 2.1 requirements.
|
29
|
+
|
26
30
|
## Contributing to lazier
|
27
31
|
|
28
32
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
data/doc/Lazier.html
CHANGED
@@ -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/
|
83
|
+
lib/lazier/i18n.rb,<br /> lib/lazier/hash.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/settings.rb,<br /> lib/lazier/pathname.rb,<br /> lib/lazier/datetime.rb,<br /> lib/lazier/timezone.rb,<br /> lib/lazier/exceptions.rb,<br /> lib/lazier/configuration.rb</span>
|
84
84
|
</dd>
|
85
85
|
|
86
86
|
</dl>
|
@@ -101,15 +101,37 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
101
101
|
<p class="children">
|
102
102
|
|
103
103
|
|
104
|
-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Lazier/Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span>, <span class='object_link'><a href="Lazier/DateTime.html" title="Lazier::DateTime (module)">DateTime</a></span>, <span class='object_link'><a href="Lazier/Exceptions.html" title="Lazier::Exceptions (module)">Exceptions</a></span>, <span class='object_link'><a href="Lazier/Hash.html" title="Lazier::Hash (module)">Hash</a></span>, <span class='object_link'><a href="Lazier/
|
104
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Lazier/Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span>, <span class='object_link'><a href="Lazier/DateTime.html" title="Lazier::DateTime (module)">DateTime</a></span>, <span class='object_link'><a href="Lazier/Exceptions.html" title="Lazier::Exceptions (module)">Exceptions</a></span>, <span class='object_link'><a href="Lazier/Hash.html" title="Lazier::Hash (module)">Hash</a></span>, <span class='object_link'><a href="Lazier/Math.html" title="Lazier::Math (module)">Math</a></span>, <span class='object_link'><a href="Lazier/Object.html" title="Lazier::Object (module)">Object</a></span>, <span class='object_link'><a href="Lazier/Pathname.html" title="Lazier::Pathname (module)">Pathname</a></span>, <span class='object_link'><a href="Lazier/String.html" title="Lazier::String (module)">String</a></span>, <span class='object_link'><a href="Lazier/TimeZone.html" title="Lazier::TimeZone (module)">TimeZone</a></span>, <span class='object_link'><a href="Lazier/Version.html" title="Lazier::Version (module)">Version</a></span>
|
105
105
|
|
106
106
|
|
107
107
|
|
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/
|
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/I18n.html" title="Lazier::I18n (class)">I18n</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>
|
112
112
|
|
113
|
+
<h2>Constant Summary</h2>
|
114
|
+
|
115
|
+
<dl class="constants">
|
116
|
+
|
117
|
+
<dt id="ROOT-constant" class="">ROOT =
|
118
|
+
<div class="docstring">
|
119
|
+
<div class="discussion">
|
120
|
+
<p>The root directory of the library</p>
|
121
|
+
|
122
|
+
|
123
|
+
</div>
|
124
|
+
</div>
|
125
|
+
<div class="tags">
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
</dt>
|
130
|
+
<dd><pre class="code"><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='id identifier rubyid___dir__'>__dir__</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/../</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span></pre></dd>
|
131
|
+
|
132
|
+
</dl>
|
133
|
+
|
134
|
+
|
113
135
|
|
114
136
|
|
115
137
|
|
@@ -127,7 +149,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
127
149
|
<li class="public ">
|
128
150
|
<span class="summary_signature">
|
129
151
|
|
130
|
-
<a href="#benchmark-class_method" title="benchmark (class method)">+ (Float|String) <strong>benchmark</strong>(message
|
152
|
+
<a href="#benchmark-class_method" title="benchmark (class method)">+ (Float|String) <strong>benchmark</strong>(message: nil, precision: 0, &block) </a>
|
131
153
|
|
132
154
|
|
133
155
|
|
@@ -150,7 +172,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
150
172
|
<li class="public ">
|
151
173
|
<span class="summary_signature">
|
152
174
|
|
153
|
-
<a href="#find_class-class_method" title="find_class (class method)">+ (Class) <strong>find_class</strong>(cls, scope = "
|
175
|
+
<a href="#find_class-class_method" title="find_class (class method)">+ (Class) <strong>find_class</strong>(cls, scope = "::@", only_in_scope = false) </a>
|
154
176
|
|
155
177
|
|
156
178
|
|
@@ -265,7 +287,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
265
287
|
<li class="public ">
|
266
288
|
<span class="summary_signature">
|
267
289
|
|
268
|
-
<a href="#
|
290
|
+
<a href="#load_math-class_method" title="load_math (class method)">+ (Object) <strong>load_math</strong> </a>
|
269
291
|
|
270
292
|
|
271
293
|
|
@@ -279,7 +301,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
279
301
|
|
280
302
|
|
281
303
|
|
282
|
-
<span class="summary_desc"><div class='inline'><p>Loads
|
304
|
+
<span class="summary_desc"><div class='inline'><p>Loads Math extensions.</p>
|
283
305
|
</div></span>
|
284
306
|
|
285
307
|
</li>
|
@@ -288,7 +310,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
288
310
|
<li class="public ">
|
289
311
|
<span class="summary_signature">
|
290
312
|
|
291
|
-
<a href="#
|
313
|
+
<a href="#load_object-class_method" title="load_object (class method)">+ (Object) <strong>load_object</strong> </a>
|
292
314
|
|
293
315
|
|
294
316
|
|
@@ -302,7 +324,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
302
324
|
|
303
325
|
|
304
326
|
|
305
|
-
<span class="summary_desc"><div class='inline'><p>Loads
|
327
|
+
<span class="summary_desc"><div class='inline'><p>Loads Object extensions.</p>
|
306
328
|
</div></span>
|
307
329
|
|
308
330
|
</li>
|
@@ -311,7 +333,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
311
333
|
<li class="public ">
|
312
334
|
<span class="summary_signature">
|
313
335
|
|
314
|
-
<a href="#
|
336
|
+
<a href="#load_pathname-class_method" title="load_pathname (class method)">+ (Object) <strong>load_pathname</strong> </a>
|
315
337
|
|
316
338
|
|
317
339
|
|
@@ -325,7 +347,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
325
347
|
|
326
348
|
|
327
349
|
|
328
|
-
<span class="summary_desc"><div class='inline'><p>Loads
|
350
|
+
<span class="summary_desc"><div class='inline'><p>Loads Pathname extensions.</p>
|
329
351
|
</div></span>
|
330
352
|
|
331
353
|
</li>
|
@@ -334,7 +356,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
334
356
|
<li class="public ">
|
335
357
|
<span class="summary_signature">
|
336
358
|
|
337
|
-
<a href="#
|
359
|
+
<a href="#load_string-class_method" title="load_string (class method)">+ (Object) <strong>load_string</strong> </a>
|
338
360
|
|
339
361
|
|
340
362
|
|
@@ -348,7 +370,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
348
370
|
|
349
371
|
|
350
372
|
|
351
|
-
<span class="summary_desc"><div class='inline'><p>Loads
|
373
|
+
<span class="summary_desc"><div class='inline'><p>Loads String extensions.</p>
|
352
374
|
</div></span>
|
353
375
|
|
354
376
|
</li>
|
@@ -357,7 +379,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
357
379
|
<li class="public ">
|
358
380
|
<span class="summary_signature">
|
359
381
|
|
360
|
-
<a href="#
|
382
|
+
<a href="#platform-class_method" title="platform (class method)">+ (Boolean, Symbol) <strong>platform</strong>(force = false) </a>
|
361
383
|
|
362
384
|
|
363
385
|
|
@@ -371,7 +393,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
371
393
|
|
372
394
|
|
373
395
|
|
374
|
-
<span class="summary_desc"><div class='inline'><p>
|
396
|
+
<span class="summary_desc"><div class='inline'><p>Returns which platform are we running on.</p>
|
375
397
|
</div></span>
|
376
398
|
|
377
399
|
</li>
|
@@ -412,7 +434,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
412
434
|
<div class="method_details first">
|
413
435
|
<h3 class="signature first" id="benchmark-class_method">
|
414
436
|
|
415
|
-
+ (<tt>Float|<span class='object_link'><a href="Lazier/String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>benchmark</strong>(message
|
437
|
+
+ (<tt>Float|<span class='object_link'><a href="Lazier/String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>benchmark</strong>(message: nil, precision: 0, &block)
|
416
438
|
|
417
439
|
|
418
440
|
|
@@ -437,8 +459,6 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
437
459
|
<span class='type'>(<tt><span class='object_link'><a href="Lazier/String.html" title="Lazier::String (module)">String</a></span>|NilClass</tt>)</span>
|
438
460
|
|
439
461
|
|
440
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
441
|
-
|
442
462
|
|
443
463
|
—
|
444
464
|
<div class='inline'><p>An optional message (see return value).</p>
|
@@ -454,8 +474,6 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
454
474
|
<span class='type'>(<tt>Fixnum</tt>)</span>
|
455
475
|
|
456
476
|
|
457
|
-
<em class="default">(defaults to: <tt>0</tt>)</em>
|
458
|
-
|
459
477
|
|
460
478
|
—
|
461
479
|
<div class='inline'><p>The precision for the message (see return value)..</p>
|
@@ -505,15 +523,15 @@ otherwise the duration alone as a number.</p>
|
|
505
523
|
<pre class="lines">
|
506
524
|
|
507
525
|
|
526
|
+
139
|
508
527
|
140
|
509
528
|
141
|
510
|
-
142
|
511
|
-
143</pre>
|
529
|
+
142</pre>
|
512
530
|
</td>
|
513
531
|
<td>
|
514
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
532
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 139</span>
|
515
533
|
|
516
|
-
<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='
|
534
|
+
<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'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
517
535
|
<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'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
518
536
|
<span class='id identifier rubyid_message'>message</span> <span class='op'>?</span> <span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%s (%0.</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_precision'>precision</span><span class='embexpr_end'>}</span><span class='tstring_content'>f ms)</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='id identifier rubyid_rv'>rv</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_rv'>rv</span>
|
519
537
|
<span class='kw'>end</span></pre>
|
@@ -525,7 +543,7 @@ otherwise the duration alone as a number.</p>
|
|
525
543
|
<div class="method_details ">
|
526
544
|
<h3 class="signature " id="find_class-class_method">
|
527
545
|
|
528
|
-
+ (<tt>Class</tt>) <strong>find_class</strong>(cls, scope = "
|
546
|
+
+ (<tt>Class</tt>) <strong>find_class</strong>(cls, scope = "::@", only_in_scope = false)
|
529
547
|
|
530
548
|
|
531
549
|
|
@@ -566,11 +584,11 @@ Otherwise the class of the object will returned.</p>
|
|
566
584
|
<span class='type'>(<tt><span class='object_link'><a href="Lazier/String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
567
585
|
|
568
586
|
|
569
|
-
<em class="default">(defaults to: <tt>"
|
587
|
+
<em class="default">(defaults to: <tt>"::@"</tt>)</em>
|
570
588
|
|
571
589
|
|
572
590
|
—
|
573
|
-
<div class='inline'><p>
|
591
|
+
<div class='inline'><p>The scope where to find the class. <code>%CLASS%</code>, <code>%</code>, <code>$</code>, <code>?</code> and <code>@</code> will be substituted with the class name.</p>
|
574
592
|
</div>
|
575
593
|
|
576
594
|
</li>
|
@@ -587,7 +605,7 @@ Otherwise the class of the object will returned.</p>
|
|
587
605
|
|
588
606
|
|
589
607
|
—
|
590
|
-
<div class='inline'><p>If only
|
608
|
+
<div class='inline'><p>If only search inside the scope.</p>
|
591
609
|
</div>
|
592
610
|
|
593
611
|
</li>
|
@@ -618,6 +636,7 @@ Otherwise the class of the object will returned.</p>
|
|
618
636
|
<pre class="lines">
|
619
637
|
|
620
638
|
|
639
|
+
122
|
621
640
|
123
|
622
641
|
124
|
623
642
|
125
|
@@ -625,17 +644,16 @@ Otherwise the class of the object will returned.</p>
|
|
625
644
|
127
|
626
645
|
128
|
627
646
|
129
|
628
|
-
130
|
629
|
-
131</pre>
|
647
|
+
130</pre>
|
630
648
|
</td>
|
631
649
|
<td>
|
632
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
650
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 122</span>
|
633
651
|
|
634
|
-
<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'
|
635
|
-
<span class='kw'>if</span> <span class='
|
636
|
-
<span class='id identifier
|
637
|
-
<span class='id identifier
|
638
|
-
</span>
|
652
|
+
<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'>::@</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>
|
653
|
+
<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>
|
654
|
+
<span class='id identifier rubyid_cls'>cls</span> <span class='op'>=</span> <span class='id identifier rubyid_cls'>cls</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_camelize'>camelize</span>
|
655
|
+
<span class='id identifier rubyid_cls'>cls</span><span class='period'>.</span><span class='id identifier rubyid_gsub!'>gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^::</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_scope'>scope</span> <span class='op'>&&</span> <span class='id identifier rubyid_only_in_scope'>only_in_scope</span>
|
656
|
+
<span class='id identifier rubyid_search_class'>search_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='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'>NameError</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_cls'>cls</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
639
657
|
<span class='kw'>else</span>
|
640
658
|
<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'>Class</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_cls'>cls</span> <span class='op'>:</span> <span class='id identifier rubyid_cls'>cls</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span>
|
641
659
|
<span class='kw'>end</span>
|
@@ -715,20 +733,22 @@ Otherwise the class of the object will returned.</p>
|
|
715
733
|
<pre class="lines">
|
716
734
|
|
717
735
|
|
718
|
-
51
|
719
|
-
52
|
720
736
|
53
|
721
737
|
54
|
722
738
|
55
|
723
739
|
56
|
724
|
-
57
|
740
|
+
57
|
741
|
+
58
|
742
|
+
59
|
743
|
+
60</pre>
|
725
744
|
</td>
|
726
745
|
<td>
|
727
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
746
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 53</span>
|
728
747
|
|
729
748
|
<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>
|
730
|
-
<span class='id identifier
|
731
|
-
<span class='id identifier rubyid_modules'>modules</span
|
749
|
+
<span class='id identifier rubyid_valid_modules'>valid_modules</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='symbol'>:object</span><span class='comma'>,</span> <span class='symbol'>:boolean</span><span class='comma'>,</span> <span class='symbol'>:string</span><span class='comma'>,</span> <span class='symbol'>:hash</span><span class='comma'>,</span> <span class='symbol'>:datetime</span><span class='comma'>,</span> <span class='symbol'>:math</span><span class='comma'>,</span> <span class='symbol'>:pathname</span><span class='rbracket'>]</span>
|
750
|
+
<span class='id identifier rubyid_modules'>modules</span> <span class='op'>=</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='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'>&</span><span class='symbol'>:to_s</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_valid_modules'>valid_modules</span>
|
751
|
+
<span class='lparen'>(</span><span class='id identifier rubyid_modules'>modules</span> <span class='op'>&</span> <span class='id identifier rubyid_valid_modules'>valid_modules</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='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
732
752
|
|
733
753
|
<span class='kw'>yield</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
734
754
|
<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>
|
@@ -763,9 +783,6 @@ Otherwise the class of the object will returned.</p>
|
|
763
783
|
<pre class="lines">
|
764
784
|
|
765
785
|
|
766
|
-
65
|
767
|
-
66
|
768
|
-
67
|
769
786
|
68
|
770
787
|
69
|
771
788
|
70
|
@@ -773,10 +790,13 @@ Otherwise the class of the object will returned.</p>
|
|
773
790
|
72
|
774
791
|
73
|
775
792
|
74
|
776
|
-
75
|
793
|
+
75
|
794
|
+
76
|
795
|
+
77
|
796
|
+
78</pre>
|
777
797
|
</td>
|
778
798
|
<td>
|
779
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
799
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 68</span>
|
780
800
|
|
781
801
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_boolean'>load_boolean</span>
|
782
802
|
<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>
|
@@ -819,6 +839,7 @@ Otherwise the class of the object will returned.</p>
|
|
819
839
|
<pre class="lines">
|
820
840
|
|
821
841
|
|
842
|
+
93
|
822
843
|
94
|
823
844
|
95
|
824
845
|
96
|
@@ -826,11 +847,10 @@ Otherwise the class of the object will returned.</p>
|
|
826
847
|
98
|
827
848
|
99
|
828
849
|
100
|
829
|
-
101
|
830
|
-
102</pre>
|
850
|
+
101</pre>
|
831
851
|
</td>
|
832
852
|
<td>
|
833
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
853
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 93</span>
|
834
854
|
|
835
855
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_datetime'>load_datetime</span>
|
836
856
|
<span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_load_object'>load_object</span>
|
@@ -871,16 +891,18 @@ Otherwise the class of the object will returned.</p>
|
|
871
891
|
<pre class="lines">
|
872
892
|
|
873
893
|
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
894
|
+
86
|
895
|
+
87
|
896
|
+
88
|
897
|
+
89
|
898
|
+
90</pre>
|
878
899
|
</td>
|
879
900
|
<td>
|
880
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
901
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 86</span>
|
881
902
|
|
882
903
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_hash'>load_hash</span>
|
883
904
|
<span class='id identifier rubyid_clean_hash_compact'>clean_hash_compact</span>
|
905
|
+
<span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_load_object'>load_object</span>
|
884
906
|
<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='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'>Hash</span> <span class='rbrace'>}</span>
|
885
907
|
<span class='kw'>end</span></pre>
|
886
908
|
</td>
|
@@ -889,9 +911,9 @@ Otherwise the class of the object will returned.</p>
|
|
889
911
|
</div>
|
890
912
|
|
891
913
|
<div class="method_details ">
|
892
|
-
<h3 class="signature " id="
|
914
|
+
<h3 class="signature " id="load_math-class_method">
|
893
915
|
|
894
|
-
+ (<tt><span class='object_link'><a href="Lazier/Object.html" title="Lazier::Object (module)">Object</a></span></tt>) <strong>
|
916
|
+
+ (<tt><span class='object_link'><a href="Lazier/Object.html" title="Lazier::Object (module)">Object</a></span></tt>) <strong>load_math</strong>
|
895
917
|
|
896
918
|
|
897
919
|
|
@@ -899,7 +921,7 @@ Otherwise the class of the object will returned.</p>
|
|
899
921
|
|
900
922
|
</h3><div class="docstring">
|
901
923
|
<div class="discussion">
|
902
|
-
<p>Loads
|
924
|
+
<p>Loads Math extensions.</p>
|
903
925
|
|
904
926
|
|
905
927
|
</div>
|
@@ -913,15 +935,17 @@ Otherwise the class of the object will returned.</p>
|
|
913
935
|
<pre class="lines">
|
914
936
|
|
915
937
|
|
916
|
-
|
917
|
-
|
918
|
-
|
938
|
+
104
|
939
|
+
105
|
940
|
+
106
|
941
|
+
107</pre>
|
919
942
|
</td>
|
920
943
|
<td>
|
921
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
944
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 104</span>
|
922
945
|
|
923
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
924
|
-
<span class='
|
946
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_math'>load_math</span>
|
947
|
+
<span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_load_object'>load_object</span>
|
948
|
+
<span class='op'>::</span><span class='const'>Math</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'>Math</span> <span class='rbrace'>}</span>
|
925
949
|
<span class='kw'>end</span></pre>
|
926
950
|
</td>
|
927
951
|
</tr>
|
@@ -929,9 +953,9 @@ Otherwise the class of the object will returned.</p>
|
|
929
953
|
</div>
|
930
954
|
|
931
955
|
<div class="method_details ">
|
932
|
-
<h3 class="signature " id="
|
956
|
+
<h3 class="signature " id="load_object-class_method">
|
933
957
|
|
934
|
-
+ (<tt><span class='object_link'><a href="Lazier/Object.html" title="Lazier::Object (module)">Object</a></span></tt>) <strong>
|
958
|
+
+ (<tt><span class='object_link'><a href="Lazier/Object.html" title="Lazier::Object (module)">Object</a></span></tt>) <strong>load_object</strong>
|
935
959
|
|
936
960
|
|
937
961
|
|
@@ -939,7 +963,7 @@ Otherwise the class of the object will returned.</p>
|
|
939
963
|
|
940
964
|
</h3><div class="docstring">
|
941
965
|
<div class="discussion">
|
942
|
-
<p>Loads
|
966
|
+
<p>Loads Object extensions.</p>
|
943
967
|
|
944
968
|
|
945
969
|
</div>
|
@@ -953,17 +977,15 @@ Otherwise the class of the object will returned.</p>
|
|
953
977
|
<pre class="lines">
|
954
978
|
|
955
979
|
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
108</pre>
|
980
|
+
63
|
981
|
+
64
|
982
|
+
65</pre>
|
960
983
|
</td>
|
961
984
|
<td>
|
962
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
985
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 63</span>
|
963
986
|
|
964
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
965
|
-
<span class='const'>
|
966
|
-
<span class='op'>::</span><span class='const'>Math</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'>Math</span> <span class='rbrace'>}</span>
|
987
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_object'>load_object</span>
|
988
|
+
<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>
|
967
989
|
<span class='kw'>end</span></pre>
|
968
990
|
</td>
|
969
991
|
</tr>
|
@@ -971,9 +993,9 @@ Otherwise the class of the object will returned.</p>
|
|
971
993
|
</div>
|
972
994
|
|
973
995
|
<div class="method_details ">
|
974
|
-
<h3 class="signature " id="
|
996
|
+
<h3 class="signature " id="load_pathname-class_method">
|
975
997
|
|
976
|
-
+ (<tt><span class='object_link'><a href="Lazier/Object.html" title="Lazier::Object (module)">Object</a></span></tt>) <strong>
|
998
|
+
+ (<tt><span class='object_link'><a href="Lazier/Object.html" title="Lazier::Object (module)">Object</a></span></tt>) <strong>load_pathname</strong>
|
977
999
|
|
978
1000
|
|
979
1001
|
|
@@ -981,7 +1003,7 @@ Otherwise the class of the object will returned.</p>
|
|
981
1003
|
|
982
1004
|
</h3><div class="docstring">
|
983
1005
|
<div class="discussion">
|
984
|
-
<p>Loads
|
1006
|
+
<p>Loads Pathname extensions.</p>
|
985
1007
|
|
986
1008
|
|
987
1009
|
</div>
|
@@ -995,15 +1017,17 @@ Otherwise the class of the object will returned.</p>
|
|
995
1017
|
<pre class="lines">
|
996
1018
|
|
997
1019
|
|
998
|
-
|
999
|
-
|
1000
|
-
|
1020
|
+
110
|
1021
|
+
111
|
1022
|
+
112
|
1023
|
+
113</pre>
|
1001
1024
|
</td>
|
1002
1025
|
<td>
|
1003
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
1026
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 110</span>
|
1004
1027
|
|
1005
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
1006
|
-
<span class='
|
1028
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_pathname'>load_pathname</span>
|
1029
|
+
<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>
|
1030
|
+
<span class='op'>::</span><span class='const'>Pathname</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'>Pathname</span> <span class='rbrace'>}</span>
|
1007
1031
|
<span class='kw'>end</span></pre>
|
1008
1032
|
</td>
|
1009
1033
|
</tr>
|
@@ -1011,9 +1035,9 @@ Otherwise the class of the object will returned.</p>
|
|
1011
1035
|
</div>
|
1012
1036
|
|
1013
1037
|
<div class="method_details ">
|
1014
|
-
<h3 class="signature " id="
|
1038
|
+
<h3 class="signature " id="load_string-class_method">
|
1015
1039
|
|
1016
|
-
+ (<tt><span class='object_link'><a href="Lazier/Object.html" title="Lazier::Object (module)">Object</a></span></tt>) <strong>
|
1040
|
+
+ (<tt><span class='object_link'><a href="Lazier/Object.html" title="Lazier::Object (module)">Object</a></span></tt>) <strong>load_string</strong>
|
1017
1041
|
|
1018
1042
|
|
1019
1043
|
|
@@ -1021,7 +1045,7 @@ Otherwise the class of the object will returned.</p>
|
|
1021
1045
|
|
1022
1046
|
</h3><div class="docstring">
|
1023
1047
|
<div class="discussion">
|
1024
|
-
<p>Loads
|
1048
|
+
<p>Loads String extensions.</p>
|
1025
1049
|
|
1026
1050
|
|
1027
1051
|
</div>
|
@@ -1035,17 +1059,15 @@ Otherwise the class of the object will returned.</p>
|
|
1035
1059
|
<pre class="lines">
|
1036
1060
|
|
1037
1061
|
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
114</pre>
|
1062
|
+
81
|
1063
|
+
82
|
1064
|
+
83</pre>
|
1042
1065
|
</td>
|
1043
1066
|
<td>
|
1044
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
1067
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 81</span>
|
1045
1068
|
|
1046
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
1047
|
-
<span class='id identifier
|
1048
|
-
<span class='op'>::</span><span class='const'>Pathname</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'>Pathname</span> <span class='rbrace'>}</span>
|
1069
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_string'>load_string</span>
|
1070
|
+
<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>
|
1049
1071
|
<span class='kw'>end</span></pre>
|
1050
1072
|
</td>
|
1051
1073
|
</tr>
|
@@ -1053,9 +1075,9 @@ Otherwise the class of the object will returned.</p>
|
|
1053
1075
|
</div>
|
1054
1076
|
|
1055
1077
|
<div class="method_details ">
|
1056
|
-
<h3 class="signature " id="
|
1078
|
+
<h3 class="signature " id="platform-class_method">
|
1057
1079
|
|
1058
|
-
+ (<tt><span class='object_link'><a href="Lazier/
|
1080
|
+
+ (<tt><span class='object_link'><a href="Lazier/Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>, <tt>Symbol</tt>) <strong>platform</strong>(force = false)
|
1059
1081
|
|
1060
1082
|
|
1061
1083
|
|
@@ -1063,13 +1085,43 @@ Otherwise the class of the object will returned.</p>
|
|
1063
1085
|
|
1064
1086
|
</h3><div class="docstring">
|
1065
1087
|
<div class="discussion">
|
1066
|
-
<p>
|
1088
|
+
<p>Returns which platform are we running on. Can be <code>:java</code>, <code>:osx</code>, <code>:posix</code> or <code>:win32</code></p>
|
1067
1089
|
|
1068
1090
|
|
1069
1091
|
</div>
|
1070
1092
|
</div>
|
1071
1093
|
<div class="tags">
|
1072
1094
|
|
1095
|
+
<p class="tag_title">Returns:</p>
|
1096
|
+
<ul class="return">
|
1097
|
+
|
1098
|
+
<li>
|
1099
|
+
|
1100
|
+
|
1101
|
+
<span class='type'>(<tt><span class='object_link'><a href="Lazier/Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
|
1102
|
+
|
1103
|
+
|
1104
|
+
|
1105
|
+
—
|
1106
|
+
<div class='inline'><p>If force detection again.</p>
|
1107
|
+
</div>
|
1108
|
+
|
1109
|
+
</li>
|
1110
|
+
|
1111
|
+
<li>
|
1112
|
+
|
1113
|
+
|
1114
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
1115
|
+
|
1116
|
+
|
1117
|
+
|
1118
|
+
—
|
1119
|
+
<div class='inline'><p>The current platform.</p>
|
1120
|
+
</div>
|
1121
|
+
|
1122
|
+
</li>
|
1123
|
+
|
1124
|
+
</ul>
|
1073
1125
|
|
1074
1126
|
</div><table class="source_code">
|
1075
1127
|
<tr>
|
@@ -1077,15 +1129,31 @@ Otherwise the class of the object will returned.</p>
|
|
1077
1129
|
<pre class="lines">
|
1078
1130
|
|
1079
1131
|
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1132
|
+
148
|
1133
|
+
149
|
1134
|
+
150
|
1135
|
+
151
|
1136
|
+
152
|
1137
|
+
153
|
1138
|
+
154
|
1139
|
+
155
|
1140
|
+
156
|
1141
|
+
157
|
1142
|
+
158</pre>
|
1083
1143
|
</td>
|
1084
1144
|
<td>
|
1085
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
1086
|
-
|
1087
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
1088
|
-
<span class='
|
1145
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 148</span>
|
1146
|
+
|
1147
|
+
<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>
|
1148
|
+
<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>
|
1149
|
+
|
1150
|
+
<span class='ivar'>@platform</span> <span class='op'>||=</span>
|
1151
|
+
<span class='kw'>case</span> <span class='const'>RUBY_PLATFORM</span>
|
1152
|
+
<span class='kw'>when</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>cygwin|mingw|win32</span><span class='regexp_end'>/</span></span> <span class='kw'>then</span> <span class='symbol'>:win32</span>
|
1153
|
+
<span class='kw'>when</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>java</span><span class='regexp_end'>/</span></span> <span class='kw'>then</span> <span class='symbol'>:java</span>
|
1154
|
+
<span class='kw'>when</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>darwin</span><span class='regexp_end'>/</span></span> <span class='kw'>then</span> <span class='symbol'>:osx</span>
|
1155
|
+
<span class='kw'>else</span> <span class='symbol'>:posix</span>
|
1156
|
+
<span class='kw'>end</span>
|
1089
1157
|
<span class='kw'>end</span></pre>
|
1090
1158
|
</td>
|
1091
1159
|
</tr>
|
@@ -1134,12 +1202,12 @@ Otherwise the class of the object will returned.</p>
|
|
1134
1202
|
<pre class="lines">
|
1135
1203
|
|
1136
1204
|
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1205
|
+
36
|
1206
|
+
37
|
1207
|
+
38</pre>
|
1140
1208
|
</td>
|
1141
1209
|
<td>
|
1142
|
-
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line
|
1210
|
+
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 36</span>
|
1143
1211
|
|
1144
1212
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span>
|
1145
1213
|
<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>
|
@@ -1154,7 +1222,7 @@ Otherwise the class of the object will returned.</p>
|
|
1154
1222
|
</div>
|
1155
1223
|
|
1156
1224
|
<div id="footer">
|
1157
|
-
Generated on
|
1225
|
+
Generated on Sun Jun 1 15:50:05 2014 by
|
1158
1226
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1159
1227
|
0.8.7.4 (ruby-2.1.2).
|
1160
1228
|
</div>
|