ehbrs_ruby_utils 0.30.0 → 0.32.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 +4 -4
- data/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress.rb +17 -0
- data/lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base/format_option.rb +22 -0
- data/lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base/format_player.rb +27 -0
- data/lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base.rb +68 -0
- data/lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/beginning/format_player.rb +24 -0
- data/lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/beginning.rb +35 -0
- data/lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/ending/format_player.rb +32 -0
- data/lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/ending.rb +45 -0
- data/lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters.rb +13 -0
- data/lib/ehbrs_ruby_utils/gjt1/manager.rb +8 -5
- data/lib/ehbrs_ruby_utils/version.rb +1 -1
- data/spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_84920871_2023-06-12.target.yaml +20 -0
- data/spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_84920871_2023-06-19.source.html +8650 -0
- data/spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_84920871_2023-06-19.target.yaml +41 -0
- data/spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93167144_2023-06-12.target.yaml +2 -0
- data/spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93205235_2023-06-12.target.yaml +6 -0
- data/spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93212034_2023-06-12.target.yaml +14 -0
- data/spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93223573_2023-06-12.target.yaml +3 -0
- metadata +18 -15
- data/lib/ehbrs_ruby_utils/bga/table_whatsapp_formatter/format_option.rb +0 -18
- data/lib/ehbrs_ruby_utils/bga/table_whatsapp_formatter/format_player.rb +0 -30
- data/lib/ehbrs_ruby_utils/bga/table_whatsapp_formatter.rb +0 -66
@@ -0,0 +1,41 @@
|
|
1
|
+
---
|
2
|
+
- :id: 388505886
|
3
|
+
:status: asyncopen
|
4
|
+
- :id: 388504786
|
5
|
+
:status: asyncopen
|
6
|
+
- :id: 386869621
|
7
|
+
:status: asyncplay
|
8
|
+
- :id: 386650521
|
9
|
+
:status: asyncplay
|
10
|
+
- :id: 386653901
|
11
|
+
:status: asyncplay
|
12
|
+
- :id: 386538047
|
13
|
+
:status: asyncplay
|
14
|
+
- :id: 386107349
|
15
|
+
:status: asyncplay
|
16
|
+
- :id: 385834996
|
17
|
+
:status: asyncplay
|
18
|
+
- :id: 385698263
|
19
|
+
:status: asyncplay
|
20
|
+
- :id: 385694780
|
21
|
+
:status: asyncplay
|
22
|
+
- :id: 385359528
|
23
|
+
:status: asyncplay
|
24
|
+
- :id: 384903532
|
25
|
+
:status: asyncplay
|
26
|
+
- :id: 384212341
|
27
|
+
:status: asyncplay
|
28
|
+
- :id: 383714070
|
29
|
+
:status: asyncplay
|
30
|
+
- :id: 383405743
|
31
|
+
:status: asyncplay
|
32
|
+
- :id: 382781153
|
33
|
+
:status: asyncplay
|
34
|
+
- :id: 378760639
|
35
|
+
:status: asyncplay
|
36
|
+
- :id: 378397710
|
37
|
+
:status: asyncplay
|
38
|
+
- :id: 377545689
|
39
|
+
:status: asyncplay
|
40
|
+
- :id: 375601108
|
41
|
+
:status: asyncplay
|
@@ -1,15 +1,29 @@
|
|
1
1
|
---
|
2
2
|
- :id: 386538047
|
3
|
+
:status: asyncplay
|
3
4
|
- :id: 385834996
|
5
|
+
:status: asyncplay
|
4
6
|
- :id: 385698263
|
7
|
+
:status: asyncplay
|
5
8
|
- :id: 385694780
|
9
|
+
:status: asyncplay
|
6
10
|
- :id: 385359528
|
11
|
+
:status: asyncplay
|
7
12
|
- :id: 384903532
|
13
|
+
:status: asyncplay
|
8
14
|
- :id: 384212341
|
15
|
+
:status: asyncplay
|
9
16
|
- :id: 383403753
|
17
|
+
:status: asyncplay
|
10
18
|
- :id: 383405743
|
19
|
+
:status: asyncplay
|
11
20
|
- :id: 382781153
|
21
|
+
:status: asyncplay
|
12
22
|
- :id: 382715267
|
23
|
+
:status: asyncplay
|
13
24
|
- :id: 378760639
|
25
|
+
:status: asyncplay
|
14
26
|
- :id: 378760858
|
27
|
+
:status: asyncplay
|
15
28
|
- :id: 375601108
|
29
|
+
:status: asyncplay
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ehbrs_ruby_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.32.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo H. Bogoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.21'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
46
|
+
version: '0.21'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: aranha-selenium
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,20 +132,14 @@ dependencies:
|
|
132
132
|
requirements:
|
133
133
|
- - "~>"
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version: '0.
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 0.117.1
|
135
|
+
version: '0.118'
|
139
136
|
type: :runtime
|
140
137
|
prerelease: false
|
141
138
|
version_requirements: !ruby/object:Gem::Requirement
|
142
139
|
requirements:
|
143
140
|
- - "~>"
|
144
141
|
- !ruby/object:Gem::Version
|
145
|
-
version: '0.
|
146
|
-
- - ">="
|
147
|
-
- !ruby/object:Gem::Version
|
148
|
-
version: 0.117.1
|
142
|
+
version: '0.118'
|
149
143
|
- !ruby/object:Gem::Dependency
|
150
144
|
name: eac_templates
|
151
145
|
requirement: !ruby/object:Gem::Requirement
|
@@ -258,9 +252,14 @@ files:
|
|
258
252
|
- lib/ehbrs_ruby_utils/bga/table.rb
|
259
253
|
- lib/ehbrs_ruby_utils/bga/table/option.rb
|
260
254
|
- lib/ehbrs_ruby_utils/bga/table/player.rb
|
261
|
-
- lib/ehbrs_ruby_utils/bga/
|
262
|
-
- lib/ehbrs_ruby_utils/bga/
|
263
|
-
- lib/ehbrs_ruby_utils/bga/
|
255
|
+
- lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters.rb
|
256
|
+
- lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base.rb
|
257
|
+
- lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base/format_option.rb
|
258
|
+
- lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base/format_player.rb
|
259
|
+
- lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/beginning.rb
|
260
|
+
- lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/beginning/format_player.rb
|
261
|
+
- lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/ending.rb
|
262
|
+
- lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/ending/format_player.rb
|
264
263
|
- lib/ehbrs_ruby_utils/bga/urls.rb
|
265
264
|
- lib/ehbrs_ruby_utils/circular_list_spreader.rb
|
266
265
|
- lib/ehbrs_ruby_utils/circular_list_spreader/base_level.rb
|
@@ -333,6 +332,8 @@ files:
|
|
333
332
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec.rb
|
334
333
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_84920871_2023-06-12.source.html
|
335
334
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_84920871_2023-06-12.target.yaml
|
335
|
+
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_84920871_2023-06-19.source.html
|
336
|
+
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_84920871_2023-06-19.target.yaml
|
336
337
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93167144_2023-06-12.source.html
|
337
338
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93167144_2023-06-12.target.yaml
|
338
339
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93205235_2023-06-12.source.html
|
@@ -451,6 +452,7 @@ test_files:
|
|
451
452
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93248308_2023-06-12.target.yaml
|
452
453
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93167144_2023-06-12.target.yaml
|
453
454
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93167144_2023-06-12.source.html
|
455
|
+
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_84920871_2023-06-19.source.html
|
454
456
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93205235_2023-06-12.target.yaml
|
455
457
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93223573_2023-06-12.target.yaml
|
456
458
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93212034_2023-06-12.target.yaml
|
@@ -458,6 +460,7 @@ test_files:
|
|
458
460
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_84920871_2023-06-12.target.yaml
|
459
461
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93205235_2023-06-12.source.html
|
460
462
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93248308_2023-06-12.source.html
|
463
|
+
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_84920871_2023-06-19.target.yaml
|
461
464
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec_files/player_93212034_2023-06-12.source.html
|
462
465
|
- spec/lib/ehbrs_ruby_utils/bga/parsers/game_in_progress_spec.rb
|
463
466
|
- spec/lib/ehbrs_ruby_utils/circular_list_spreader_spec.rb
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module EhbrsRubyUtils
|
6
|
-
module Bga
|
7
|
-
class TableWhatsappFormatter
|
8
|
-
class FormatOption
|
9
|
-
enable_method_class
|
10
|
-
common_constructor :table_formatter, :option
|
11
|
-
|
12
|
-
def result
|
13
|
-
"*#{option.label}:* #{option.value}"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module EhbrsRubyUtils
|
6
|
-
module Bga
|
7
|
-
class TableWhatsappFormatter
|
8
|
-
class FormatPlayer
|
9
|
-
enable_method_class
|
10
|
-
common_constructor :table_formatter, :player
|
11
|
-
|
12
|
-
FIELD_SEPARATOR = ' - '
|
13
|
-
|
14
|
-
def result
|
15
|
-
%w[table_rank name score].map { |v| send(v) }.join(FIELD_SEPARATOR)
|
16
|
-
end
|
17
|
-
|
18
|
-
def table_rank
|
19
|
-
"*#{player.rank}º*"
|
20
|
-
end
|
21
|
-
|
22
|
-
delegate :name, to: :player
|
23
|
-
|
24
|
-
def score
|
25
|
-
"⭐ #{player.score}"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,66 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'ehbrs_ruby_utils/bga/session'
|
4
|
-
require 'ehbrs_ruby_utils/executables'
|
5
|
-
require 'eac_ruby_utils/core_ext'
|
6
|
-
|
7
|
-
module EhbrsRubyUtils
|
8
|
-
module Bga
|
9
|
-
class TableWhatsappFormatter
|
10
|
-
enable_simple_cache
|
11
|
-
common_constructor :table
|
12
|
-
|
13
|
-
TITLE_BEFORE = 0x22D8.chr(::Encoding::UTF_8) + ' '
|
14
|
-
TITLE_AFTER = ' ' + 0x22D9.chr(::Encoding::UTF_8)
|
15
|
-
|
16
|
-
ROOT_ITENS = {
|
17
|
-
'Jogo' => :game_name,
|
18
|
-
'Criada em' => :creation_time,
|
19
|
-
'Duração' => :estimated_duration,
|
20
|
-
'Endereço' => :url
|
21
|
-
}.freeze
|
22
|
-
SECTION_SEPARATOR = "\n\n"
|
23
|
-
|
24
|
-
# @return [Pathname]
|
25
|
-
def image_local_path
|
26
|
-
table.game.box_large_image.local_path
|
27
|
-
end
|
28
|
-
|
29
|
-
def to_s
|
30
|
-
[root_items_to_s, players_to_s, options_to_s].map(&:strip).join(SECTION_SEPARATOR)
|
31
|
-
end
|
32
|
-
|
33
|
-
def root_items_to_s
|
34
|
-
title_to_s('Mesa terminada') + ROOT_ITENS.map { |k, v| "*#{k}*: #{table.send(v)}" }
|
35
|
-
.join("\n")
|
36
|
-
end
|
37
|
-
|
38
|
-
# @return [String]
|
39
|
-
def game_conceded_to_s
|
40
|
-
table.game_conceded? ? "*Derrota admitida*\n\n" : ''
|
41
|
-
end
|
42
|
-
|
43
|
-
def players_to_s
|
44
|
-
title_to_s('Resultado') + game_conceded_to_s + players.join("\n")
|
45
|
-
end
|
46
|
-
|
47
|
-
def options_to_s
|
48
|
-
title_to_s('Opções') + options.join("\n")
|
49
|
-
end
|
50
|
-
|
51
|
-
def title_to_s(title)
|
52
|
-
"*#{TITLE_BEFORE}#{title}#{TITLE_AFTER}*\n\n"
|
53
|
-
end
|
54
|
-
|
55
|
-
def players
|
56
|
-
table.players.map { |player| format_player(player) }
|
57
|
-
end
|
58
|
-
|
59
|
-
def options
|
60
|
-
table.options.map { |player| format_option(player) }
|
61
|
-
end
|
62
|
-
|
63
|
-
require_sub __FILE__, require_mode: :kernel
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|