str2duck 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/VERSION +1 -1
  3. data/lib/str2duck/regexp.rb +6 -5
  4. metadata +3 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmRlMGM0ZGZhNmI3ZWZkOTQ3ZTVhYjJjYjcxYTIxMWZhMWQxMTc1Ng==
4
+ MjQ5OTVjODIxNWFiMDUwMmNiNmE3YzRjNDA1NzQ1MDFiNTkyYzMzOQ==
5
5
  data.tar.gz: !binary |-
6
- NjViNmI0MjdjOWQ1ZTBmNjYyYmY4Nzc2N2MxZGMxNzJiMGNmN2U1YQ==
6
+ ZGM1M2Q4ZjdjOGVhODM2MmFkMTViM2QyNjJkZWVkYjBkMWJjN2I3Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDMzZTZkZDBjNzY2OTA1YjhhYzg0MDJjN2NjYWJjOWQ2ZmY5YzM5YTc0N2M4
10
- MjM2M2Y4NGNkMDY1NmU0ZmY0ZTFhZTYwNTAxNTQ4OWFmY2VlYWJlZDEyNWJj
11
- NDEwOWZmNjY1NmMxNTZmZGEzMDgxYTdmM2ZlMWRkYzFmZmM1YTE=
9
+ NzFhODk0YWNjNzFjYjI2YjgyNmI2ZGE5MTBmNTE5YTQ3MjY2MzIxMzNkMGZh
10
+ ZWNjYjVlMjIwOGZmOGY1YzY5YmE1ZTI1MDIwMzg2MGM4OWFlNjU1M2RiOTEz
11
+ NzRmYTA0MmFiMzgzNjQ4YjdmNzIyNTMzYTVjZDBhMGRkM2NkNTE=
12
12
  data.tar.gz: !binary |-
13
- OWUyMGU4NTM4MzBjMDIxYjE0OTM2OTc3ZDI5ZGRmZjI0OTNjZTYxMzE3OTQ4
14
- MzMzNzQ1YmI1OGI5YWVkN2RhNjBkOWQ5NzAxMWIyMzhhMTFlMDc0MGUwOTU0
15
- NjRmOTFhM2UyNzQ1MjUwNDg2NGI0OTBkY2NmNTM4ZTM0YWJjNmE=
13
+ Zjg4MDc4MDg5YmE0MTk3ZmQwOWMxOWRkMDFlYzFkOWJiZGM1MThkNWU3NDY1
14
+ YWNjN2I0ZjM2MjJiOGMxYWZmNDA3NWM4MWJiNDdmMGU1OTk3MWU2ZTkzMGZl
15
+ Zjg5NGUzNThiMTM0NGE0YmIxZjA4MzczNGFlMGE1ODg4N2VjMWI=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -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+ \d\d\d\d \d\d:\d\d:\d\d \+\d+$/,
11
- /^\d\d\d\d-\d\d-\d\d\w\d\d:\d\d:\d\d\+\d\d:\d\d$/
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
- /^\d\d\d\d-\d\d-\d\d$/,
25
- /^\w+, \d+ \w+ \d\d\d\d$/
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
- /^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d \+\d+$/
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.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-02-27 00:00:00.000000000 Z
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: