active_date_range 0.3.0 → 0.3.1

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: d8f934208add7b15537a13d906fa465a3ae83626551f7b1a7c485c0383e32a10
4
- data.tar.gz: 7e1c52e9c9b1da73c8c1212892761ad314d6a7490dbd8f1e516fae3f5d6ab368
3
+ metadata.gz: 35a7b655ef32c770ab582f7228e59a90091cdba9553de211e1b18d4efbbb016c
4
+ data.tar.gz: 2f8b685dcaa03b9df69a3d17876023c6e0de5dd8d3bc2f2c0a8208ecffd6b1df
5
5
  SHA512:
6
- metadata.gz: 854500cb33e2a2bf026f29433eadca6619802db32086d33656262487d7da42735c63f7eddf22849587eae15948792362c6be18ab28bead739d508f8210ed60f7
7
- data.tar.gz: e806e16dd17491eb7a45518e428b5a64b42e3fefa774b10659528c9aa8afa4b0ab0c2f5b8d5416bfb140d448c8d4f52061d3db6b276611a468d498a897ac8e5f
6
+ metadata.gz: 292d7bc594e974903c6f73e4edf7b4e3775901f1c970ec54623950d019a8c327ba04e25b0d743c36605df2f514ee752471bd3787d86ff25ece1cdf9903b5b157
7
+ data.tar.gz: 156323981ba292945aebe705431e86eb5474dcf2adfc1caea88fa9703a60b6f4b164222312ae14710b825b3ed8e2482fdd8545ae839bb3165dcb666a683b8ae0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.3.1
2
+
3
+ * Fix issue with `next` not returning a full year when leap years are in the range
4
+
5
+ *Edwin Vlieg*
6
+
1
7
  ## 0.3.0
2
8
 
3
9
  * `include?` now behaves like `cover?` for better performance
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  gem "rake", "~> 12.0"
9
- gem "railties", "~> 6.1"
9
+ gem "railties", "> 6.1"
10
10
  gem "minitest", "~> 5.0"
11
11
  gem "guard"
12
12
  gem "guard-minitest"
data/Gemfile.lock CHANGED
@@ -1,49 +1,48 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_date_range (0.3.0)
5
- activesupport (~> 6.1)
4
+ active_date_range (0.3.1)
5
+ activesupport (> 6.1)
6
6
  i18n
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (6.1.3.2)
12
- actionview (= 6.1.3.2)
13
- activesupport (= 6.1.3.2)
14
- rack (~> 2.0, >= 2.0.9)
11
+ actionpack (7.0.0.alpha2)
12
+ actionview (= 7.0.0.alpha2)
13
+ activesupport (= 7.0.0.alpha2)
14
+ rack (~> 2.0, >= 2.2.0)
15
15
  rack-test (>= 0.6.3)
16
16
  rails-dom-testing (~> 2.0)
17
17
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (6.1.3.2)
19
- activesupport (= 6.1.3.2)
18
+ actionview (7.0.0.alpha2)
19
+ activesupport (= 7.0.0.alpha2)
20
20
  builder (~> 3.1)
21
21
  erubi (~> 1.4)
22
22
  rails-dom-testing (~> 2.0)
23
23
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activemodel (6.1.3.2)
25
- activesupport (= 6.1.3.2)
26
- activesupport (6.1.3.2)
24
+ activemodel (7.0.0.alpha2)
25
+ activesupport (= 7.0.0.alpha2)
26
+ activesupport (7.0.0.alpha2)
27
27
  concurrent-ruby (~> 1.0, >= 1.0.2)
28
28
  i18n (>= 1.6, < 2)
29
29
  minitest (>= 5.1)
30
30
  tzinfo (~> 2.0)
31
- zeitwerk (~> 2.3)
32
31
  ast (2.4.2)
33
32
  builder (3.2.4)
34
33
  coderay (1.1.3)
35
- concurrent-ruby (1.1.8)
34
+ concurrent-ruby (1.1.9)
36
35
  crass (1.0.6)
37
36
  erubi (1.10.0)
38
- ffi (1.15.1)
39
- formatador (0.2.5)
40
- guard (2.17.0)
37
+ ffi (1.15.4)
38
+ formatador (0.3.0)
39
+ guard (2.18.0)
41
40
  formatador (>= 0.2.4)
42
41
  listen (>= 2.7, < 4.0)
43
42
  lumberjack (>= 1.0.12, < 2.0)
44
43
  nenv (~> 0.1)
45
44
  notiffany (~> 0.0)
46
- pry (>= 0.9.12)
45
+ pry (>= 0.13.0)
47
46
  shellany (~> 0.0)
48
47
  thor (>= 0.18.1)
49
48
  guard-compat (1.2.1)
@@ -52,25 +51,23 @@ GEM
52
51
  minitest (>= 3.0)
53
52
  i18n (1.8.10)
54
53
  concurrent-ruby (~> 1.0)
55
- listen (3.5.1)
54
+ listen (3.7.0)
56
55
  rb-fsevent (~> 0.10, >= 0.10.3)
57
56
  rb-inotify (~> 0.9, >= 0.9.10)
58
- loofah (2.9.1)
57
+ loofah (2.12.0)
59
58
  crass (~> 1.0.2)
60
59
  nokogiri (>= 1.5.9)
61
60
  lumberjack (1.2.8)
62
61
  method_source (1.0.0)
63
- mini_portile2 (2.5.1)
64
62
  minitest (5.14.4)
65
63
  nenv (0.3.0)
66
- nokogiri (1.11.5)
67
- mini_portile2 (~> 2.5.0)
64
+ nokogiri (1.12.5-x86_64-linux)
68
65
  racc (~> 1.4)
69
66
  notiffany (0.1.3)
70
67
  nenv (~> 0.1)
