dates_from_string 1.2.1 → 1.2.2

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: a76f9ae839c0fdee5a02955e8ad97945160be6d5
4
- data.tar.gz: 7a15b430eeabe8dfed0b6e8e48789f6f7a9a423d
3
+ metadata.gz: 3d5ae34120cfd20381e8ea4fb005d4733c0dc623
4
+ data.tar.gz: 18e134d732f77df7a41f0b00c368c6ac2fab3c61
5
5
  SHA512:
6
- metadata.gz: 192b75467a1c9dff2b1eeac438f11a1b09521bb50951f9bc6ec9e2922165e995768493e0d2bcb22e5f6179a109a6098792174f04894d7608d23e3f93cfe5fb18
7
- data.tar.gz: 31244c4419dfd1adaef4154829f6de7757b6dcb1b52e0bf31b1360097a32add22f9913b13a3fe278a46e695acc6e93686bac80c66260c1f3780539e97a7d2a22
6
+ metadata.gz: 9ec06d3b9db6b1ff654aa214290e535eff849befb5810369f9a2a6440e0c8ffc4d23e6c6f6b118c17f5b3f05ac9f0c32c8e0602414885789e4a862c9a4986b1b
7
+ data.tar.gz: 64b4ea464200375891453194d69e5036cfd3e627c8f6d01beaa4de85830e75cc96f6d643f99959cb0fce5670bf16d4bcbde14aded301ae49a164c3bf15d24248
@@ -19,15 +19,19 @@ class DatesFromString
19
19
  ] => -> string { string.to_s.split("-").reverse },
20
20
  [
21
21
  /\d{4}\.\d{2}\.\d{2}/,
22
+ /\d{4}\.\d{2}\.\d{1}/,
22
23
  ] => -> string { string.to_s.split(".") },
23
24
  [
24
25
  /\d{2}\.\d{2}\.\d{4}/,
26
+ /\d{1}\.\d{2}\.\d{4}/,
25
27
  ] => -> string { string.to_s.split(".").reverse },
26
28
  [
27
29
  /\d{4}\/\d{2}\/\d{2}/,
30
+ /\d{4}\/\d{2}\/\d{1}/,
28
31
  ] => -> string { string.to_s.split("/") },
29
32
  [
30
33
  /\d{2}\/\d{2}\/\d{4}/,
34
+ /\d{1}\/\d{2}\/\d{4}/,
31
35
  ] => -> string { string.to_s.split("/").reverse },
32
36
  }
33
37
 
@@ -150,18 +154,16 @@ class DatesFromString
150
154
  end
151
155
 
152
156
  def get_full_date(string)
153
-
154
157
  PATTERNS.keys.each do |patterns|
155
158
  patterns.each do |pattern|
156
159
  if (result = string.match(pattern))
157
160
  @clear_text.slice!(result.to_s)
158
- return PATTERNS[patterns].call result
161
+ return PATTERNS[patterns].call result
159
162
  end
160
163
  end
161
164
  end
162
165
 
163
- return nil
164
-
166
+ nil
165
167
  end
166
168
 
167
169
  def get_month_year_date(string)
@@ -1,3 +1,3 @@
1
1
  class DatesFromString
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dates_from_string
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Chechaev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-17 00:00:00.000000000 Z
11
+ date: 2017-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler