thu_course 0.2.4 → 0.2.6
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 +4 -4
- data/lib/thu_course/date.rb +45 -0
- data/lib/thu_course/version.rb +1 -1
- data/lib/thu_course.rb +0 -45
- data/thu_course.gemspec +1 -1
- metadata +2 -3
- data/pkg/thu_course-0.1.0.gem +0 -0
- data/pkg/thu_course-0.1.8.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfbcd10e161e3f82808c10eba1a54f7a85997237
|
4
|
+
data.tar.gz: 8590080cc05e9922ea07340a98fc462942964cb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 448079ce00387a03d9558b2159e07720292ef4dc9bd071c01990e94717b3eb6e8e5e13ccc7b445ceb97d4f4ead5119ec52e7455b13d37a8f8c2205887b66d7da
|
7
|
+
data.tar.gz: 2e55e25abd2bba2cb73b0b8f1e70fb91ba9353dabb63cf767aa6f1cbc7dcc2cfef2bca0ebfc86d99226f4c09b00aa8a0a27970ad22169462acd2bcfc954af25f
|
@@ -0,0 +1,45 @@
|
|
1
|
+
def date_change(datas)
|
2
|
+
days = '一二三四五六日'
|
3
|
+
|
4
|
+
days.each_char do |day|
|
5
|
+
datas = datas.gsub(day, ",#{day}")
|
6
|
+
end
|
7
|
+
|
8
|
+
datas = datas.split(/\/|\[|\,|\]/)
|
9
|
+
datas = datas.reverse
|
10
|
+
|
11
|
+
time = []
|
12
|
+
local = ''
|
13
|
+
hash = []
|
14
|
+
|
15
|
+
datas.each do |data|
|
16
|
+
if data.size == 1 && (data =~ /\p{han}/) != nil
|
17
|
+
day = data
|
18
|
+
case day
|
19
|
+
when '一'
|
20
|
+
day_num = 1
|
21
|
+
when '二'
|
22
|
+
day_num = 2
|
23
|
+
when '三'
|
24
|
+
day_num = 3
|
25
|
+
when '四'
|
26
|
+
day_num = 4
|
27
|
+
when '五'
|
28
|
+
day_num = 5
|
29
|
+
when '六'
|
30
|
+
day_num = 6
|
31
|
+
end
|
32
|
+
|
33
|
+
hash << { day: day_num, local: local, time: time }
|
34
|
+
time = []
|
35
|
+
elsif data != ''
|
36
|
+
if data.size >= 3
|
37
|
+
local = data
|
38
|
+
else
|
39
|
+
time << data
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
hash
|
45
|
+
end
|
data/lib/thu_course/version.rb
CHANGED
data/lib/thu_course.rb
CHANGED
@@ -86,49 +86,4 @@ module ThuCourse
|
|
86
86
|
end
|
87
87
|
hash
|
88
88
|
end
|
89
|
-
def date_change(datas)
|
90
|
-
days = '一二三四五六日'
|
91
|
-
|
92
|
-
days.each_char do |day|
|
93
|
-
datas = datas.gsub(day, ",#{day}")
|
94
|
-
end
|
95
|
-
|
96
|
-
datas = datas.split(/\/|\[|\,|\]/)
|
97
|
-
datas = datas.reverse
|
98
|
-
|
99
|
-
time = []
|
100
|
-
local = ''
|
101
|
-
hash = []
|
102
|
-
|
103
|
-
datas.each do |data|
|
104
|
-
if data.size == 1 && (data =~ /\p{han}/) != nil
|
105
|
-
day = data
|
106
|
-
case day
|
107
|
-
when '一'
|
108
|
-
day_num = 1
|
109
|
-
when '二'
|
110
|
-
day_num = 2
|
111
|
-
when '三'
|
112
|
-
day_num = 3
|
113
|
-
when '四'
|
114
|
-
day_num = 4
|
115
|
-
when '五'
|
116
|
-
day_num = 5
|
117
|
-
when '六'
|
118
|
-
day_num = 6
|
119
|
-
end
|
120
|
-
|
121
|
-
hash << { day: day_num, local: local, time: time }
|
122
|
-
time = []
|
123
|
-
elsif data != ''
|
124
|
-
if data.size >= 3
|
125
|
-
local = data
|
126
|
-
else
|
127
|
-
time << data
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
hash
|
133
|
-
end
|
134
89
|
end
|
data/thu_course.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
22
22
|
end
|
23
23
|
|
24
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } << 'lib/thu_course/date.rb'
|
25
25
|
spec.bindir = "exe"
|
26
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
27
|
spec.require_paths = ["lib"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thu_course
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- herber523
|
@@ -67,9 +67,8 @@ files:
|
|
67
67
|
- bin/console
|
68
68
|
- bin/setup
|
69
69
|
- lib/thu_course.rb
|
70
|
+
- lib/thu_course/date.rb
|
70
71
|
- lib/thu_course/version.rb
|
71
|
-
- pkg/thu_course-0.1.0.gem
|
72
|
-
- pkg/thu_course-0.1.8.gem
|
73
72
|
- thu_course.gemspec
|
74
73
|
homepage: https://github.com/herber523/thu_course
|
75
74
|
licenses: []
|
data/pkg/thu_course-0.1.0.gem
DELETED
Binary file
|
data/pkg/thu_course-0.1.8.gem
DELETED
Binary file
|