active_date_range 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/.rubocop.yml +281 -0
- data/.travis.yml +6 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +143 -0
- data/Guardfile +46 -0
- data/LICENSE +21 -0
- data/README.md +138 -0
- data/Rakefile +10 -0
- data/active_date_range.gemspec +34 -0
- data/bin/console +17 -0
- data/bin/setup +6 -0
- data/lib/active_date_range.rb +21 -0
- data/lib/active_date_range/core_ext/date.rb +10 -0
- data/lib/active_date_range/core_ext/integer.rb +12 -0
- data/lib/active_date_range/date_range.rb +293 -0
- data/lib/active_date_range/humanizer.rb +121 -0
- data/lib/active_date_range/i18n.rb +9 -0
- data/lib/active_date_range/locale/en.yml +38 -0
- data/lib/active_date_range/version.rb +5 -0
- metadata +151 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e93ef4c06d102fab1f4d60e5a6e8ef093f80f73e5d18ae80feb7b3ff952e53d3
|
4
|
+
data.tar.gz: f3e0b0fcfc7e7ae3a4085ceb6eb719b13c8b03452c7219d9570f6634768327a6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0e6ec69527db1a35890f69111e4b1a00f2d1158b2f7bfaeb5d45b51cc7f0a943876c9a4c2cb0cc6da944e251e836c02c8b3a5ccaee43b9cfb351f2cc9340159a
|
7
|
+
data.tar.gz: f5405fc96a213e444dd62a3cd4caf97601a0852937204c5261cf7cb9d979bdfca20b8920f4988af8e6ecd30cb7797e28355ff0f71781dd1cb96677d3ad56b464
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,281 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-packaging
|
3
|
+
- rubocop-performance
|
4
|
+
- rubocop-rails
|
5
|
+
|
6
|
+
AllCops:
|
7
|
+
TargetRubyVersion: 2.7
|
8
|
+
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
9
|
+
# to ignore them, so only the ones explicitly set in this file are enabled.
|
10
|
+
DisabledByDefault: true
|
11
|
+
SuggestExtensions: false
|
12
|
+
Exclude:
|
13
|
+
- '**/tmp/**/*'
|
14
|
+
- '**/templates/**/*'
|
15
|
+
- '**/vendor/**/*'
|
16
|
+
- 'actionpack/lib/action_dispatch/journey/parser.rb'
|
17
|
+
- 'actionmailbox/test/dummy/**/*'
|
18
|
+
- 'actiontext/test/dummy/**/*'
|
19
|
+
- '**/node_modules/**/*'
|
20
|
+
|
21
|
+
Performance:
|
22
|
+
Exclude:
|
23
|
+
- '**/test/**/*'
|
24
|
+
|
25
|
+
# Prefer assert_not over assert !
|
26
|
+
Rails/AssertNot:
|
27
|
+
Include:
|
28
|
+
- '**/test/**/*'
|
29
|
+
|
30
|
+
# Prefer assert_not_x over refute_x
|
31
|
+
Rails/RefuteMethods:
|
32
|
+
Include:
|
33
|
+
- '**/test/**/*'
|
34
|
+
|
35
|
+
Rails/IndexBy:
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
Rails/IndexWith:
|
39
|
+
Enabled: true
|
40
|
+
|
41
|
+
# Prefer &&/|| over and/or.
|
42
|
+
Style/AndOr:
|
43
|
+
Enabled: true
|
44
|
+
|
45
|
+
# Align `when` with `case`.
|
46
|
+
Layout/CaseIndentation:
|
47
|
+
Enabled: true
|
48
|
+
|
49
|
+
Layout/ClosingHeredocIndentation:
|
50
|
+
Enabled: true
|
51
|
+
|
52
|
+
# Align comments with method definitions.
|
53
|
+
Layout/CommentIndentation:
|
54
|
+
Enabled: true
|
55
|
+
|
56
|
+
Layout/ElseAlignment:
|
57
|
+
Enabled: true
|
58
|
+
|
59
|
+
# Align `end` with the matching keyword or starting expression except for
|
60
|
+
# assignments, where it should be aligned with the LHS.
|
61
|
+
Layout/EndAlignment:
|
62
|
+
Enabled: true
|
63
|
+
EnforcedStyleAlignWith: variable
|
64
|
+
AutoCorrect: true
|
65
|
+
|
66
|
+
Layout/EmptyLineAfterMagicComment:
|
67
|
+
Enabled: true
|
68
|
+
|
69
|
+
Layout/EmptyLinesAroundAccessModifier:
|
70
|
+
Enabled: true
|
71
|
+
EnforcedStyle: only_before
|
72
|
+
|
73
|
+
Layout/EmptyLinesAroundBlockBody:
|
74
|
+
Enabled: true
|
75
|
+
|
76
|
+
# In a regular class definition, no empty lines around the body.
|
77
|
+
Layout/EmptyLinesAroundClassBody:
|
78
|
+
Enabled: true
|
79
|
+
|
80
|
+
# In a regular method definition, no empty lines around the body.
|
81
|
+
Layout/EmptyLinesAroundMethodBody:
|
82
|
+
Enabled: true
|
83
|
+
|
84
|
+
# In a regular module definition, no empty lines around the body.
|
85
|
+
Layout/EmptyLinesAroundModuleBody:
|
86
|
+
Enabled: true
|
87
|
+
|
88
|
+
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
89
|
+
Style/HashSyntax:
|
90
|
+
Enabled: true
|
91
|
+
|
92
|
+
Layout/FirstArgumentIndentation:
|
93
|
+
Enabled: true
|
94
|
+
|
95
|
+
# Method definitions after `private` or `protected` isolated calls need one
|
96
|
+
# extra level of indentation.
|
97
|
+
Layout/IndentationConsistency:
|
98
|
+
Enabled: true
|
99
|
+
EnforcedStyle: indented_internal_methods
|
100
|
+
|
101
|
+
# Two spaces, no tabs (for indentation).
|
102
|
+
Layout/IndentationWidth:
|
103
|
+
Enabled: true
|
104
|
+
|
105
|
+
Layout/LeadingCommentSpace:
|
106
|
+
Enabled: true
|
107
|
+
|
108
|
+
Layout/SpaceAfterColon:
|
109
|
+
Enabled: true
|
110
|
+
|
111
|
+
Layout/SpaceAfterComma:
|
112
|
+
Enabled: true
|
113
|
+
|
114
|
+
Layout/SpaceAfterSemicolon:
|
115
|
+
Enabled: true
|
116
|
+
|
117
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
118
|
+
Enabled: true
|
119
|
+
|
120
|
+
Layout/SpaceAroundKeyword:
|
121
|
+
Enabled: true
|
122
|
+
|
123
|
+
Layout/SpaceAroundOperators:
|
124
|
+
Enabled: true
|
125
|
+
|
126
|
+
Layout/SpaceBeforeComma:
|
127
|
+
Enabled: true
|
128
|
+
|
129
|
+
Layout/SpaceBeforeComment:
|
130
|
+
Enabled: true
|
131
|
+
|
132
|
+
Layout/SpaceBeforeFirstArg:
|
133
|
+
Enabled: true
|
134
|
+
|
135
|
+
Style/DefWithParentheses:
|
136
|
+
Enabled: true
|
137
|
+
|
138
|
+
# Defining a method with parameters needs parentheses.
|
139
|
+
Style/MethodDefParentheses:
|
140
|
+
Enabled: true
|
141
|
+
|
142
|
+
Style/FrozenStringLiteralComment:
|
143
|
+
Enabled: true
|
144
|
+
EnforcedStyle: always
|
145
|
+
Exclude:
|
146
|
+
- 'actionview/test/**/*.builder'
|
147
|
+
- 'actionview/test/**/*.ruby'
|
148
|
+
- 'actionpack/test/**/*.builder'
|
149
|
+
- 'actionpack/test/**/*.ruby'
|
150
|
+
- 'activestorage/db/migrate/**/*.rb'
|
151
|
+
- 'activestorage/db/update_migrate/**/*.rb'
|
152
|
+
- 'actionmailbox/db/migrate/**/*.rb'
|
153
|
+
- 'actiontext/db/migrate/**/*.rb'
|
154
|
+
|
155
|
+
Style/RedundantFreeze:
|
156
|
+
Enabled: true
|
157
|
+
|
158
|
+
# Use `foo {}` not `foo{}`.
|
159
|
+
Layout/SpaceBeforeBlockBraces:
|
160
|
+
Enabled: true
|
161
|
+
|
162
|
+
# Use `foo { bar }` not `foo {bar}`.
|
163
|
+
Layout/SpaceInsideBlockBraces:
|
164
|
+
Enabled: true
|
165
|
+
EnforcedStyleForEmptyBraces: space
|
166
|
+
|
167
|
+
# Use `{ a: 1 }` not `{a:1}`.
|
168
|
+
Layout/SpaceInsideHashLiteralBraces:
|
169
|
+
Enabled: true
|
170
|
+
|
171
|
+
Layout/SpaceInsideParens:
|
172
|
+
Enabled: true
|
173
|
+
|
174
|
+
# Check quotes usage according to lint rule below.
|
175
|
+
Style/StringLiterals:
|
176
|
+
Enabled: true
|
177
|
+
EnforcedStyle: double_quotes
|
178
|
+
|
179
|
+
# Detect hard tabs, no hard tabs.
|
180
|
+
Layout/IndentationStyle:
|
181
|
+
Enabled: true
|
182
|
+
|
183
|
+
# Empty lines should not have any spaces.
|
184
|
+
Layout/TrailingEmptyLines:
|
185
|
+
Enabled: true
|
186
|
+
|
187
|
+
# No trailing whitespace.
|
188
|
+
Layout/TrailingWhitespace:
|
189
|
+
Enabled: true
|
190
|
+
|
191
|
+
# Use quotes for string literals when they are enough.
|
192
|
+
Style/RedundantPercentQ:
|
193
|
+
Enabled: true
|
194
|
+
|
195
|
+
Lint/AmbiguousOperator:
|
196
|
+
Enabled: true
|
197
|
+
|
198
|
+
Lint/AmbiguousRegexpLiteral:
|
199
|
+
Enabled: true
|
200
|
+
|
201
|
+
Lint/DuplicateRequire:
|
202
|
+
Enabled: true
|
203
|
+
|
204
|
+
Lint/ErbNewArguments:
|
205
|
+
Enabled: true
|
206
|
+
|
207
|
+
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
208
|
+
Lint/RequireParentheses:
|
209
|
+
Enabled: true
|
210
|
+
|
211
|
+
Lint/RedundantStringCoercion:
|
212
|
+
Enabled: true
|
213
|
+
|
214
|
+
Lint/UriEscapeUnescape:
|
215
|
+
Enabled: true
|
216
|
+
|
217
|
+
Lint/UselessAssignment:
|
218
|
+
Enabled: true
|
219
|
+
|
220
|
+
Lint/DeprecatedClassMethods:
|
221
|
+
Enabled: true
|
222
|
+
|
223
|
+
Style/ParenthesesAroundCondition:
|
224
|
+
Enabled: true
|
225
|
+
|
226
|
+
Style/HashTransformKeys:
|
227
|
+
Enabled: true
|
228
|
+
|
229
|
+
Style/HashTransformValues:
|
230
|
+
Enabled: true
|
231
|
+
|
232
|
+
Style/RedundantBegin:
|
233
|
+
Enabled: true
|
234
|
+
|
235
|
+
Style/RedundantReturn:
|
236
|
+
Enabled: true
|
237
|
+
AllowMultipleReturnValues: true
|
238
|
+
|
239
|
+
Style/RedundantRegexpEscape:
|
240
|
+
Enabled: true
|
241
|
+
|
242
|
+
Style/Semicolon:
|
243
|
+
Enabled: true
|
244
|
+
AllowAsExpressionSeparator: true
|
245
|
+
|
246
|
+
# Prefer Foo.method over Foo::method
|
247
|
+
Style/ColonMethodCall:
|
248
|
+
Enabled: true
|
249
|
+
|
250
|
+
Style/TrivialAccessors:
|
251
|
+
Enabled: true
|
252
|
+
|
253
|
+
Performance/BindCall:
|
254
|
+
Enabled: true
|
255
|
+
|
256
|
+
Performance/FlatMap:
|
257
|
+
Enabled: true
|
258
|
+
|
259
|
+
Performance/RedundantMerge:
|
260
|
+
Enabled: true
|
261
|
+
|
262
|
+
Performance/StartWith:
|
263
|
+
Enabled: true
|
264
|
+
|
265
|
+
Performance/EndWith:
|
266
|
+
Enabled: true
|
267
|
+
|
268
|
+
Performance/RegexpMatch:
|
269
|
+
Enabled: true
|
270
|
+
|
271
|
+
Performance/ReverseEach:
|
272
|
+
Enabled: true
|
273
|
+
|
274
|
+
Performance/UnfreezeString:
|
275
|
+
Enabled: true
|
276
|
+
|
277
|
+
Performance/DeletePrefix:
|
278
|
+
Enabled: true
|
279
|
+
|
280
|
+
Performance/DeleteSuffix:
|
281
|
+
Enabled: true
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
active_date_range (0.1.0)
|
5
|
+
activesupport (~> 6.1)
|
6
|
+
i18n
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionpack (6.1.2.1)
|
12
|
+
actionview (= 6.1.2.1)
|
13
|
+
activesupport (= 6.1.2.1)
|
14
|
+
rack (~> 2.0, >= 2.0.9)
|
15
|
+
rack-test (>= 0.6.3)
|
16
|
+
rails-dom-testing (~> 2.0)
|
17
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
18
|
+
actionview (6.1.2.1)
|
19
|
+
activesupport (= 6.1.2.1)
|
20
|
+
builder (~> 3.1)
|
21
|
+
erubi (~> 1.4)
|
22
|
+
rails-dom-testing (~> 2.0)
|
23
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
24
|
+
activesupport (6.1.2.1)
|
25
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
26
|
+
i18n (>= 1.6, < 2)
|
27
|
+
minitest (>= 5.1)
|
28
|
+
tzinfo (~> 2.0)
|
29
|
+
zeitwerk (~> 2.3)
|
30
|
+
ast (2.4.1)
|
31
|
+
builder (3.2.4)
|
32
|
+
coderay (1.1.3)
|
33
|
+
concurrent-ruby (1.1.8)
|
34
|
+
crass (1.0.6)
|
35
|
+
erubi (1.10.0)
|
36
|
+
ffi (1.14.2)
|
37
|
+
formatador (0.2.5)
|
38
|
+
guard (2.16.2)
|
39
|
+
formatador (>= 0.2.4)
|
40
|
+
listen (>= 2.7, < 4.0)
|
41
|
+
lumberjack (>= 1.0.12, < 2.0)
|
42
|
+
nenv (~> 0.1)
|
43
|
+
notiffany (~> 0.0)
|
44
|
+
pry (>= 0.9.12)
|
45
|
+
shellany (~> 0.0)
|
46
|
+
thor (>= 0.18.1)
|
47
|
+
guard-compat (1.2.1)
|
48
|
+
guard-minitest (2.4.6)
|
49
|
+
guard-compat (~> 1.2)
|
50
|
+
minitest (>= 3.0)
|
51
|
+
i18n (1.8.9)
|
52
|
+
concurrent-ruby (~> 1.0)
|
53
|
+
listen (3.4.1)
|
54
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
55
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
56
|
+
loofah (2.9.0)
|
57
|
+
crass (~> 1.0.2)
|
58
|
+
nokogiri (>= 1.5.9)
|
59
|
+
lumberjack (1.2.8)
|
60
|
+
method_source (1.0.0)
|
61
|
+
mini_portile2 (2.5.0)
|
62
|
+
minitest (5.14.2)
|
63
|
+
nenv (0.3.0)
|
64
|
+
nokogiri (1.11.1)
|
65
|
+
mini_portile2 (~> 2.5.0)
|
66
|
+
racc (~> 1.4)
|
67
|
+
notiffany (0.1.3)
|
68
|
+
nenv (~> 0.1)
|
69
|
+
shellany (~> 0.0)
|
70
|
+
parallel (1.19.2)
|
71
|
+
parser (2.7.1.4)
|
72
|
+
ast (~> 2.4.1)
|
73
|
+
pry (0.14.0)
|
74
|
+
coderay (~> 1.1)
|
75
|
+
method_source (~> 1.0)
|
76
|
+
racc (1.5.2)
|
77
|
+
rack (2.2.3)
|
78
|
+
rack-test (1.1.0)
|
79
|
+
rack (>= 1.0, < 3)
|
80
|
+
rails-dom-testing (2.0.3)
|
81
|
+
activesupport (>= 4.2.0)
|
82
|
+
nokogiri (>= 1.6)
|
83
|
+
rails-html-sanitizer (1.3.0)
|
84
|
+
loofah (~> 2.3)
|
85
|
+
railties (6.1.2.1)
|
86
|
+
actionpack (= 6.1.2.1)
|
87
|
+
activesupport (= 6.1.2.1)
|
88
|
+
method_source
|
89
|
+
rake (>= 0.8.7)
|
90
|
+
thor (~> 1.0)
|
91
|
+
rainbow (3.0.0)
|
92
|
+
rake (12.3.3)
|
93
|
+
rb-fsevent (0.10.4)
|
94
|
+
rb-inotify (0.10.1)
|
95
|
+
ffi (~> 1.0)
|
96
|
+
regexp_parser (1.8.2)
|
97
|
+
rexml (3.2.4)
|
98
|
+
rubocop (0.91.1)
|
99
|
+
parallel (~> 1.10)
|
100
|
+
parser (>= 2.7.1.1)
|
101
|
+
rainbow (>= 2.2.2, < 4.0)
|
102
|
+
regexp_parser (>= 1.7)
|
103
|
+
rexml
|
104
|
+
rubocop-ast (>= 0.4.0, < 1.0)
|
105
|
+
ruby-progressbar (~> 1.7)
|
106
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
107
|
+
rubocop-ast (0.4.2)
|
108
|
+
parser (>= 2.7.1.4)
|
109
|
+
rubocop-packaging (0.5.1)
|
110
|
+
rubocop (>= 0.89, < 2.0)
|
111
|
+
rubocop-performance (1.9.2)
|
112
|
+
rubocop (>= 0.90.0, < 2.0)
|
113
|
+
rubocop-ast (>= 0.4.0)
|
114
|
+
rubocop-rails (2.9.1)
|
115
|
+
activesupport (>= 4.2.0)
|
116
|
+
rack (>= 1.1)
|
117
|
+
rubocop (>= 0.90.0, < 2.0)
|
118
|
+
ruby-progressbar (1.10.1)
|
119
|
+
shellany (0.0.1)
|
120
|
+
thor (1.1.0)
|
121
|
+
tzinfo (2.0.4)
|
122
|
+
concurrent-ruby (~> 1.0)
|
123
|
+
unicode-display_width (1.7.0)
|
124
|
+
zeitwerk (2.4.2)
|
125
|
+
|
126
|
+
PLATFORMS
|
127
|
+
ruby
|
128
|
+
|
129
|
+
DEPENDENCIES
|
130
|
+
active_date_range!
|
131
|
+
guard
|
132
|
+
guard-minitest
|
133
|
+
minitest (~> 5.0)
|
134
|
+
pry
|
135
|
+
railties (~> 6.1)
|
136
|
+
rake (~> 12.0)
|
137
|
+
rubocop
|
138
|
+
rubocop-packaging
|
139
|
+
rubocop-performance
|
140
|
+
rubocop-rails
|
141
|
+
|
142
|
+
BUNDLED WITH
|
143
|
+
2.1.4
|