71
68
  shellany (~> 0.0)
72
- parallel (1.20.1)
73
- parser (3.0.1.1)
69
+ parallel (1.21.0)
70
+ parser (3.0.2.0)
74
71
  ast (~> 2.4.1)
75
72
  pry (0.14.1)
76
73
  coderay (~> 1.1)
@@ -82,14 +79,15 @@ GEM
82
79
  rails-dom-testing (2.0.3)
83
80
  activesupport (>= 4.2.0)
84
81
  nokogiri (>= 1.6)
85
- rails-html-sanitizer (1.3.0)
82
+ rails-html-sanitizer (1.4.2)
86
83
  loofah (~> 2.3)
87
- railties (6.1.3.2)
88
- actionpack (= 6.1.3.2)
89
- activesupport (= 6.1.3.2)
84
+ railties (7.0.0.alpha2)
85
+ actionpack (= 7.0.0.alpha2)
86
+ activesupport (= 7.0.0.alpha2)
90
87
  method_source
91
- rake (>= 0.8.7)
88
+ rake (>= 0.13)
92
89
  thor (~> 1.0)
90
+ zeitwerk (~> 2.5.0.beta3)
93
91
  rainbow (3.0.0)
94
92
  rake (12.3.3)
95
93
  rb-fsevent (0.11.0)
@@ -97,23 +95,23 @@ GEM
97
95
  ffi (~> 1.0)
98
96
  regexp_parser (2.1.1)
99
97
  rexml (3.2.5)
100
- rubocop (1.15.0)
98
+ rubocop (1.21.0)
101
99
  parallel (~> 1.10)
102
100
  parser (>= 3.0.0.0)
103
101
  rainbow (>= 2.2.2, < 4.0)
104
102
  regexp_parser (>= 1.8, < 3.0)
105
103
  rexml
106
- rubocop-ast (>= 1.5.0, < 2.0)
104
+ rubocop-ast (>= 1.9.1, < 2.0)
107
105
  ruby-progressbar (~> 1.7)
108
106
  unicode-display_width (>= 1.4.0, < 3.0)
109
- rubocop-ast (1.5.0)
107
+ rubocop-ast (1.11.0)
110
108
  parser (>= 3.0.1.1)
111
109
  rubocop-packaging (0.5.1)
112
110
  rubocop (>= 0.89, < 2.0)
113
- rubocop-performance (1.11.3)
111
+ rubocop-performance (1.11.5)
114
112
  rubocop (>= 1.7.0, < 2.0)
115
113
  rubocop-ast (>= 0.4.0)
116
- rubocop-rails (2.10.1)
114
+ rubocop-rails (2.12.2)
117
115
  activesupport (>= 4.2.0)
118
116
  rack (>= 1.1)
119
117
  rubocop (>= 1.7.0, < 2.0)
@@ -122,11 +120,11 @@ GEM
122
120
  thor (1.1.0)
123
121
  tzinfo (2.0.4)
124
122
  concurrent-ruby (~> 1.0)
125
- unicode-display_width (2.0.0)
126
- zeitwerk (2.4.2)
123
+ unicode-display_width (2.1.0)
124
+ zeitwerk (2.5.0.beta3)
127
125
 
128
126
  PLATFORMS
129
- ruby
127
+ x86_64-linux
130
128
 
131
129
  DEPENDENCIES
132
130
  active_date_range!
@@ -135,7 +133,7 @@ DEPENDENCIES
135
133
  guard-minitest
136
134
  minitest (~> 5.0)
137
135
  pry
138
- railties (~> 6.1)
136
+ railties (> 6.1)
139
137
  rake (~> 12.0)
140
138
  rubocop
141
139
  rubocop-packaging
@@ -143,4 +141,4 @@ DEPENDENCIES
143
141
  rubocop-rails
144
142
 
145
143
  BUNDLED WITH
146
- 2.1.4
144
+ 2.3.5
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_dependency "activesupport", "~> 6.1"
29
+ spec.add_dependency "activesupport", "> 6.1"
30
30
  spec.add_dependency "i18n"
31
31
 
32
32
  spec.add_development_dependency "rubocop"
@@ -306,7 +306,13 @@ module ActiveDateRange
306
306
  def next(periods = 1)
307
307
  raise BoundlessRangeError, "Can't calculate next for boundless range" if boundless?
308
308
 
309
- end_date = self.end + (granularity ? periods.send(granularity) : days.days)
309
+ end_date = if granularity
310
+ self.end + periods.send(granularity)
311
+ elsif full_month?
312
+ in_groups_of(:month).last.next(periods * months).end
313
+ else
314
+ self.end + (periods * days).days
315
+ end
310
316
  end_date = end_date.at_end_of_month if full_month?
311
317
 
312
318
  DateRange.new(self.end + 1.day, end_date)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveDateRange
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_date_range
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edwin Vlieg
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-18 00:00:00.000000000 Z
11
+ date: 2022-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '6.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '6.1'
27
27
  - !ruby/object:Gem::Dependency
@@ -145,7 +145,7 @@ metadata:
145
145
  homepage_uri: https://github.com/moneybird/active-date-range
146
146
  source_code_uri: https://github.com/moneybird/active-date-range
147
147
  changelog_uri: https://github.com/moneybird/active-date-range/blob/main/CHANGELOG.md
148
- post_install_message:
148
+ post_install_message:
149
149
  rdoc_options: []
150
150
  require_paths:
151
151
  - lib
@@ -160,8 +160,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0'
162
162
  requirements: []
163
- rubygems_version: 3.1.4
164
- signing_key:
163
+ rubygems_version: 3.2.9
164
+ signing_key:
165
165
  specification_version: 4
166
166
  summary: DateRange for ActiveSupport
167
167
  test_files: []