ehbrs-tools 0.44.4 → 0.45.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
  SHA256:
3
- metadata.gz: a2d340b38b2c6dc986be3e9d8e0853d678768a7005bc721d984d9f345686bd23
4
- data.tar.gz: 10af26165b43b80305d9e9c5c8260da9b66a905c7fd5216e8805c2b1d3168aa3
3
+ metadata.gz: 4871fdbe39fd4c1ff63a67d28e24fa050a4c78351b26942d483c3c1d0b9e8a45
4
+ data.tar.gz: 52a686bec03dff223e5b5993129bb4e776a064aa14b6049e5d34ce946560fb0e
5
5
  SHA512:
6
- metadata.gz: 93fd4f518e772df460d114ed636bed38b07c6d80f8ce0cfd7eaf28443fed104489ab94adfcf288b86d966f370d98d95d3fdcae90be520a846c60cf5b2767aac4
7
- data.tar.gz: 60064f2f0a98314e7373937f6f7f0acc4131f75a8ad7b4ce95c7a8d601956b21c94a908fa7880261725d199e39196736eab5d32eb63913030109d5f13160d702
6
+ metadata.gz: 865bb626af3aa09df3452e531b9944fe0bb66c672dd9e89f607879e95dd657e9da9b6ba362c7d92d2f3d92cf5d0f76a83ce0fdf4ba353de9b395137a5f9a3b17
7
+ data.tar.gz: 62be3d1cbe06e7c68c788e9ea6919071dafc40ef25caa44c1429a5053f39e383afa7bdb42e8b299aabb23af258628ec037c80f791825348d451b79d084dd2220
data/Gemfile.lock CHANGED
@@ -1,17 +1,28 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ehbrs-tools (0.44.4)
4
+ ehbrs-tools (0.45.0)
5
5
  avm-tools (~> 0.164)
6
- eac_cli (~> 0.45)
7
- eac_fs (~> 0.20, >= 0.20.1)
6
+ eac_cli (~> 0.46)
7
+ eac_fs (~> 0.20, >= 0.20.2)
8
8
  eac_ruby_base0 (~> 0.19, >= 0.19.3)
9
- eac_ruby_utils (~> 0.130)
10
- ehbrs_ruby_utils (~> 0.48, >= 0.48.2)
9
+ eac_ruby_utils (~> 0.131)
10
+ ehbrs_ruby_utils (~> 0.49)
11
11
  filesize (~> 0.2)
12
12
  os (~> 1.1, >= 1.1.4)
13
13
  telegram-bot-ruby (~> 0.23)
14
14
 
15
+ PATH
16
+ remote: sub/aranha-parsers
17
+ specs:
18
+ aranha-parsers (0.28.0)
19
+ activesupport (>= 4.0.0)
20
+ addressable (~> 2.9)
21
+ aranha (~> 0.20)
22
+ eac_envs-http (~> 0.7, >= 0.7.1)
23
+ eac_ruby_utils (~> 0.131)
24
+ nokogiri (~> 1.19, >= 1.19.3)
25
+
15
26
  PATH
16
27
  remote: sub/aranha-selenium
17
28
  specs:
@@ -26,16 +37,16 @@ PATH
26
37
  PATH
27
38
  remote: sub/ehbrs_ruby_utils
28
39
  specs:
29
- ehbrs_ruby_utils (0.48.2)
40
+ ehbrs_ruby_utils (0.49.0)
30
41
  aranha (~> 0.20)
31
- aranha-parsers (~> 0.26, >= 0.26.3)
42
+ aranha-parsers (~> 0.28)
32
43
  aranha-selenium (~> 0.14)
33
- avm (~> 0.98, >= 0.98.5)
44
+ avm (~> 0.100)
34
45
  avm-eac_rails_base0 (~> 0.11, >= 0.11.2)
35
46
  dentaku (~> 3.5, >= 3.5.7)
36
- eac_fs (~> 0.20, >= 0.20.1)
47
+ eac_fs (~> 0.20, >= 0.20.2)
37
48
  eac_rest (~> 0.13)
38
- eac_ruby_utils (~> 0.130)
49
+ eac_ruby_utils (~> 0.131)
39
50
  eac_templates (~> 0.8, >= 0.8.3)
40
51
  inifile (~> 3.0)
41
52
  srt (~> 0.1, >= 0.1.5)
@@ -55,21 +66,13 @@ GEM
55
66
  public_suffix (>= 2.0.2, < 8.0)
