http_crawler 0.3.1.19 → 0.3.1.20

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0e50899bd853cd086eabd2be247b40fa74f6f2d0c5a50f7e5a04e6f4fba7f90
4
- data.tar.gz: b77db25f63506a1182fafd7741d83b04fea6ec9d339e8147390332937fb6f7da
3
+ metadata.gz: 3d109d5a8311a994fb759a258950f59d39c168929476dce8a5b88c0d5d406986
4
+ data.tar.gz: 427ed682c8179a3ae61a842655f66fe4c36daaf9dbe3c4864366bbb979ccdb69
5
5
  SHA512:
6
- metadata.gz: d3251a089a02bd55a1dc1a4f6fc92ded5f631e59d7e81f9d6f756a36dca09c37694b7414c61595aec900c2e2255458ebf3e7104839eba782b903a62494694fa7
7
- data.tar.gz: c8945774aa2e60f58685e78e4ba7a67aab0a8866636ee9ec4d442d5fe178530e2c3ff927d37078de8cee0056b168c5fe5b92d749056fa906f68f5dfe3eca2071
6
+ metadata.gz: d3570b4ee00c363b7e94f553cdbd731cf70050fe13f88466edd8af6f5f1ea05fb88c167941f88cfd00f185c7a6281f73dcfd0d039abde63eb2463550c1b2f9b2
7
+ data.tar.gz: a829493659b0d28db24d7eb6baf7cf3d579ffda941f42756d42a788b845fb93a07f816ec2a9e00ae7bf309be20f09df6319f3ef099a8e7bc0d314f0dfe9b75c1
@@ -10,38 +10,48 @@ class String
10
10
  def jagger_to_time
11
11
 
12
12
  # 然后先遍历所有格式
13
+ # 模糊匹配格式,放前面的优先匹配
14
+ # 如果 "%Y年%m月%d日%H:%M" 在 "%Y年%m月%d日%H:%M:%S" 前面
15
+ # 则 "2018年01月01日12:01:30".jagger_to_time => 2018-01-01 12:01:00 +0800
16
+ # 秒会被去掉
13
17
  [
14
18
  "%Y年%m月%d日%H:%M:%S",
15
- "%Y年%m月%d日 %H:%M:%S",
16
19
  "%Y年%m月%d日%H:%M",
20
+
21
+
22
+ "%Y年%m月%d日 %H:%M:%S",
17
23
  "%Y年%m月%d日 %H:%M",
18
24
 
19
- "%Y-%m-%d%H:%M:%S",
20
25
  "%Y-%m-%d %H:%M:%S",
21
- "%Y-%m-%d%H:%M",
22
26
  "%Y-%m-%d %H:%M",
23
27
 
24
- "%Y-%m-%d",
25
- "%Y年%m月%d",
26
- "%Y%m%d",
28
+ "%Y-%m-%d%H:%M:%S",
29
+ "%Y-%m-%d%H:%M",
27
30
 
28
- "%m月%d",
31
+ "%Y%m%d%H%M%S",
32
+ "%Y%m%d%H%M",
29
33
 
30
- "%m月%d日 %H%M",
31
34
  "%m月%d日 %H%M%S",
32
- "%m月%d日%H%M",
35
+ "%m月%d日 %H%M",
36
+
33
37
  "%m月%d日%H%M%S",
38
+ "%m月%d日%H%M",
34
39
 
35
- "%m月%d日 %H:%M",
36
40
  "%m月%d日 %H:%M:%S",
37
- "%m月%d日%H:%M",
41
+ "%m月%d日 %H:%M",
42
+
38
43
  "%m月%d日%H:%M:%S",
44
+ "%m月%d日%H:%M",
39
45
 
40
- "%Y%m%d%H%M%S",
41
- "%Y%m%d%H%M",
46
+ "%Y-%m-%d",
47
+ "%Y%m%d",
48
+
49
+ "%Y年%m月%d日",
50
+
51
+ "%Y年%m月",
52
+ "%m月%d日",
42
53
 
43
54
  ].each do |v|
44
- Rails.logger.debug v
45
55
  begin
46
56
  return Time.strptime(self, v)
47
57
  rescue => error
@@ -1,3 +1,3 @@
1
1
  module HttpCrawler
2
- VERSION = "0.3.1.19"
2
+ VERSION = "0.3.1.20"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_crawler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1.19
4
+ version: 0.3.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - jagger