lite-ruby 2.0.3 → 2.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29e7241b666924e764cb6109751dde2dd55b5964a1a5ee1656e20d44373ab516
4
- data.tar.gz: 875f644d9a7e9bc392b093c0e9d030321e1a1d3230dbd9214f3225df4cdff613
3
+ metadata.gz: ecd2c3a61307be32e0e81fc96bd6ea7c6dd66b944c42f1a9bac69789c897ef58
4
+ data.tar.gz: a17ee24dc3b3fbd69f30304b179a13aa91e106f5531254a82613580f9988bfd3
5
5
  SHA512:
6
- metadata.gz: 3dc8caff79b7ec516abf91f4eaad29b5377ee092d214bed010b1a56cb176abb8c040b1c79e44bf0947cdb6ab20935586378a7d9f82ea85f51ff1e4dbd561342a
7
- data.tar.gz: d117f070aaefd4a835efce753781a28f330e009863a5843406430e9bc786750efa8f071f66ce189a1c79153e2a658979302844b37d15e4bd01e844b4e6d3fd4c
6
+ metadata.gz: a9b44c14b3c8b5532449b45acf3d919d4680f693896167fbdb50a2681f0370604bc07250f38c1b42cfbb17687a931c666a3dc1f2ee2577afd78e33a70dae4ea4
7
+ data.tar.gz: b2e38bed720eb8756adaac18c3a405464c364b42c922fa752d50ef3e261fbba6080911916bfe7f071fb1659da3fcaaeba97590e0fa0d235212328675bd09f703
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.0.4] - 2021-08-12
10
+ ### Changed
11
+ - Added DateTimeHelper => add unit fallback to `stamp`
12
+
9
13
  ## [2.0.3] - 2021-08-05
10
14
  ### Changed
11
15
  - Added Numeric => `negate`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-ruby (2.0.3)
4
+ lite-ruby (2.0.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -40,13 +40,13 @@ GEM
40
40
  railties (>= 3.0.0)
41
41
  i18n (1.8.10)
42
42
  concurrent-ruby (~> 1.0)
43
- loofah (2.11.0)
43
+ loofah (2.12.0)
44
44
  crass (~> 1.0.2)
45
45
  nokogiri (>= 1.5.9)
46
46
  method_source (1.0.0)
47
47
  mini_portile2 (2.6.1)
48
48
  minitest (5.14.4)
49
- nokogiri (1.12.2)
49
+ nokogiri (1.12.3)
50
50
  mini_portile2 (~> 2.6.1)
51
51
  racc (~> 1.4)
52
52
  parallel (1.20.1)
@@ -84,16 +84,16 @@ GEM
84
84
  diff-lcs (>= 1.2.0, < 2.0)
85
85
  rspec-support (~> 3.10.0)
86
86
  rspec-support (3.10.2)
87
- rubocop (1.18.4)
87
+ rubocop (1.19.0)
88
88
  parallel (~> 1.10)
89
89
  parser (>= 3.0.0.0)
90
90
  rainbow (>= 2.2.2, < 4.0)
91
91
  regexp_parser (>= 1.8, < 3.0)
92
92
  rexml
93
- rubocop-ast (>= 1.8.0, < 2.0)
93
+ rubocop-ast (>= 1.9.1, < 2.0)
94
94
  ruby-progressbar (~> 1.7)
95
95
  unicode-display_width (>= 1.4.0, < 3.0)
96
- rubocop-ast (1.8.0)
96
+ rubocop-ast (1.10.0)
97
97
  parser (>= 3.0.1.1)
98
98
  rubocop-performance (1.11.4)
99
99
  rubocop (>= 1.7.0, < 2.0)
@@ -129,4 +129,4 @@ DEPENDENCIES
129
129
  rubocop-rspec
130
130
 
131
131
  BUNDLED WITH
132
- 2.2.24
132
+ 2.2.25
@@ -13,8 +13,8 @@ module Lite
13
13
  end
14
14
 
15
15
  def stamp(key = nil)
16
- key = key.nil? ? self.class::DEFAULT_STAMP : key.to_s
17
- strftime(self.class::STAMPS[key])
16
+ key ||= self.class::DEFAULT_STAMP
17
+ strftime(self.class::STAMPS[key.to_s] || self.class::UNITS[key.to_s])
18
18
  end
19
19
 
20
20
  alias to_format stamp
@@ -48,9 +48,11 @@ class Integer
48
48
  (0...num).inject(1) { |acc, i| (acc * (self - i)) / (i + 1) }
49
49
  end
50
50
 
51
+ # rubocop:disable Lint/AmbiguousRange
51
52
  def factorial
52
53
  (1..self).inject { |acc, i| acc * i } || 0
53
54
  end
55
+ # rubocop:enable Lint/AmbiguousRange
54
56
 
55
57
  def factors
56
58
  limit = Math.sqrt(self).floor
@@ -228,9 +228,11 @@ class Numeric
228
228
  "#{pad_precision(options.only(:precision))}#{unit}"
229
229
  end
230
230
 
231
+ # rubocop:disable Lint/AmbiguousRange
231
232
  def to_range
232
- negative? ? self..-self : -self..self
233
+ negative? ? (self..-self) : (-self..self)
233
234
  end
235
+ # rubocop:enable Lint/AmbiguousRange
234
236
 
235
237
  def within?(number, epsilon = 0.01)
236
238
  return number == self if epsilon.zero?
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Ruby
5
5
 
6
- VERSION = '2.0.3'
6
+ VERSION = '2.0.4'
7
7
 
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lite-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-05 00:00:00.000000000 Z
11
+ date: 2021-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  - !ruby/object:Gem::Version
228
228
  version: '0'
229
229
  requirements: []
230
- rubygems_version: 3.2.24
230
+ rubygems_version: 3.2.25
231
231
  signing_key:
232
232
  specification_version: 4
233
233
  summary: Collection of useful Ruby methods for its primitive classes