56
67
  aranha (0.20.0)
57
68
  eac_ruby_utils (~> 0.128)
58
- aranha-parsers (0.26.3)
59
- activesupport (>= 4.0.0)
60
- addressable (~> 2.8, >= 2.8.9)
61
- aranha (~> 0.20)
62
- eac_envs-http (~> 0.7, >= 0.7.1)
63
- eac_ruby_utils (~> 0.130)
64
- nokogiri (~> 1.19, >= 1.19.1)
65
- ofx-parser (~> 1.1)
66
69
  ast (2.4.3)
67
70
  attr_extras (7.1.0)
68
- avm (0.98.5)
69
- eac_cli (~> 0.45)
71
+ avm (0.100.0)
72
+ eac_cli (~> 0.46)
70
73
  eac_config (~> 0.15)
71
74
  eac_docker (~> 0.8)
72
- eac_fs (~> 0.20)
75
+ eac_fs (~> 0.20, >= 0.20.1)
73
76
  eac_ruby_utils (~> 0.130)
74
77
  eac_templates (~> 0.8, >= 0.8.3)
75
78
  minitar (~> 0.12, >= 0.12.1)
@@ -87,12 +90,12 @@ GEM
87
90
  avm-eac_ruby_base1 (~> 0.39)
88
91
  avm-eac_webapp_base0 (~> 0.22)
89
92
  eac_ruby_utils (~> 0.130)
90
- avm-eac_ruby_base1 (0.39.0)
91
- aranha-parsers (~> 0.26, >= 0.26.2)
92
- avm (~> 0.98, >= 0.98.4)
93
+ avm-eac_ruby_base1 (0.41.1)
94
+ aranha-parsers (~> 0.27)
95
+ avm (~> 0.100)
93
96
  avm-eac_generic_base0 (~> 0.15, >= 0.15.2)
94
97
  eac_envs-http (~> 0.7, >= 0.7.1)
95
- eac_ruby_utils (~> 0.129)
98
+ eac_ruby_utils (~> 0.131)
96
99
  avm-eac_ubuntu_base0 (0.7.0)
97
100
  avm (~> 0.98, >= 0.98.2)
98
101
  eac_ruby_utils (~> 0.128, >= 0.128.6)
@@ -112,7 +115,7 @@ GEM
112
115
  ice_nine (~> 0.11.0)
113
116
  thread_safe (~> 0.3, >= 0.3.1)
114
117
  base64 (0.3.0)
115
- bigdecimal (4.1.1)
118
+ bigdecimal (4.1.2)
116
119
  clipboard (2.0.0)
117
120
  coercible (1.0.0)
118
121
  descendants_tracker (~> 0.0.1)
@@ -128,11 +131,11 @@ GEM
128
131
  diff-lcs (1.6.2)
129
132
  drb (2.2.3)
130
133
  dry-inflector (1.3.1)
131
- eac_cli (0.45.0)
134
+ eac_cli (0.46.0)
132
135
  clipboard (~> 2.0)
133
136
  colorize (~> 0.8, >= 0.8.1)
134
137
  eac_config (~> 0.15)
135
- eac_ruby_utils (~> 0.128, >= 0.128.6)
138
+ eac_ruby_utils (~> 0.130)
136
139
  tty-table (~> 0.12)
137
140
  eac_config (0.15.0)
138
141
  addressable (~> 2.8, >= 2.8.7)
@@ -150,9 +153,9 @@ GEM
150
153
  faraday-retry (~> 2.4)
151
154
  random-port (~> 0.7, >= 0.7.6)
152
155
  webrick
153
- eac_fs (0.20.1)
156
+ eac_fs (0.20.2)
154
157
  content-type (~> 0.0, >= 0.0.2)
155
- eac_ruby_utils (~> 0.130)
158
+ eac_ruby_utils (~> 0.131)
156
159
  filesize (~> 0.2)
157
160
  ruby-filemagic (~> 0.7, >= 0.7.3)
158
161
  eac_rest (0.13.0)
@@ -164,19 +167,20 @@ GEM
164
167
  eac_cli (~> 0.45)
165
168
  eac_fs (~> 0.20)
166
169
  eac_ruby_utils (~> 0.129)
167
- eac_ruby_gem_support (0.12.2)
168
- eac_ruby_utils (~> 0.130)
170
+ eac_ruby_gem_support (0.13.0)
171
+ eac_ruby_utils (~> 0.131)
169
172
  rspec (~> 3.13, >= 3.13.2)
