refinements 6.3.2 → 7.0.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
  SHA256:
3
- metadata.gz: 64e8f421e89d812bcc1c4c6c55be8592f0b14318df44a4fe842eafd175899f88
4
- data.tar.gz: 7c56a52d5ac6902b4a2a890b4986d1016a0ee27197ba394e22dd5308475ffe3f
3
+ metadata.gz: ff378c2c0076828fcd3e3ad623de04d09cf9c0f55bd12a17912504fad71bdf28
4
+ data.tar.gz: 9280e888aad9dcebe9872734501cc6d5a8ce46af9baa7e3fb9bf3baca0e49518
5
5
  SHA512:
6
- metadata.gz: e33fcfc7d75d603322da978858ecc5f625d24483042b90c7c7464c954458ff2323c5b32bf0fd8b4a8b8e10dca70c464c9d99c521d45cd4de36b281610a744101
7
- data.tar.gz: d69e8053628f64fa660f157af5affff09cb34269e86f6010496f0f00ac8a23a85769183a40b871f5fe6a7875415a1e5a0946b5d62814aecbd64d966213ca278c
6
+ metadata.gz: 0c2ba552ed6a3779b3eb220f6d39b348baf83e2bab906aca907c483209f52f98554d9baeed1c5cbeeba939be205779ed20e1c625671672d4e143451ea36210d0
7
+ data.tar.gz: e7a91844e7df2654a1b20257e036d634d96bd867291bf5687e0ead5e07cdf307cd2e1347a917304119520813baddaca8f740589674545f1b3ac24acecc1e910d
Binary file
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  [![Code Climate Test Coverage](https://api.codeclimate.com/v1/badges/98be62123a95d5ac32d2/test_coverage)](https://codeclimate.com/github/bkuhlmann/refinements/test_coverage)
10
10
  [![Circle CI Status](https://circleci.com/gh/bkuhlmann/refinements.svg?style=svg)](https://circleci.com/gh/bkuhlmann/refinements)
11
11
 
12
- Provides additional enhancements (refinements) to core Ruby objects.
12
+ A collection of refinements (enhancements) to core Ruby objects.
13
13
 
14
14
  <!-- Tocer[start]: Auto-generated, don't remove. -->
15
15
 
@@ -23,6 +23,7 @@ Provides additional enhancements (refinements) to core Ruby objects.
23
23
  - [Using](#using)
24
24
  - [Examples](#examples)
25
25
  - [Array](#array)
26
+ - [DateTime](#datetime)
26
27
  - [Big Decimal](#big-decimal)
27
28
  - [File](#file)
28
29
  - [Hash](#hash)
@@ -43,6 +44,8 @@ Provides additional enhancements (refinements) to core Ruby objects.
43
44
  - Provides Array refinements:
44
45
  - `#compress` - Removes `nil` and empty values without modifying itself.
45
46
  - `#compress!` - Removes `nil` and empty values while modifying itself.
47
+ - Provides DateTime refinements:
48
+ - `.utc` - Answers new DateTime object for current UTC date/time.
46
49
  - Provides BigDecimal refinements:
47
50
  - `#inspect` - Allows one to inspect a big decimal with numeric representation.
48
51
  - Provides File refinements:
@@ -99,6 +102,7 @@ If all refinements are not desired, add the following to your `Gemfile` instead:
99
102
  ...then require the specific refinement, as needed. Example:
100
103
 
101
104
  require "refinements/arrays"
105
+ require "refinements/date_times"
102
106
  require "refinements/big_decimals"
103
107
  require "refinements/files"
104
108
  require "refinements/hashes"
@@ -111,6 +115,7 @@ Much like including/extending a module, you'll need modify your object(s) to use
111
115
 
112
116
  class Example
113
117
  using Refinements::Arrays
118
+ using Refinements::DateTimes
114
119
  using Refinements::BigDecimals
115
120
  using Refinements::Files
116
121
  using Refinements::Hashes
@@ -132,6 +137,10 @@ The following sections demonstrate how each refinement enriches your objects wit
132
137
  example.compress! # => ["An", "Example"]
133
138
  example # => ["An", "Example"]
134
139
 
140
+ #### DateTime
141
+
142
+ DateTime.utc # => #<DateTime: 2019-12-31T18:17:00+00:00 ((2458849j,65820s,181867000n),+0s,2299161j)>
143
+
135
144
  #### Big Decimal
136
145
 
137
146
  BigDecimal.new("5.0E-10").inspect # => "#<BigDecimal:3fd3d458fe84 0.0000000005>"
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "refinements/identity"
4
4
  require "refinements/arrays"
5
+ require "refinements/date_times"
5
6
  require "refinements/big_decimals"
6
7
  require "refinements/files"
7
8
  require "refinements/hashes"
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "date"
4
+
5
+ module Refinements
6
+ module DateTimes
7
+ refine DateTime.singleton_class do
8
+ def utc
9
+ now.new_offset 0
10
+ end
11
+ end
12
+ end
13
+ end
@@ -12,7 +12,7 @@ module Refinements
12
12
  end
13
13
 
14
14
  def self.version
15
- "6.3.2"
15
+ "7.0.0"
16
16
  end
17
17
 
18
18
  def self.version_label
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinements
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.2
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -28,36 +28,8 @@ cert_chain:
28
28
  dKvURM+1PwDCzC5tvRwjhUJIizau6+MtkFCvJHmaAj1aZL3odcPejHj5Hxt/0CUW
29
29
  y84=
30
30
  -----END CERTIFICATE-----
31
- date: 2019-11-01 00:00:00.000000000 Z
31
+ date: 2020-01-01 00:00:00.000000000 Z
32
32
  dependencies:
33
- - !ruby/object:Gem::Dependency
34
- name: awesome_print
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '1.8'
40
- type: :development
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '1.8'
47
- - !ruby/object:Gem::Dependency
48
- name: bond
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '0.5'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '0.5'
61
33
  - !ruby/object:Gem::Dependency
62
34
  name: bundler-audit
63
35
  requirement: !ruby/object:Gem::Requirement
@@ -72,34 +44,6 @@ dependencies:
72
44
  - - "~>"
73
45
  - !ruby/object:Gem::Version
74
46
  version: '0.6'
75
- - !ruby/object:Gem::Dependency
76
- name: gemsmith
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '13.5'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '13.5'
89
- - !ruby/object:Gem::Dependency
90
- name: git-cop
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: '3.5'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: '3.5'
103
47
  - !ruby/object:Gem::Dependency
104
48
  name: guard-rspec
105
49
  requirement: !ruby/object:Gem::Requirement
@@ -114,48 +58,34 @@ dependencies:
114
58
  - - "~>"
115
59
  - !ruby/object:Gem::Version
116
60
  version: '4.7'
117
- - !ruby/object:Gem::Dependency
118
- name: hirb
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - "~>"
122
- - !ruby/object:Gem::Version
123
- version: '0.7'
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - "~>"
129
- - !ruby/object:Gem::Version
130
- version: '0.7'
131
61
  - !ruby/object:Gem::Dependency
132
62
  name: pry
133
63
  requirement: !ruby/object:Gem::Requirement
134
64
  requirements:
135
65
  - - "~>"
136
66
  - !ruby/object:Gem::Version
137
- version: '0.10'
67
+ version: '0.12'
138
68
  type: :development
139
69
  prerelease: false
140
70
  version_requirements: !ruby/object:Gem::Requirement
141
71
  requirements:
142
72
  - - "~>"
143
73
  - !ruby/object:Gem::Version
144
- version: '0.10'
74
+ version: '0.12'
145
75
  - !ruby/object:Gem::Dependency
146
76
  name: pry-byebug
147
77
  requirement: !ruby/object:Gem::Requirement
148
78
  requirements:
149
79
  - - "~>"
150
80
  - !ruby/object:Gem::Version
151
- version: '3.5'
81
+ version: '3.7'
152
82
  type: :development
153
83
  prerelease: false
154
84
  version_requirements: !ruby/object:Gem::Requirement
155
85
  requirements:
156
86
  - - "~>"
157
87
  - !ruby/object:Gem::Version
158
- version: '3.5'
88
+ version: '3.7'
159
89
  - !ruby/object:Gem::Dependency
160
90
  name: rake
161
91
  requirement: !ruby/object:Gem::Requirement
@@ -204,84 +134,70 @@ dependencies:
204
134
  requirements:
205
135
  - - "~>"
206
136
  - !ruby/object:Gem::Version
207
- version: '0.76'
137
+ version: '0.78'
208
138
  type: :development
209
139
  prerelease: false
210
140
  version_requirements: !ruby/object:Gem::Requirement
211
141
  requirements:
212
142
  - - "~>"
213
143
  - !ruby/object:Gem::Version
214
- version: '0.76'
144
+ version: '0.78'
215
145
  - !ruby/object:Gem::Dependency
216
146
  name: rubocop-performance
217
147
  requirement: !ruby/object:Gem::Requirement
218
148
  requirements:
219
149
  - - "~>"
220
150
  - !ruby/object:Gem::Version
221
- version: '1.4'
151
+ version: '1.5'
222
152
  type: :development
223
153
  prerelease: false
224
154
  version_requirements: !ruby/object:Gem::Requirement
225
155
  requirements:
226
156
  - - "~>"
227
157
  - !ruby/object:Gem::Version
228
- version: '1.4'
158
+ version: '1.5'
229
159
  - !ruby/object:Gem::Dependency
230
160
  name: rubocop-rake
231
161
  requirement: !ruby/object:Gem::Requirement
232
162
  requirements:
233
163
  - - "~>"
234
164
  - !ruby/object:Gem::Version
235
- version: '0.3'
165
+ version: '0.5'
236
166
  type: :development
237
167
  prerelease: false
238
168
  version_requirements: !ruby/object:Gem::Requirement
239
169
  requirements:
240
170
  - - "~>"
241
171
  - !ruby/object:Gem::Version
242
- version: '0.3'
172
+ version: '0.5'
243
173
  - !ruby/object:Gem::Dependency
244
174
  name: rubocop-rspec
245
175
  requirement: !ruby/object:Gem::Requirement
246
176
  requirements:
247
177
  - - "~>"
248
178
  - !ruby/object:Gem::Version
249
- version: '1.33'
179
+ version: '1.37'
250
180
  type: :development
251
181
  prerelease: false
252
182
  version_requirements: !ruby/object:Gem::Requirement
253
183
  requirements:
254
184
  - - "~>"
255
185
  - !ruby/object:Gem::Version
256
- version: '1.33'
186
+ version: '1.37'
257
187
  - !ruby/object:Gem::Dependency
258
188
  name: simplecov
259
189
  requirement: !ruby/object:Gem::Requirement
260
190
  requirements:
261
191
  - - "~>"
262
192
  - !ruby/object:Gem::Version
263
- version: '0.13'
264
- type: :development
265
- prerelease: false
266
- version_requirements: !ruby/object:Gem::Requirement
267
- requirements:
268
- - - "~>"
269
- - !ruby/object:Gem::Version
270
- version: '0.13'
271
- - !ruby/object:Gem::Dependency
272
- name: wirb
273
- requirement: !ruby/object:Gem::Requirement
274
- requirements:
275
- - - "~>"
276
- - !ruby/object:Gem::Version
277
- version: '2.1'
193
+ version: '0.17'
278
194
  type: :development
279
195
  prerelease: false
280
196
  version_requirements: !ruby/object:Gem::Requirement
281
197
  requirements:
282
198
  - - "~>"
283
199
  - !ruby/object:Gem::Version
284
- version: '2.1'
200
+ version: '0.17'
285
201
  description:
286
202
  email:
287
203
  - brooke@alchemists.io
@@ -296,6 +212,7 @@ files:
296
212
  - lib/refinements.rb
297
213
  - lib/refinements/arrays.rb
298
214
  - lib/refinements/big_decimals.rb
215
+ - lib/refinements/date_times.rb
299
216
  - lib/refinements/files.rb
300
217
  - lib/refinements/hashes.rb
301
218
  - lib/refinements/identity.rb
@@ -316,15 +233,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
316
233
  requirements:
317
234
  - - "~>"
318
235
  - !ruby/object:Gem::Version
319
- version: '2.6'
236
+ version: '2.7'
320
237
  required_rubygems_version: !ruby/object:Gem::Requirement
321
238
  requirements:
322
239
  - - ">="
323
240
  - !ruby/object:Gem::Version
324
241
  version: '0'
325
242
  requirements: []
326
- rubygems_version: 3.0.6
243
+ rubygems_version: 3.1.2
327
244
  signing_key:
328
245
  specification_version: 4
329
- summary: Provides additional enhancements (refinements) to core Ruby objects.
246
+ summary: A collection of refinements to core Ruby objects.
330
247
  test_files: []
metadata.gz.sig CHANGED
@@ -1 +1,4 @@
1
- �9 ��ϰ���jJMY�VQ� �<]�g�Y�Q�p����� ����O�B�А�>8�(���3��b`I6��F2�A�qwx @I�]�~�l'l�* C��$�꺕�I�>>���h#����M�st�$��F0I!yj�D*2R�5�q��D�(���I�A�xDӅ�3?��^�]0�S3�"Pi�K����+��Pv�"Z4-}b��1A4]�b)��'��6jw���##�����WG�‹O��+}k-
1
+ :>[6��P9�6��G->����k �+��7��Z.]��޳�h[�˜
2
+ J����8{� �W��� ;�~���T��D���<�"J�a@XUV����5;#'�w`P����Ev�N����t
3
+ �`?/O�0Ѩ+�Q�^�Ҵ�+%'c��#�f�E �
4
+ :�L}����U?ך��^��7f?��fk��+d\��P��>�h^>4 P�ݸr�1��w��pN�� FS� o�\)x����<�5��@R>���v����