dates_from_string 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dates_from_string/version.rb +1 -1
- data/lib/parsing_structure.rb +17 -15
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98fe2e3e849f5760bd532ad4c48976cf4164859f
|
4
|
+
data.tar.gz: e716c189b4f6612b5ff9b858c1fbe636d8c07c75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 974f4f2f5e0d61b4e4cdb499fcfdc0b8c075f09e7dc36d06f15c7883f90eaca3650746f867088886c67e76029bdc81a9cca78ec6cbdb61dc7e45b08c2b40128e
|
7
|
+
data.tar.gz: daeaba06a1e1811f7448988d3e8a64ee81871183284a825b1add5e4c2f75baf702b00f4718a431f29e4ca22e253f12d4a0f7d34e76da5648a61d54a752b05620
|
data/lib/parsing_structure.rb
CHANGED
@@ -12,21 +12,23 @@ class ParsingStructure
|
|
12
12
|
month = nil
|
13
13
|
day = nil
|
14
14
|
|
15
|
-
@structure
|
16
|
-
|
17
|
-
year
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
month
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
day
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
15
|
+
if @structure
|
16
|
+
@structure.each do |item|
|
17
|
+
if item[:type] == :year && item[:distance] == 0
|
18
|
+
year = item[:value]
|
19
|
+
end
|
20
|
+
|
21
|
+
if item[:type] == :month && item[:distance] == 0
|
22
|
+
month = item[:value]
|
23
|
+
end
|
24
|
+
|
25
|
+
if item[:type] == :day && item[:distance] == 0
|
26
|
+
day = item[:value]
|
27
|
+
end
|
28
|
+
|
29
|
+
if year && month && day
|
30
|
+
array_of_full_data << [year,month,day].join("-")
|
31
|
+
end
|
30
32
|
end
|
31
33
|
end
|
32
34
|
|