str2duck 1.0.0 → 1.0.1
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 +8 -8
- data/VERSION +1 -1
- data/lib/str2duck/regexp.rb +6 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjQ5OTVjODIxNWFiMDUwMmNiNmE3YzRjNDA1NzQ1MDFiNTkyYzMzOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGM1M2Q4ZjdjOGVhODM2MmFkMTViM2QyNjJkZWVkYjBkMWJjN2I3Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzFhODk0YWNjNzFjYjI2YjgyNmI2ZGE5MTBmNTE5YTQ3MjY2MzIxMzNkMGZh
|
10
|
+
ZWNjYjVlMjIwOGZmOGY1YzY5YmE1ZTI1MDIwMzg2MGM4OWFlNjU1M2RiOTEz
|
11
|
+
NzRmYTA0MmFiMzgzNjQ4YjdmNzIyNTMzYTVjZDBhMGRkM2NkNTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Zjg4MDc4MDg5YmE0MTk3ZmQwOWMxOWRkMDFlYzFkOWJiZGM1MThkNWU3NDY1
|
14
|
+
YWNjN2I0ZjM2MjJiOGMxYWZmNDA3NWM4MWJiNDdmMGU1OTk3MWU2ZTkzMGZl
|
15
|
+
Zjg5NGUzNThiMTM0NGE0YmIxZjA4MzczNGFlMGE1ODg4N2VjMWI=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
data/lib/str2duck/regexp.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
#encoding: UTF-8
|
2
2
|
module Str2Duck
|
3
3
|
module Regexp
|
4
|
+
@@year = '\d+'
|
4
5
|
class << self
|
5
6
|
|
6
7
|
def datetime? obj
|
7
8
|
|
8
9
|
answer_value= nil
|
9
10
|
[
|
10
|
-
/^\w+, \d+ \w+
|
11
|
-
|
11
|
+
/^\w+, \d+ \w+ #{@@year} \d\d:\d\d:\d\d \+\d+$/,
|
12
|
+
/^#{@@year}-\d\d-\d\d\w\d\d:\d\d:\d\d\+\d\d:\d\d$/
|
12
13
|
].each do |regexp|
|
13
14
|
answer_value ||= obj =~ regexp
|
14
15
|
end
|
@@ -21,8 +22,8 @@ module Str2Duck
|
|
21
22
|
|
22
23
|
answer_value= nil
|
23
24
|
[
|
24
|
-
|
25
|
-
/^\w+, \d+ \w+
|
25
|
+
/^#{@@year}-\d\d-\d\d$/,
|
26
|
+
/^\w+, \d+ \w+ #{@@year}$/
|
26
27
|
].each do |regexp|
|
27
28
|
answer_value ||= obj =~ regexp
|
28
29
|
end
|
@@ -35,7 +36,7 @@ module Str2Duck
|
|
35
36
|
|
36
37
|
answer_value= nil
|
37
38
|
[
|
38
|
-
|
39
|
+
/^#{@@year}-\d\d-\d\d \d\d:\d\d:\d\d \+\d+$/
|
39
40
|
].each do |regexp|
|
40
41
|
answer_value ||= obj =~ regexp
|
41
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: str2duck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ! ' Parse string into obj '
|
14
14
|
email:
|
@@ -58,3 +58,4 @@ signing_key:
|
|
58
58
|
specification_version: 4
|
59
59
|
summary: String to Obj, Duck type parser
|
60
60
|
test_files: []
|
61
|
+
has_rdoc:
|