kisaweb 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/History.md CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.0.7 / 2009-10-01
2
+ * Strip all strings from API
3
+
1
4
  == 0.0.6 / 2009-10-01
2
5
  * Added Club#attributes
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
data/kisaweb.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{kisaweb}
8
- s.version = "0.0.6"
8
+ s.version = "0.0.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jarkko Laine"]
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)
@@ -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
@@ -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', fetch_categories.body).first)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kisaweb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarkko Laine