170
- rubocop (~> 1.85, >= 1.85.1)
173
+ rubocop (~> 1.86, >= 1.86.1)
171
174
  rubocop-rails (~> 2.34, >= 2.34.3)
172
175
  rubocop-rspec (~> 3.9)
173
- super_diff (~> 0.18)
174
- eac_ruby_utils (0.130.0)
176
+ super_diff (~> 0.19)
177
+ eac_ruby_utils (0.131.0)
175
178
  activesupport (>= 4, < 7)
176
- addressable (~> 2.8, >= 2.8.8)
179
+ addressable (~> 2.9)
177
180
  bundler
181
+ memoized (~> 1.1, >= 1.1.3)
178
182
  net-ssh (~> 4.2)
179
- zeitwerk (~> 2.7, >= 2.7.4)
183
+ zeitwerk (~> 2.7, >= 2.7.5)
180
184
  eac_templates (0.8.3)
181
185
  eac_config (~> 0.15)
182
186
  eac_ruby_utils (~> 0.128, >= 0.128.5)
@@ -196,28 +200,26 @@ GEM
196
200
  faraday-retry (2.4.0)
197
201
  faraday (~> 2.0)
198
202
  filesize (0.2.0)
199
- hpricot (0.8.6)
200
203
  htmlbeautifier (1.4.3)
201
204
  i18n (1.14.8)
202
205
  concurrent-ruby (~> 1.0)
203
206
  ice_nine (0.11.2)
204
207
  inifile (3.0.0)
205
- json (2.19.3)
208
+ json (2.19.5)
206
209
  language_server-protocol (3.17.0.5)
207
210
  lint_roller (1.1.0)
208
211
  logger (1.7.0)
212
+ memoized (1.1.3)
209
213
  minitar (0.12.1)
210
- minitest (6.0.3)
214
+ minitest (6.0.6)
211
215
  drb (~> 2.0)
212
216
  prism (~> 1.5)
213
217
  multipart-post (2.4.1)
214
218
  net-http (0.9.1)
215
219
  uri (>= 0.11.1)
216
220
  net-ssh (4.2.0)
217
- nokogiri (1.19.2-x86_64-linux-gnu)
221
+ nokogiri (1.19.3-x86_64-linux-gnu)
218
222
  racc (~> 1.4)
219
- ofx-parser (1.1.0)
220
- hpricot (>= 0.6)
221
223
  optimist (3.2.1)
222
224
  os (1.1.4)
223
225
  parallel (1.28.0)
@@ -251,7 +253,7 @@ GEM
251
253
  diff-lcs (>= 1.2.0, < 2.0)
252
254
  rspec-support (~> 3.13.0)
253
255
  rspec-support (3.13.7)
254
- rubocop (1.86.1)
256
+ rubocop (1.86.2)
255
257
  json (~> 2.3)
256
258
  language_server-protocol (~> 3.17.0.2)
257
259
  lint_roller (~> 1.1.0)
@@ -265,7 +267,7 @@ GEM
265
267
  rubocop-ast (1.49.1)
266
268
  parser (>= 3.3.7.2)
267
269
  prism (~> 1.7)
268
- rubocop-rails (2.34.3)
270
+ rubocop-rails (2.35.0)
269
271
  activesupport (>= 4.2.0)
270
272
  lint_roller (~> 1.1)
271
273
  rack (>= 1.1)
@@ -276,8 +278,8 @@ GEM
276
278
  rubocop (~> 1.81)
277
279
  ruby-filemagic (0.7.3)
278
280
  ruby-progressbar (1.13.0)
279
- rubyzip (3.2.2)
280
- selenium-webdriver (4.43.0)
281
+ rubyzip (3.3.0)
282
+ selenium-webdriver (4.44.0)
281
283
  base64 (~> 0.2)
282
284
  logger (~> 1.4)
283
285
  rexml (~> 3.2, >= 3.2.5)
@@ -289,10 +291,10 @@ GEM
289
291
  unicode-display_width (>= 1.5, < 3.0)
290
292
  unicode_utils (~> 1.4)
291
293
  strings-ansi (0.2.0)
292
- super_diff (0.18.0)
293
- attr_extras (>= 6.2.4)
294
- diff-lcs
295
- patience_diff
294
+ super_diff (0.19.0)
295
+ attr_extras (>= 6.2.4, < 8)
296
+ diff-lcs (~> 1.5)
297
+ patience_diff (~> 1.2)
296
298
  taglib-ruby (1.1.3)
