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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: faa29cc5ad59e17662e1cb77ae406d013f83379b
4
- data.tar.gz: 17852948b2120745b24070afbdf25c44ea1c6099
3
+ metadata.gz: cfbcd10e161e3f82808c10eba1a54f7a85997237
4
+ data.tar.gz: 8590080cc05e9922ea07340a98fc462942964cb9
5
5
  SHA512:
6
- metadata.gz: f4adc0f21372d3a3e7ebf70e077a907298c0d57e0d2f8a185faabe91981d5c9ac394f116e6e2e051ce1ce3f32e81fc818e9ca6028c4646e2750adafee2b7fafb
7
- data.tar.gz: 89d4ddecdab0f34e275ffeb8afbb99d44955b7bb583a3cb3d3d13780740e0b898e737258173c84c00e76f0a6f821efcb82e3292a98267d5c11183a3474aaa32a
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
@@ -1,3 +1,3 @@
1
1
  module ThuCourse
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.6"
3
3
  end
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
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: []
Binary file
Binary file