recurring_date 0.1.2 → 0.1.3
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 +4 -4
- data/.rubocop.yml +9 -28
- data/.travis.yml +10 -0
- data/Gemfile.lock +19 -1
- data/Rakefile +2 -0
- data/lib/recurring_date/enumerator.rb +9 -7
- data/lib/recurring_date/version.rb +3 -1
- data/lib/recurring_date.rb +2 -0
- data/recurring_date.gemspec +1 -0
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47eca2cf9b435d180d5e63eb24d9d246c24fdc5e90c9f6d808939da559a0f5c9
|
4
|
+
data.tar.gz: 16ae2eececc53d9172c454cc7b33bcff6ed0412b881fb3b9db56c2624be860fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18f8b4b771227c2aa0a1952c4580e0faeb2fa55e101e459aeb8cfc2f780862572a38a0a1d618b020fc259c947ab8a5ab9fb6a4e8e62100fe65dcfa28b4ee05f0
|
7
|
+
data.tar.gz: c291d583bace030628577d720425be954fff113b88c1c6fdb7d6fb9a5dc2eae67a0cee850fc72426911bd9119202f9be90925cfada45113b765ab36fa1643ccf
|
data/.rubocop.yml
CHANGED
@@ -1,39 +1,20 @@
|
|
1
1
|
AllCops:
|
2
|
-
Include:
|
3
|
-
- '**/Gemfile'
|
4
2
|
Exclude:
|
5
3
|
- '**/Gemfile*'
|
6
4
|
- '**/*.gemspec'
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
Style/WhileUntilModifier:
|
11
|
-
MaxLineLength: 120
|
12
|
-
Metrics/LineLength:
|
5
|
+
- 'bin/*'
|
6
|
+
TargetRubyVersion: 2.6.5
|
7
|
+
Layout/LineLength:
|
13
8
|
Max: 120
|
14
|
-
Metrics/MethodLength:
|
15
|
-
Max: 25
|
16
|
-
Metrics/AbcSize:
|
17
|
-
Max: 50
|
18
9
|
Metrics/ClassLength:
|
19
10
|
Enabled: false
|
20
11
|
Metrics/BlockLength:
|
21
12
|
Enabled: false
|
13
|
+
Style/HashEachMethods:
|
14
|
+
Enabled: true
|
15
|
+
Style/HashTransformKeys:
|
16
|
+
Enabled: true
|
17
|
+
Style/HashTransformValues:
|
18
|
+
Enabled: true
|
22
19
|
Style/Documentation:
|
23
20
|
Enabled: false
|
24
|
-
Style/AlignParameters:
|
25
|
-
EnforcedStyle: with_fixed_indentation
|
26
|
-
Style/MultilineMethodCallIndentation:
|
27
|
-
EnforcedStyle: indented
|
28
|
-
Style/DotPosition:
|
29
|
-
EnforcedStyle: trailing
|
30
|
-
Style/MultilineHashBraceLayout:
|
31
|
-
Enabled: false
|
32
|
-
Style/Lambda:
|
33
|
-
Enabled: false
|
34
|
-
Style/CharacterLiteral:
|
35
|
-
Enabled: false
|
36
|
-
Style/CharacterLiteral:
|
37
|
-
Enabled: false
|
38
|
-
Style/FrozenStringLiteralComment:
|
39
|
-
Enabled: false
|
data/.travis.yml
ADDED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,20 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
recurring_date (0.1.
|
4
|
+
recurring_date (0.1.3)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
ast (2.4.0)
|
9
10
|
diff-lcs (1.3)
|
11
|
+
jaro_winkler (1.5.4)
|
12
|
+
parallel (1.19.1)
|
13
|
+
parser (2.7.0.5)
|
14
|
+
ast (~> 2.4.0)
|
15
|
+
rainbow (3.0.0)
|
10
16
|
rake (12.3.3)
|
17
|
+
rexml (3.2.4)
|
11
18
|
rspec (3.5.0)
|
12
19
|
rspec-core (~> 3.5.0)
|
13
20
|
rspec-expectations (~> 3.5.0)
|
@@ -21,6 +28,16 @@ GEM
|
|
21
28
|
diff-lcs (>= 1.2.0, < 2.0)
|
22
29
|
rspec-support (~> 3.5.0)
|
23
30
|
rspec-support (3.5.0)
|
31
|
+
rubocop (0.80.1)
|
32
|
+
jaro_winkler (~> 1.5.1)
|
33
|
+
parallel (~> 1.10)
|
34
|
+
parser (>= 2.7.0.1)
|
35
|
+
rainbow (>= 2.2.2, < 4.0)
|
36
|
+
rexml
|
37
|
+
ruby-progressbar (~> 1.7)
|
38
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
39
|
+
ruby-progressbar (1.10.1)
|
40
|
+
unicode-display_width (1.6.1)
|
24
41
|
|
25
42
|
PLATFORMS
|
26
43
|
ruby
|
@@ -30,6 +47,7 @@ DEPENDENCIES
|
|
30
47
|
rake (~> 12.3)
|
31
48
|
recurring_date!
|
32
49
|
rspec (~> 3.0)
|
50
|
+
rubocop (~> 0.80)
|
33
51
|
|
34
52
|
BUNDLED WITH
|
35
53
|
1.17.3
|
data/Rakefile
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'date'
|
2
4
|
|
3
5
|
module RecurringDate
|
4
6
|
class Enumerator < ::Enumerator
|
5
7
|
def initialize(range)
|
6
8
|
super() do |result|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
nil
|
11
|
-
end
|
9
|
+
range.each { |val| block_given? ? yield(result, val) : result << val }
|
10
|
+
rescue ::StopIteration
|
11
|
+
nil
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -102,10 +102,11 @@ module RecurringDate
|
|
102
102
|
RecurringDate::Enumerator.new(self) { |result, value| result << value unless yield(value) }
|
103
103
|
end
|
104
104
|
|
105
|
-
def take(
|
106
|
-
taken =
|
105
|
+
def take(number)
|
106
|
+
taken = number
|
107
107
|
RecurringDate::Enumerator.new(self) do |result, value|
|
108
108
|
raise ::StopIteration if taken.zero?
|
109
|
+
|
109
110
|
result << value
|
110
111
|
taken -= 1
|
111
112
|
end
|
@@ -114,6 +115,7 @@ module RecurringDate
|
|
114
115
|
def take_while
|
115
116
|
RecurringDate::Enumerator.new(self) do |result, value|
|
116
117
|
raise ::StopIteration unless yield(value)
|
118
|
+
|
117
119
|
result << value
|
118
120
|
end
|
119
121
|
end
|
data/lib/recurring_date.rb
CHANGED
data/recurring_date.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recurring_date
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paweł Placzyński
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.80'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.80'
|
55
69
|
description: Iterate over a set of dates, giving an iteration conditions.
|
56
70
|
email:
|
57
71
|
- placzynski.pawel@gmail.com
|
@@ -65,6 +79,7 @@ files:
|
|
65
79
|
- ".rubocop.yml"
|
66
80
|
- ".ruby-gemset"
|
67
81
|
- ".ruby-version"
|
82
|
+
- ".travis.yml"
|
68
83
|
- Gemfile
|
69
84
|
- Gemfile.lock
|
70
85
|
- LICENSE
|