lazier 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/.travis.yml +8 -0
- data/.yardopts +1 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +82 -0
- data/README.md +33 -0
- data/Rakefile +18 -0
- data/doc/Lazier.html +557 -0
- data/doc/Lazier/Boolean.html +297 -0
- data/doc/Lazier/DateTime.html +787 -0
- data/doc/Lazier/DateTime/ClassMethods.html +1592 -0
- data/doc/Lazier/Exceptions.html +125 -0
- data/doc/Lazier/Exceptions/Dump.html +133 -0
- data/doc/Lazier/Hash.html +393 -0
- data/doc/Lazier/Math.html +130 -0
- data/doc/Lazier/Math/ClassMethods.html +362 -0
- data/doc/Lazier/Object.html +1565 -0
- data/doc/Lazier/Pathname.html +225 -0
- data/doc/Lazier/Settings.html +1249 -0
- data/doc/Lazier/String.html +471 -0
- data/doc/Lazier/TimeZone.html +1675 -0
- data/doc/Lazier/TimeZone/ClassMethods.html +1055 -0
- data/doc/Lazier/Version.html +189 -0
- data/doc/_index.html +306 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.README.html +107 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +107 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +652 -0
- data/doc/top-level-namespace.html +112 -0
- data/lazier.gemspec +36 -0
- data/lib/lazier.rb +127 -0
- data/lib/lazier/boolean.rb +26 -0
- data/lib/lazier/datetime.rb +548 -0
- data/lib/lazier/exceptions.rb +14 -0
- data/lib/lazier/hash.rb +40 -0
- data/lib/lazier/math.rb +47 -0
- data/lib/lazier/object.rb +163 -0
- data/lib/lazier/pathname.rb +26 -0
- data/lib/lazier/settings.rb +118 -0
- data/lib/lazier/string.rb +54 -0
- data/lib/lazier/version.rb +24 -0
- data/spec/coverage_helper.rb +19 -0
- data/spec/cowtech-extensions/boolean_spec.rb +30 -0
- data/spec/cowtech-extensions/datetime_spec.rb +352 -0
- data/spec/cowtech-extensions/hash_spec.rb +30 -0
- data/spec/cowtech-extensions/math_spec.rb +41 -0
- data/spec/cowtech-extensions/object_spec.rb +231 -0
- data/spec/cowtech-extensions/pathname_spec.rb +21 -0
- data/spec/cowtech-extensions/settings_spec.rb +118 -0
- data/spec/cowtech-extensions/string_spec.rb +45 -0
- data/spec/lazier_spec.rb +57 -0
- data/spec/spec_helper.rb +16 -0
- metadata +292 -0
data/spec/lazier_spec.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Lazier do
|
4
|
+
describe ".is_ruby_18?" do
|
5
|
+
it "it return true for Ruby 1.8" do
|
6
|
+
original_ruby_version = RUBY_VERSION
|
7
|
+
|
8
|
+
::Kernel::silence_warnings { Object.const_set("RUBY_VERSION", "1.8.7") }
|
9
|
+
expect(::Lazier.is_ruby_18?).to be_true
|
10
|
+
::Kernel::silence_warnings { Object.const_set("RUBY_VERSION", original_ruby_version) }
|
11
|
+
end
|
12
|
+
|
13
|
+
it "it return false otherwise" do
|
14
|
+
original_ruby_version = RUBY_VERSION
|
15
|
+
|
16
|
+
::Kernel::silence_warnings { Object.const_set("RUBY_VERSION", "1.9.3") }
|
17
|
+
expect(::Lazier.is_ruby_18?).to be_false
|
18
|
+
::Kernel::silence_warnings { Object.const_set("RUBY_VERSION", original_ruby_version) }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe ".load!" do
|
23
|
+
describe "should load all extensions by default" do
|
24
|
+
::Lazier.load!
|
25
|
+
|
26
|
+
it "for Boolean" do
|
27
|
+
expect(true).to respond_to("value")
|
28
|
+
expect(true).to respond_to("to_i")
|
29
|
+
end
|
30
|
+
|
31
|
+
it "for DateTime" do
|
32
|
+
expect(::DateTime).to respond_to("custom_format")
|
33
|
+
expect(::DateTime.now).to respond_to("lstrftime")
|
34
|
+
end
|
35
|
+
|
36
|
+
it "for Hash" do
|
37
|
+
expect({:a => "b"}).to respond_to("a")
|
38
|
+
end
|
39
|
+
|
40
|
+
it "for Math" do
|
41
|
+
expect(::Math).to respond_to("min")
|
42
|
+
end
|
43
|
+
|
44
|
+
it "for Object" do
|
45
|
+
expect(0).to respond_to("debug_dump")
|
46
|
+
end
|
47
|
+
|
48
|
+
it "for Pathname" do
|
49
|
+
expect(::Pathname.new($0)).to respond_to("components")
|
50
|
+
end
|
51
|
+
|
52
|
+
it "for String" do
|
53
|
+
expect("").to respond_to("remove_accents")
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# This file is part of the lazier gem. Copyright (C) 2011 and above Shogun <shogun_panda@me.com>.
|
4
|
+
# Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
|
5
|
+
#
|
6
|
+
|
7
|
+
require "rubygems"
|
8
|
+
require "coverage_helper"
|
9
|
+
require "bundler/setup"
|
10
|
+
require "lazier"
|
11
|
+
|
12
|
+
RSpec.configure do |config|
|
13
|
+
config.expect_with :rspec do |c|
|
14
|
+
c.syntax = :expect
|
15
|
+
end
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,292 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lazier
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Shogun
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2012-08-01 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
22
|
+
none: false
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
hash: 11
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 7
|
30
|
+
- 0
|
31
|
+
version: 1.7.0
|
32
|
+
prerelease: false
|
33
|
+
type: :runtime
|
34
|
+
name: json
|
35
|
+
requirement: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ~>
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 7
|
43
|
+
segments:
|
44
|
+
- 3
|
45
|
+
- 0
|
46
|
+
version: "3.0"
|
47
|
+
prerelease: false
|
48
|
+
type: :runtime
|
49
|
+
name: actionpack
|
50
|
+
requirement: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ~>
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 19
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
- 3
|
61
|
+
- 0
|
62
|
+
version: 0.3.0
|
63
|
+
prerelease: false
|
64
|
+
type: :runtime
|
65
|
+
name: tzinfo
|
66
|
+
requirement: *id003
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ~>
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
hash: 35
|
74
|
+
segments:
|
75
|
+
- 2
|
76
|
+
- 11
|
77
|
+
- 0
|
78
|
+
version: 2.11.0
|
79
|
+
prerelease: false
|
80
|
+
type: :development
|
81
|
+
name: rspec
|
82
|
+
requirement: *id004
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
hash: 59
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
- 9
|
93
|
+
- 0
|
94
|
+
version: 0.9.0
|
95
|
+
prerelease: false
|
96
|
+
type: :development
|
97
|
+
name: rake
|
98
|
+
requirement: *id005
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
102
|
+
requirements:
|
103
|
+
- - ~>
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
hash: 7
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
- 6
|
109
|
+
- 0
|
110
|
+
version: 0.6.0
|
111
|
+
prerelease: false
|
112
|
+
type: :development
|
113
|
+
name: simplecov
|
114
|
+
requirement: *id006
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
hash: 3
|
122
|
+
segments:
|
123
|
+
- 0
|
124
|
+
version: "0"
|
125
|
+
prerelease: false
|
126
|
+
type: :development
|
127
|
+
name: pry
|
128
|
+
requirement: *id007
|
129
|
+
- !ruby/object:Gem::Dependency
|
130
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
132
|
+
requirements:
|
133
|
+
- - ~>
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
hash: 63
|
136
|
+
segments:
|
137
|
+
- 0
|
138
|
+
- 8
|
139
|
+
- 0
|
140
|
+
version: 0.8.0
|
141
|
+
prerelease: false
|
142
|
+
type: :development
|
143
|
+
name: yard
|
144
|
+
requirement: *id008
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
147
|
+
none: false
|
148
|
+
requirements:
|
149
|
+
- - ~>
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
hash: 11
|
152
|
+
segments:
|
153
|
+
- 2
|
154
|
+
- 1
|
155
|
+
- 0
|
156
|
+
version: 2.1.0
|
157
|
+
prerelease: false
|
158
|
+
type: :development
|
159
|
+
name: redcarpet
|
160
|
+
requirement: *id009
|
161
|
+
- !ruby/object:Gem::Dependency
|
162
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
163
|
+
none: false
|
164
|
+
requirements:
|
165
|
+
- - ~>
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
hash: 3
|
168
|
+
segments:
|
169
|
+
- 0
|
170
|
+
- 7
|
171
|
+
- 0
|
172
|
+
version: 0.7.0
|
173
|
+
prerelease: false
|
174
|
+
type: :development
|
175
|
+
name: github-markup
|
176
|
+
requirement: *id010
|
177
|
+
description: Several Ruby object enhancements.
|
178
|
+
email:
|
179
|
+
- shogun_panda@me.com
|
180
|
+
executables: []
|
181
|
+
|
182
|
+
extensions: []
|
183
|
+
|
184
|
+
extra_rdoc_files: []
|
185
|
+
|
186
|
+
files:
|
187
|
+
- .gitignore
|
188
|
+
- .travis.yml
|
189
|
+
- .yardopts
|
190
|
+
- Gemfile
|
191
|
+
- Gemfile.lock
|
192
|
+
- README.md
|
193
|
+
- Rakefile
|
194
|
+
- doc/Lazier.html
|
195
|
+
- doc/Lazier/Boolean.html
|
196
|
+
- doc/Lazier/DateTime.html
|
197
|
+
- doc/Lazier/DateTime/ClassMethods.html
|
198
|
+
- doc/Lazier/Exceptions.html
|
199
|
+
- doc/Lazier/Exceptions/Dump.html
|
200
|
+
- doc/Lazier/Hash.html
|
201
|
+
- doc/Lazier/Math.html
|
202
|
+
- doc/Lazier/Math/ClassMethods.html
|
203
|
+
- doc/Lazier/Object.html
|
204
|
+
- doc/Lazier/Pathname.html
|
205
|
+
- doc/Lazier/Settings.html
|
206
|
+
- doc/Lazier/String.html
|
207
|
+
- doc/Lazier/TimeZone.html
|
208
|
+
- doc/Lazier/TimeZone/ClassMethods.html
|
209
|
+
- doc/Lazier/Version.html
|
210
|
+
- doc/_index.html
|
211
|
+
- doc/class_list.html
|
212
|
+
- doc/css/common.css
|
213
|
+
- doc/css/full_list.css
|
214
|
+
- doc/css/style.css
|
215
|
+
- doc/file.README.html
|
216
|
+
- doc/file_list.html
|
217
|
+
- doc/frames.html
|
218
|
+
- doc/index.html
|
219
|
+
- doc/js/app.js
|
220
|
+
- doc/js/full_list.js
|
221
|
+
- doc/js/jquery.js
|
222
|
+
- doc/method_list.html
|
223
|
+
- doc/top-level-namespace.html
|
224
|
+
- lazier.gemspec
|
225
|
+
- lib/lazier.rb
|
226
|
+
- lib/lazier/boolean.rb
|
227
|
+
- lib/lazier/datetime.rb
|
228
|
+
- lib/lazier/exceptions.rb
|
229
|
+
- lib/lazier/hash.rb
|
230
|
+
- lib/lazier/math.rb
|
231
|
+
- lib/lazier/object.rb
|
232
|
+
- lib/lazier/pathname.rb
|
233
|
+
- lib/lazier/settings.rb
|
234
|
+
- lib/lazier/string.rb
|
235
|
+
- lib/lazier/version.rb
|
236
|
+
- spec/coverage_helper.rb
|
237
|
+
- spec/cowtech-extensions/boolean_spec.rb
|
238
|
+
- spec/cowtech-extensions/datetime_spec.rb
|
239
|
+
- spec/cowtech-extensions/hash_spec.rb
|
240
|
+
- spec/cowtech-extensions/math_spec.rb
|
241
|
+
- spec/cowtech-extensions/object_spec.rb
|
242
|
+
- spec/cowtech-extensions/pathname_spec.rb
|
243
|
+
- spec/cowtech-extensions/settings_spec.rb
|
244
|
+
- spec/cowtech-extensions/string_spec.rb
|
245
|
+
- spec/lazier_spec.rb
|
246
|
+
- spec/spec_helper.rb
|
247
|
+
homepage: http://github.com/ShogunPanda/lazier
|
248
|
+
licenses: []
|
249
|
+
|
250
|
+
post_install_message:
|
251
|
+
rdoc_options: []
|
252
|
+
|
253
|
+
require_paths:
|
254
|
+
- lib
|
255
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
256
|
+
none: false
|
257
|
+
requirements:
|
258
|
+
- - ">="
|
259
|
+
- !ruby/object:Gem::Version
|
260
|
+
hash: 3
|
261
|
+
segments:
|
262
|
+
- 0
|
263
|
+
version: "0"
|
264
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
265
|
+
none: false
|
266
|
+
requirements:
|
267
|
+
- - ">="
|
268
|
+
- !ruby/object:Gem::Version
|
269
|
+
hash: 3
|
270
|
+
segments:
|
271
|
+
- 0
|
272
|
+
version: "0"
|
273
|
+
requirements: []
|
274
|
+
|
275
|
+
rubyforge_project: lazier
|
276
|
+
rubygems_version: 1.8.24
|
277
|
+
signing_key:
|
278
|
+
specification_version: 3
|
279
|
+
summary: Several Ruby object enhancements.
|
280
|
+
test_files:
|
281
|
+
- spec/coverage_helper.rb
|
282
|
+
- spec/cowtech-extensions/boolean_spec.rb
|
283
|
+
- spec/cowtech-extensions/datetime_spec.rb
|
284
|
+
- spec/cowtech-extensions/hash_spec.rb
|
285
|
+
- spec/cowtech-extensions/math_spec.rb
|
286
|
+
- spec/cowtech-extensions/object_spec.rb
|
287
|
+
- spec/cowtech-extensions/pathname_spec.rb
|
288
|
+
- spec/cowtech-extensions/settings_spec.rb
|
289
|
+
- spec/cowtech-extensions/string_spec.rb
|
290
|
+
- spec/lazier_spec.rb
|
291
|
+
- spec/spec_helper.rb
|
292
|
+
has_rdoc:
|