sportdb-formats 1.0.1 → 1.0.2

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: 29715e2e61cd99fe3520e861b1d84c4614055650
4
- data.tar.gz: e8109a80c7f79926c271560fd63f8503a44fabd2
3
+ metadata.gz: 7b1daae3f04961c06c34b98e84438ee39a80c5ca
4
+ data.tar.gz: 872154cb339bb6b6c8f440a392f250dc7d7387d9
5
5
  SHA512:
6
- metadata.gz: 8cb97f1cd4ae2d56e3b81282a7f921f99b2dcd325bafcf739e9d4c8a8bf9139fa99652a1a2804cf33604949b36b15694e7da68d851cef6d91b9b7dd727144bcf
7
- data.tar.gz: 5967f5b9558d963cd9a6974be5b53ad343b8862c84ae4640bb6c3bd6975f80ab1a687946aa2a91aeeeecb9e5908537f530eb6e837553fccfc2d92f43db082edc
6
+ metadata.gz: 853b0362fde6f9d8b17db7036ae954768500ab681acff7bf859b8cbf59b7d8bc4bec9d153f21e3c7ac069b6486b10386ce99fe151d4229df815c006a27dccbe0
7
+ data.tar.gz: e356061bfb0f15ff8274651ce107ec3be00818996d0c29a2ffb26bd5b71c385a3bd1464eea42e2e11ab60dc24ce96663a701e28fa6a8aebd27d434525c71a1f4
@@ -2,7 +2,7 @@
2
2
 
3
3
  module SportDb
4
4
 
5
- class MatchParserSimpleV2 ## simple match parser for team match schedules
5
+ class MatchParser ## simple match parser for team match schedules
6
6
 
7
7
  def self.parse( lines, teams, start: )
8
8
  ## todo/fix: add support for txt and lines
@@ -655,5 +655,5 @@ class MatchParserSimpleV2 ## simple match parser for team match schedules
655
655
 
656
656
 
657
657
 
658
- end # class MatchParserSimpleV2
658
+ end # class MatchParser
659
659
  end # module SportDb
@@ -21,6 +21,13 @@ class Team
21
21
  [@name] + @alt_names
22
22
  end ## all names
23
23
 
24
+ def key
25
+ ## note: auto-generate key "on-the-fly" if missing for now - why? why not?
26
+ ## note: quick hack - auto-generate key, that is, remove all non-ascii chars and downcase
27
+ @key || @name.downcase.gsub( /[^a-z]/, '' )
28
+ end
29
+
30
+
24
31
  ## special import only attribs
25
32
  attr_accessor :alt_names_auto ## auto-generated alt names
26
33
  attr_accessor :wikipedia # wikipedia page name (for english (en))
@@ -6,7 +6,7 @@ module Formats
6
6
 
7
7
  MAJOR = 1 ## todo: namespace inside version or something - why? why not??
8
8
  MINOR = 0
9
- PATCH = 1
9
+ PATCH = 2
10
10
  VERSION = [MAJOR,MINOR,PATCH].join('.')
11
11
 
12
12
  def self.version
@@ -17,7 +17,7 @@ class TestMatchChamps < MiniTest::Test
17
17
 
18
18
  SportDb::Import.config.lang = 'en'
19
19
 
20
- parser = SportDb::MatchParserSimpleV2.new( txt, teams, start )
20
+ parser = SportDb::MatchParser.new( txt, teams, start )
21
21
  matches, rounds, groups = parser.parse
22
22
 
23
23
  pp rounds
@@ -17,7 +17,7 @@ class TestMatchEng < MiniTest::Test
17
17
 
18
18
  start = Date.new( 2017, 7, 1 )
19
19
 
20
- parser = SportDb::MatchParserSimpleV2.new( txt, teams, start )
20
+ parser = SportDb::MatchParser.new( txt, teams, start )
21
21
  matches, rounds = parser.parse
22
22
 
23
23
  pp rounds
@@ -17,7 +17,7 @@ class TestMatchEuro < MiniTest::Test
17
17
 
18
18
  SportDb::Import.config.lang = 'en'
19
19
 
20
- parser = SportDb::MatchParserSimpleV2.new( txt, teams, start )
20
+ parser = SportDb::MatchParser.new( txt, teams, start )
21
21
  matches, rounds, groups = parser.parse
22
22
 
23
23
  pp rounds
@@ -17,7 +17,7 @@ class TestMatchWorld < MiniTest::Test
17
17
 
18
18
  SportDb::Import.config.lang = 'en'
19
19
 
20
- parser = SportDb::MatchParserSimpleV2.new( txt, teams, start )
20
+ parser = SportDb::MatchParser.new( txt, teams, start )
21
21
  matches, rounds, groups = parser.parse
22
22
 
23
23
  pp rounds
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportdb-formats
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-10 00:00:00.000000000 Z
11
+ date: 2020-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: alphabets