module ScoreFormats
todo/fix: make logging class configurable - lets you use logutils etc.
Constants
- DE__ET_FT_HT_P__RE
support all-in-one “literal form e.g. 2:2 (1:1, 1:0) n.V. 5:1 i.E. or 2-2 (1-1, 1-0) n.V. 5-1 i.E.
- DE__FT_HT__RE
e.g. 2:1 (1:1) or
2-1 (1-1) or 2:1 or 2-1
- DE__P_ET_FT_HT__RE
support alternate all-in-one score e.g.
i.E. 2:4, n.V. 3:3 (1:1, 1:1) or n.V. 3:2 (2:2, 1:2)
- EN__FT_HT__RE
e.g. 2-1 (1-1) or
2-1
note: for now add here used in Brazil / Portugal
e.g 1x1 or 1X1 or 0x2 or 3x3 too todo/check/fix: move to its own use PT__FT_HT etc!!!!
- EN__P_ET_FT_HT__RE
e.g. 3-4 pen. 2-2 a.e.t. (1-1, 1-1) or
3-4 pen. 2-2 a.e.t. (1-1, ) or 3-4 pen. 2-2 a.e.t. (1-1) or 2-2 a.e.t. (1-1, 1-1) or 2-2 a.e.t. (1-1, ) or 2-2 a.e.t. (1-1)
- EN__P_ET__RE
note: allow SPECIAL cases WITHOUT full time scores (just a.e.t or pen. + a.e.t.)
3-4 pen. 2-2 a.e.t. 2-2 a.e.t.
- EN__P_FT_HT__RE
special case for case WITHOUT extra time!!
same as above (but WITHOUT extra time and pen required)
- ET_DE
- ET_EN
- FORMATS
- FORMATS_DE
- FORMATS_EN
map tables - 1) regex, 2) tag - note: order matters; first come-first matched/served
- MAJOR
- MINOR
- PATCH
- P_DE
deutsch / german helpers (penalty, extra time, …) todo add more marker e.g. im Elf. or such!!!
- P_EN
english helpers (penalty, extra time, …)
- VERSION
Public Class Methods
find!( line, lang: ScoreFormats.lang )
click to toggle source
# File lib/score-formats.rb, line 51 def self.find!( line, lang: ScoreFormats.lang ) parser( lang: lang ).find!( line ) end
lang()
click to toggle source
# File lib/score-formats.rb, line 31 def self.lang @@lang ||= :en ## defaults to english (:en) end
lang=( value )
click to toggle source
# File lib/score-formats.rb, line 34 def self.lang=( value ) @@lang = value.to_sym ## note: make sure lang is always a symbol for now (NOT a string) @@lang ## todo/check: remove =() method always returns passed in value? double check end
parse( line, lang: ScoreFormats.lang )
click to toggle source
# File lib/score-formats.rb, line 47 def self.parse( line, lang: ScoreFormats.lang ) parser( lang: lang ).parse( line ) end
parser( lang: )
click to toggle source
# File lib/score-formats.rb, line 39 def self.parser( lang: ) ## find parser lang = lang.to_sym ## note: make sure lang is always a symbol for now (NOT a string) ## note: cache all "built-in" lang versions (e.g. formats == nil) @@parser ||= {} @@parser[ lang ] ||= ScoreParser.new( lang: lang ) end
root()
click to toggle source
# File lib/score-formats/version.rb, line 16 def self.root File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) ) end
version()
click to toggle source
# File lib/score-formats/version.rb, line 8 def self.version VERSION end