297
299
  tago (0.7.0)
298
300
  telegram-bot-ruby (0.23.0)
@@ -328,8 +330,9 @@ PLATFORMS
328
330
  x86_64-linux-gnu
329
331
 
330
332
  DEPENDENCIES
333
+ aranha-parsers!
331
334
  aranha-selenium!
332
- eac_ruby_gem_support (~> 0.12, >= 0.12.2)
335
+ eac_ruby_gem_support (~> 0.13)
333
336
  ehbrs-tools!
334
337
  ehbrs_ruby_utils!
335
338
 
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ehbrs
4
+ module Tools
5
+ module Accommodations
6
+ class Runner
7
+ class << self
8
+ # @return [String]
9
+ def organization_name
10
+ module_parent.name.demodulize
11
+ end
12
+ end
13
+
14
+ the_class = self
15
+
16
+ runner_with :help, :output_list do
17
+ desc "Extrai as acomodações de uma página-lista do #{the_class.organization_name}."
18
+ pos_arg :url
19
+ end
20
+
21
+ def run
22
+ run_output
23
+ infov 'Actual count found', list_rows.count
24
+ infov 'Declared count', processor.declared_count
25
+ result, message = counts_result
26
+ send(result, message)
27
+ end
28
+
29
+ protected
30
+
31
+ # @return [Array]
32
+ def counts_result
33
+ if list_rows.count == processor.declared_count
34
+ [:success, 'Ok!']
35
+ else
36
+ [:warn, 'Actual and declared counts are different']
37
+ end
38
+ end
39
+
40
+ # @return [Enumerable<Array<String>>]
41
+ def fields
42
+ self.class.const_get('FIELDS')
43
+ end
44
+
45
+ # @return [Class]
46
+ def processor_class
47
+ [self.class.organization_name, 'Processors', 'List']
48
+ .inject(::EhbrsRubyUtils) { |a, e| a.const_get(e) }
49
+ end
50
+
51
+ # @return [Object]
52
+ def processor_uncached
53
+ processor_class.new(url)
54
+ end
55
+
56
+ # @return [Array<Symbol>]
57
+ def list_columns
58
+ fields.map(&:first)
59
+ end
60
+
61
+ # @return [Array<Object>]
62
+ def list_rows
63
+ processor.accommodations
64
+ end
65
+
66
+ # @return [Addressable::URI]
67
+ def url
68
+ parsed.url.to_uri
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ehbrs
4
+ module Tools
5
+ class Runner
6
+ class Airbnb
7
+ class Accommodations < ::Ehbrs::Tools::Accommodations::Runner
8
+ FIELDS = [
9
+ [:link, 'Link'],
10
+ [:price, 'Total'],
11
+ [:type, 'Tipo'],
12
+ [:address, 'Endereço'],
13
+ [:review_score, 'Nota'],
14
+ [:review_count, 'Avaliações']
15
+ ].freeze
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ehbrs
4
+ module Tools
5
+ class Runner
6
+ class Airbnb
7
+ runner_with :help, :subcommands do
8
+ desc 'Utilidades para o site airbnb.com.'
9
+ subcommands
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -4,7 +4,7 @@ module Ehbrs
4
4
  module Tools
5
5
  class Runner
6
6
  class Booking
7
- class Accommodations
7
+ class Accommodations < ::Ehbrs::Tools::Accommodations::Runner
8
8
  FIELDS = [
9
9
  [:link, 'Link'],
10
10
  [:price, 'Diárias'],
@@ -16,52 +16,6 @@ module Ehbrs
16
16
  [:review_count, 'Avaliações'],
17
17
  [:unit_title, 'Descrição']
18
18
  ].freeze
