kisaweb 0.0.6 → 0.0.7
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.
- data/History.md +3 -0
- data/VERSION +1 -1
- data/kisaweb.gemspec +1 -1
- data/lib/kisaweb/club.rb +1 -1
- data/lib/kisaweb/contest.rb +1 -1
- data/lib/kisaweb/online_ranki.rb +4 -3
- data/spec/club_spec.rb +4 -0
- metadata +1 -1
data/History.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
data/kisaweb.gemspec
CHANGED
data/lib/kisaweb/club.rb
CHANGED
@@ -39,7 +39,7 @@ module Kisaweb
|
|
39
39
|
|
40
40
|
def self.find_all
|
41
41
|
res = fetch_all
|
42
|
-
res_arr = FasterCSV.parse(Iconv.iconv('utf-8', 'latin1', res.body).first)
|
42
|
+
res_arr = FasterCSV.parse(Iconv.iconv('utf-8', 'latin1', res.body).first.strip)
|
43
43
|
res_arr.shift
|
44
44
|
res_arr.map do |row|
|
45
45
|
from_csv_array(row)
|
data/lib/kisaweb/contest.rb
CHANGED
@@ -37,7 +37,7 @@ module Kisaweb
|
|
37
37
|
|
38
38
|
def self.find_all
|
39
39
|
res = fetch_all
|
40
|
-
res_arr = FasterCSV.parse(Iconv.iconv('utf-8', 'latin1', res.body).first)
|
40
|
+
res_arr = FasterCSV.parse(Iconv.iconv('utf-8', 'latin1', res.body).first.strip)
|
41
41
|
res_arr.map do |row|
|
42
42
|
Contest.from_csv_array(row)
|
43
43
|
end
|
data/lib/kisaweb/online_ranki.rb
CHANGED
@@ -2,7 +2,7 @@ module Kisaweb
|
|
2
2
|
class OnlineRanki < Kisaweb::Base
|
3
3
|
def self.find(klass)
|
4
4
|
res = fetch_class(:klass => klass)
|
5
|
-
res_arr = FasterCSV.parse(Iconv.iconv('utf-8', 'latin1', res.body).first)
|
5
|
+
res_arr = FasterCSV.parse(Iconv.iconv('utf-8', 'latin1', res.body).first.strip)
|
6
6
|
res_arr.shift
|
7
7
|
res_arr.map do |row|
|
8
8
|
ListItem.from_array(row)
|
@@ -10,11 +10,12 @@ module Kisaweb
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.date
|
13
|
-
@@date ||= Date.parse(Iconv.iconv('utf-8', 'latin1', fetch_date.body).first)
|
13
|
+
@@date ||= Date.parse(Iconv.iconv('utf-8', 'latin1', fetch_date.body).first.strip)
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.categories
|
17
|
-
@@categories ||= parse_categories(Iconv.iconv('utf-8', 'latin1',
|
17
|
+
@@categories ||= parse_categories(Iconv.iconv('utf-8', 'latin1',
|
18
|
+
fetch_categories.body).first.strip)
|
18
19
|
end
|
19
20
|
|
20
21
|
private
|
data/spec/club_spec.rb
CHANGED
@@ -49,6 +49,10 @@ describe Kisaweb::Club do
|
|
49
49
|
it "should fetch and build clubs" do
|
50
50
|
@clubs.first.abbreviation.should == "AOK"
|
51
51
|
end
|
52
|
+
|
53
|
+
it "should not have empty clubs" do
|
54
|
+
@clubs.select{|c| c.name.nil? && c.abbreviation.nil? }.size.should == 0
|
55
|
+
end
|
52
56
|
end
|
53
57
|
|
54
58
|
describe "find" do
|