fbtxt2json 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -0
  3. data/README.md +5 -0
  4. data/Rakefile +3 -4
  5. data/bin/fbtxt2json +15 -10
  6. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8956db527655b3b148c5e0ee4d456cbb26ce6444d382ae65c9a651c6e3c29a1b
4
- data.tar.gz: 695ffa9fff51b0f0e0e0751d7a3366344ccf13a2524abe87a10264a3c6087ffd
3
+ metadata.gz: '0840ecd85960fd8947a270f5df38fd20bb865b9c6105c6dd16f684d89c30c7e4'
4
+ data.tar.gz: 5a321670218d38604964438bf1ff4b36fceb6a322a4b92c2120ce22d8dd32292
5
5
  SHA512:
6
- metadata.gz: 54a88a9c80c4113334ae6c6a4ba1381349bcb6b17ded024381fdc95bd9706e71a8ab4e87e586f2e0e8610a8c5db7db0d9fbcca232fcb65e6343cd3ec166c5bba
7
- data.tar.gz: 1d890a6514ab755a99f188c67974fc160f55a8e34ef946e926186754a0d0dd4110ce359920a1aadebfd0f50b7e9a50419acba7952af4323c796d490739ac590b
6
+ metadata.gz: eb3fe0e7e9a32e9808bdad2b7c0a018be63a8712341444a00cc0392802476c057844216b591e562d0ab6912d1ac11142b5a6831307dd66a9f347c6e40afe434f
7
+ data.tar.gz: fc9fd0cd07ab989aafc6ab1250e9da657d37be5901845c8c9b38faa7f6631c11abcd66c4e036f6898e5e98e96752c5d718fc2e2b08f18a1242ca12bcf095860a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,4 @@
1
+ ### 0.1.0
1
2
  ### 0.0.1 / 2024-09-28
2
3
 
3
4
  * Everything is new. First release.
data/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # fbtxt2json - convert football.txt match schedules & more to json
2
2
 
3
3
 
4
+ * home :: [github.com/sportdb/sport.db](https://github.com/sportdb/sport.db)
5
+ * bugs :: [github.com/sportdb/sport.db/issues](https://github.com/sportdb/sport.db/issues)
6
+ * gem :: [rubygems.org/gems/fbtxt2json](https://rubygems.org/gems/fbtxt2json)
7
+ * rdoc :: [rubydoc.info/gems/fbtxt2json](http://rubydoc.info/gems/fbtxt2json)
8
+
4
9
 
5
10
  ## Step 0 - Installation Via Gems
6
11
 
data/Rakefile CHANGED
@@ -2,8 +2,7 @@ require 'hoe'
2
2
 
3
3
 
4
4
  Hoe.spec 'fbtxt2json' do
5
-
6
- self.version = '0.0.1'
5
+ self.version = '0.1.0'
7
6
 
8
7
  self.summary = "fbtxt2json - convert football.txt match schedules & more to json"
9
8
  self.description = summary
@@ -11,7 +10,7 @@ Hoe.spec 'fbtxt2json' do
11
10
  self.urls = { home: 'https://github.com/sportdb/sport.db' }
12
11
 
13
12
  self.author = 'Gerald Bauer'
14
- self.email = 'gerald.bauer@gmail.com'
13
+ self.email = 'gerald.bauer@gmail.com'
15
14
 
16
15
  # switch extension to .markdown for gihub formatting
17
16
  self.readme_file = 'README.md'
@@ -20,7 +19,7 @@ Hoe.spec 'fbtxt2json' do
20
19
  self.licenses = ['Public Domain']
21
20
 
22
21
  self.extra_deps = [
23
- ['sportdb-quick', '>= 0.2.0'],
22
+ ['sportdb-quick', '>= 0.2.1'],
24
23
  ]
25
24
 
26
25
  self.spec_extras = {
data/bin/fbtxt2json CHANGED
@@ -47,14 +47,11 @@ puts "ARGV:"
47
47
  p args
48
48
 
49
49
 
50
- path = if args.empty?
51
- '../../../openfootball/euro/2021--europe/euro.txt'
52
- elsif args.size == 1
53
- args[0]
54
- else
55
- puts "!! wrong number of args, got #{args.size} - #{args.inspect} - only one arg supported/expected"
56
- exit 1
57
- end
50
+ paths = if args.empty?
51
+ ['../../../openfootball/euro/2021--europe/euro.txt']
52
+ else
53
+ args
54
+ end
58
55
 
59
56
 
60
57
  if opts[:debug]
@@ -67,8 +64,16 @@ else
67
64
  end
68
65
 
69
66
 
70
- puts "==> reading >#{path}<..."
71
- quick = SportDb::QuickMatchReader.new( read_text( path ) )
67
+ ## step 1 - concat(enate) all text files into one
68
+ txt = String.new
69
+ paths.each_with_index do |path,i|
70
+ puts "==> reading [#{i+1}/#{paths.size}] >#{path}<..."
71
+ txt += "\n\n" if i > 0
72
+ txt += read_text( path )
73
+ end
74
+
75
+ ## step 2 - parse (matches) in the football.txt format
76
+ quick = SportDb::QuickMatchReader.new( txt )
72
77
  matches = quick.parse
73
78
  name = quick.league_name ## quick hack - get league+season via league_name
74
79
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbtxt2json
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: 2024-09-28 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sportdb-quick
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.0
19
+ version: 0.2.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.0
26
+ version: 0.2.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rdoc
29
29
  requirement: !ruby/object:Gem::Requirement