19
-
20
- runner_with :help, :output_list do
21
- desc 'Extrai as acomodações de uma página-lista do Booking.'
22
- pos_arg :url
23
- end
24
-
25
- def run
26
- run_output
27
- infov 'Actual count found', list_rows.count
28
- infov 'Declared count', processor.declared_count
29
- result, message = counts_result
30
- send(result, message)
31
- end
32
-
33
- protected
34
-
35
- # @return [Array]
36
- def counts_result
37
- if list_rows.count == processor.declared_count
38
- [:success, 'Ok!']
39
- elsif list_rows.count > processor.declared_count
40
- [:warn, 'Actual count is greater than declared']
41
- else
42
- [:fatal_error, 'Actual and declared counts are different']
43
- end
44
- end
45
-
46
- # @return [EhbrsRubyUtils::Booking::Processors::List]
47
- def processor_uncached
48
- ::EhbrsRubyUtils::Booking::Processors::List.new(url)
49
- end
50
-
51
- # @return [Array<Symbol>]
52
- def list_columns
53
- FIELDS.map(&:first)
54
- end
55
-
56
- # @return [Array<Object>]
57
- def list_rows
58
- processor.accommodations
59
- end
60
-
61
- # @return [Addressable::URI]
62
- def url
63
- parsed.url.to_uri
64
- end
65
19
  end
66
20
  end
67
21
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ehbrs
4
4
  module Tools
5
- VERSION = '0.44.4'
5
+ VERSION = '0.45.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ehbrs-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.44.4
4
+ version: 0.45.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-04-17 00:00:00.000000000 Z
11
+ date: 2026-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm-tools
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.45'
33
+ version: '0.46'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.45'
40
+ version: '0.46'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: eac_fs
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -47,7 +47,7 @@ dependencies:
47
47
  version: '0.20'
48
48
  - - ">="
49
49
  - !ruby/object:Gem::Version
50
- version: 0.20.1
50
+ version: 0.20.2
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -57,7 +57,7 @@ dependencies:
57
57
  version: '0.20'
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 0.20.1
60
+ version: 0.20.2
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: eac_ruby_base0
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -84,34 +84,28 @@ dependencies:
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '0.130'
87
+ version: '0.131'
88
88
  type: :runtime
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: '0.130'
94
+ version: '0.131'
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: ehbrs_ruby_utils
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: '0.48'
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- version: 0.48.2
101
+ version: '0.49'
105
102
  type: :runtime
106
103
  prerelease: false
107
104
  version_requirements: !ruby/object:Gem::Requirement
108
105
  requirements:
109
106
  - - "~>"
110
107
  - !ruby/object:Gem::Version
111
- version: '0.48'
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- version: 0.48.2
108
+ version: '0.49'
115
109
  - !ruby/object:Gem::Dependency
116
110
  name: filesize
117
111
  requirement: !ruby/object:Gem::Requirement
@@ -166,20 +160,14 @@ dependencies:
166
160
  requirements:
167
161
  - - "~>"
168
162
  - !ruby/object:Gem::Version
169
- version: '0.12'
170
- - - ">="
171
- - !ruby/object:Gem::Version
172
- version: 0.12.2
163
+ version: '0.13'
173
164
  type: :development
174
165
  prerelease: false
175
166
  version_requirements: !ruby/object:Gem::Requirement
176
167
  requirements:
177
168
  - - "~>"
178
169
  - !ruby/object:Gem::Version
179
- version: '0.12'
180
- - - ">="
181
- - !ruby/object:Gem::Version
182
- version: 0.12.2
170
+ version: '0.13'
183
171
  description:
184
172
  email:
185
173
  executables:
@@ -193,6 +181,7 @@ files:
193
181
  - exe/ehbrs
194
182
  - lib/ehbrs.rb
195
183
  - lib/ehbrs/tools.rb
184
+ - lib/ehbrs/tools/accommodations/runner.rb
196
185
  - lib/ehbrs/tools/application.rb
197
186
  - lib/ehbrs/tools/executables.rb
198
187
  - lib/ehbrs/tools/google/translate/session.rb
@@ -200,6 +189,8 @@ files:
200
189
  - lib/ehbrs/tools/observers/base.rb
201
190
  - lib/ehbrs/tools/observers/with_persistence.rb
202
191
  - lib/ehbrs/tools/runner.rb
192
+ - lib/ehbrs/tools/runner/airbnb.rb
193
+ - lib/ehbrs/tools/runner/airbnb/accommodations.rb
203
194
  - lib/ehbrs/tools/runner/booking.rb
204
195
  - lib/ehbrs/tools/runner/booking/accommodations.rb
205
196
  - lib/ehbrs/tools/runner/cooking_book.rb
@@ -270,7 +261,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
270
261
  requirements:
271
262
  - - ">="
272
263
  - !ruby/object:Gem::Version
273
- version: 2.7.0
264
+ version: '3.2'
274
265
  required_rubygems_version: !ruby/object:Gem::Requirement
275
266
  requirements:
276
267
  - - ">="