scoppie 0.0.5 → 0.0.6
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 +5 -5
- data/README.md +4 -0
- data/lib/scope.rb +3 -1
- data/lib/scope_methods.rb +17 -1
- data/lib/scoppie.rb +0 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 485bd57c5b4da9582adfc393197db908b88accdb5b70a835714401c05da86bb4
|
4
|
+
data.tar.gz: '08a30d4d7425176a666389719e89cbb381ad6fcdd59cf2ea1e448ef8018d984e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a9658ad30c4dd937cbb6a73a85f930a62f066d751c45064fb9ae93602a391e9ee6bbf5e36f9646c23ac62fce506d565464d51883c5f8c6640e7eb407e1c729d
|
7
|
+
data.tar.gz: 2c9a05a5e6ff15d93445d4b9341944dc400760b9411f0d8acd4eec3491638019b537eff5a67741046e1b645e98a632122374b9c8401f07987b0054085ca38411
|
data/README.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
[](https://codeclimate.com/github/gedean/scoppie)
|
2
|
+
|
3
|
+
[](https://snap-ci.com/gedean/scoppie/branch/master)
|
4
|
+
|
1
5
|
# Scoppie
|
2
6
|
|
3
7
|
Easy handling of Brazilian's Ministry of Health files scopes (Year and Month)
|
data/lib/scope.rb
CHANGED
data/lib/scope_methods.rb
CHANGED
@@ -91,8 +91,24 @@ module ScopeMethods
|
|
91
91
|
def <=>(other)
|
92
92
|
to_date <=> other.to_date
|
93
93
|
end
|
94
|
+
|
95
|
+
def span(end_scope)
|
96
|
+
(end_scope = Scope.new(end_scope)) unless end_scope.is_a?(Scope)
|
97
|
+
|
98
|
+
raise "Current Scope (#{to_s}) bigger or equal to end scope (#{end_scope.to_s})" if (self >= end_scope)
|
99
|
+
|
100
|
+
scope_span = []
|
101
|
+
current_scope = Scope.new(to_s)
|
102
|
+
|
103
|
+
while current_scope <= end_scope
|
104
|
+
scope_span << current_scope
|
105
|
+
current_scope = current_scope.next
|
106
|
+
end
|
107
|
+
scope_span
|
108
|
+
end
|
109
|
+
|
110
|
+
private
|
94
111
|
|
95
|
-
private
|
96
112
|
def get_short_value
|
97
113
|
raise "year (#{year}) shorten than #{MIN_ACCEPTED_YEAR}" if year < MIN_ACCEPTED_YEAR
|
98
114
|
"#{year - 2000}#{month_to_s}"
|
data/lib/scoppie.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scoppie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gedean Dias
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Easy scope handling of brazilian's Ministry of Health files names (Year
|
14
14
|
and Month)
|
@@ -40,8 +40,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
requirements: []
|
43
|
-
|
44
|
-
rubygems_version: 2.6.2
|
43
|
+
rubygems_version: 3.0.4
|
45
44
|
signing_key:
|
46
45
|
specification_version: 4
|
47
46
|
summary: File name Scope Handler
|