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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0de1067f7e7ac78707b253cf7f0d4eb147b3d6ff
4
- data.tar.gz: 32d18ebc707205cdf3dccbd4e92de3212c0b6c59
3
+ metadata.gz: 98fe2e3e849f5760bd532ad4c48976cf4164859f
4
+ data.tar.gz: e716c189b4f6612b5ff9b858c1fbe636d8c07c75
5
5
  SHA512:
6
- metadata.gz: ab721b5f27f71e8ed03373445398319115d69aa9e260434dd05178ea284fa4343cbdf26632cfd5c29effaa6b2e9cef5500f6ca164daed220e8e14279e3269d93
7
- data.tar.gz: 58d6a2a8ff27200ae4d7996a70d842ddc62eb67f9800650395f207320ff2ff540f9720883a08348c9119d58bdbba4a88787f42020ae939d166858e3ecfd173ad
6
+ metadata.gz: 974f4f2f5e0d61b4e4cdb499fcfdc0b8c075f09e7dc36d06f15c7883f90eaca3650746f867088886c67e76029bdc81a9cca78ec6cbdb61dc7e45b08c2b40128e
7
+ data.tar.gz: daeaba06a1e1811f7448988d3e8a64ee81871183284a825b1add5e4c2f75baf702b00f4718a431f29e4ca22e253f12d4a0f7d34e76da5648a61d54a752b05620
@@ -1,3 +1,3 @@
1
1
  class DatesFromString
2
- VERSION = "0.9.4"
2
+ VERSION = "0.9.5"
3
3
  end
@@ -12,21 +12,23 @@ class ParsingStructure
12
12
  month = nil
13
13
  day = nil
14
14
 
15
- @structure.each do |item|
16
- if item[:type] == :year && item[:distance] == 0
17
- year = item[:value]
18
- end
19
-
20
- if item[:type] == :month && item[:distance] == 0
21
- month = item[:value]
22
- end
23
-
24
- if item[:type] == :day && item[:distance] == 0
25
- day = item[:value]
26
- end
27
-
28
- if year && month && day
29
- array_of_full_data << [year,month,day].join("-")
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dates_from_string
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Chechaev