sportdb-sync 0.0.1 → 0.1.0

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: 03f672e265c84d8bcac59a05381705e7b64acc69
4
- data.tar.gz: 3fcdc3f0bbc5968e641fb0b873e473b10adbe94e
3
+ metadata.gz: 9189544ea7204fc5b6f2f11ee1c73dfc6c052a26
4
+ data.tar.gz: 22c9e9825e8af300213bdaa222bcf1ee457477fe
5
5
  SHA512:
6
- metadata.gz: 98d27e26d97d13eab1fb49907e77bac2f326592451fedc7f839b26d0e96ba659fef61c44d1bd0bb5addccd79c948ef42b1926ea6091a06eaca42eaa01eca369b
7
- data.tar.gz: 8913f9a0a783e93b43a2db943164812888e85c60675d9602b18d87745909905512bc8f0ac58264ce8789140e4ad00bf4aea6b90b2c0061468b5dc70aa5b75a4c
6
+ metadata.gz: fdb749934627aeca879237a42ba50f7284a8c25eef611208b8aea00f9209655e705dbab01c5ae2a0a7bc51509db2c3ed465a26dfc0c60a12e8e73b6dac26caf6
7
+ data.tar.gz: 5a4005e89e00f18b339198f545b2fa3402531fcc6e4798399defcbc0d2d42f1c7a79f6757e10e85a2667c77d421883d4f80f976240bfeb5e2d2f02f2d5b85740
@@ -98,18 +98,22 @@ module Sync
98
98
  def self.find_or_create( club )
99
99
  rec = SportDb::Model::Team.find_by( title: club.name )
100
100
  if rec.nil?
101
- ## remove all non-ascii a-z chars
102
- key = club.name.downcase.gsub( /[^a-z]/, '' )
101
+ ## check if key is present otherwise generate e.g. remove all non-ascii a-z chars
102
+ key = club.key || club.name.downcase.gsub( /[^a-z]/, '' )
103
103
  puts "add club: #{key}, #{club.name}, #{club.country.name} (#{club.country.key})"
104
104
 
105
105
  attribs = {
106
- key: key,
107
- title: club.name,
106
+ key: key,
107
+ title: club.name,
108
108
  country_id: Country.find_or_create( club.country ).id,
109
109
  club: true,
110
110
  national: false ## check -is default anyway - use - why? why not?
111
111
  ## todo/fix: add city if present - why? why not?
112
112
  }
113
+
114
+ attribs[:code] = club.code if club.code ## add code (abbreviation) if present
115
+
116
+
113
117
  if club.alt_names.empty? == false
114
118
  attribs[:synonyms] = club.alt_names.join('|')
115
119
  end
@@ -5,8 +5,8 @@ module SportDb
5
5
  module Sync
6
6
 
7
7
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
8
- MINOR = 0
9
- PATCH = 1
8
+ MINOR = 1
9
+ PATCH = 0
10
10
  VERSION = [MAJOR,MINOR,PATCH].join('.')
11
11
 
12
12
  def self.version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportdb-sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-04 00:00:00.000000000 Z
11
+ date: 2019-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sportdb-clubs