ehbrs-tools 0.41.0 → 0.42.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d7f1950bd86260645e7a5bb92ec7fcb41c59c8331385f2a277c685be0ca470d
4
- data.tar.gz: 9d8ddf77d0b5d447a6d223f30e3c9206ba97a84674219512b76cf844010f6051
3
+ metadata.gz: 17103baebd9aeaadd439e2f9d655af21e97ce4e5e717e4d95220cef79eb5822e
4
+ data.tar.gz: 41818ac788289578893d8f4c3717e848029c59d9a43ed2c60f2c99fd8db8a8db
5
5
  SHA512:
6
- metadata.gz: b962d14dc1c1c7dd202c8c21a9686238679f29c12b160f9e4bfe4c38650f73309e16011909105f7daf7fe4daa0eaa198eea8163b25aae7c3e6009fdfdf156b73
7
- data.tar.gz: 64741c4c119942a6f8373de136308c3b6b04b3d150f92b2665f97376b1bc1d21f5aaefce6f7ea01ebe65098a32b7f475e3870b83726fe855aa73f1a9f622f4e3
6
+ metadata.gz: cdb1007d0ad9b51d7833bf82914e9f1c64082a43c08f6dc5fadab0301ed20d9feccca382e00ecdafc052b3f7d3063693143db976ae4c92ea614365b736e0277d
7
+ data.tar.gz: 9c39e8cda2a8bf90ffa4cf96bedeab2fbbca4bca8c48961636b32d3017fd60b208e29787d3899b11c4d314ce5ed00aa34e7240926c06435555c5ff25b68e8f34
data/Gemfile.lock CHANGED
@@ -1,38 +1,47 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ehbrs-tools (0.41.0)
4
+ ehbrs-tools (0.42.0)
5
5
  avm-files (~> 0.7)
6
- eac_cli (~> 0.41)
6
+ eac_cli (~> 0.42)
7
7
  eac_ruby_base0 (~> 0.19)
8
- eac_ruby_utils (~> 0.121)
9
- ehbrs_ruby_utils (~> 0.43)
8
+ eac_ruby_utils (~> 0.122)
9
+ ehbrs_ruby_utils (~> 0.44)
10
10
  filesize (~> 0.2)
11
11
  os (~> 1.1, >= 1.1.4)
12
12
  telegram-bot-ruby (~> 0.23)
13
13
 
14
+ PATH
15
+ remote: sub/aranha-selenium
16
+ specs:
17
+ aranha-selenium (0.11.0)
18
+ eac_fs (~> 0.17)
19
+ eac_ruby_utils (~> 0.122)
20
+ eac_templates (~> 0.7)
21
+ selenium-webdriver (~> 3.142, >= 3.142.7)
22
+
14
23
  PATH
15
24
  remote: sub/eac_cli
16
25
  specs:
17
- eac_cli (0.41.0)
26
+ eac_cli (0.42.0)
18
27
  colorize (~> 0.8, >= 0.8.1)
19
28
  eac_config (~> 0.14, >= 0.14.2)
20
- eac_ruby_utils (~> 0.121)
29
+ eac_ruby_utils (~> 0.122)
21
30
  tty-table (~> 0.12)
22
31
 
23
32
  PATH
24
33
  remote: sub/ehbrs_ruby_utils
25
34
  specs:
26
- ehbrs_ruby_utils (0.43.0)
35
+ ehbrs_ruby_utils (0.44.0)
27
36
  aranha (~> 0.19, >= 0.19.2)
28
37
  aranha-parsers (~> 0.22)
29
- aranha-selenium (~> 0.10, >= 0.10.1)
30
- avm (~> 0.91)
38
+ aranha-selenium (~> 0.11)
39
+ avm (~> 0.92)
31
40
  dentaku (~> 3.5, >= 3.5.2)
32
41
  eac_fs (~> 0.17)
33
42
  eac_rest (~> 0.12)
34
- eac_ruby_utils (~> 0.121)
35
- eac_templates (~> 0.5, >= 0.5.1)
43
+ eac_ruby_utils (~> 0.122)
44
+ eac_templates (~> 0.7)
36
45
  inifile (~> 3.0)
37
46
  srt (~> 0.1, >= 0.1.5)
38
47
  taglib-ruby (~> 1.1, >= 1.1.3)
@@ -41,7 +50,7 @@ PATH
41
50
  GEM
42
51
  remote: https://rubygems.org/
43
52
  specs:
44
- activesupport (6.1.7.7)
53
+ activesupport (6.1.7.8)
45
54
  concurrent-ruby (~> 1.0, >= 1.0.2)
46
55
  i18n (>= 1.6, < 2)
47
56
  minitest (>= 5.1)
@@ -60,30 +69,24 @@ GEM
60
69
  eac_ruby_utils (~> 0.119, >= 0.119.2)
61
70
  nokogiri (~> 1.15, >= 1.15.4)
62
71
  ofx-parser (~> 1.1)
63
- aranha-selenium (0.10.1)
64
- eac_fs (~> 0.17)
65
- eac_ruby_utils (~> 0.121)
66
- eac_templates (~> 0.5, >= 0.5.1)
67
- selenium-webdriver (~> 3.142, >= 3.142.7)
68
72
  ast (2.4.2)
69
- avm (0.91.0)
70
- eac_cli (~> 0.40, >= 0.40.1)
73
+ avm (0.92.0)
74
+ eac_cli (~> 0.41)
71
75
  eac_config (~> 0.14, >= 0.14.2)
72
76
  eac_docker (~> 0.7)
73
77
  eac_fs (~> 0.17)
74
- eac_ruby_utils (~> 0.121)
75
- eac_templates (~> 0.5, >= 0.5.1)
78
+ eac_ruby_utils (~> 0.122)
79
+ eac_templates (~> 0.7)
76
80
  minitar (~> 0.9)
77
81
  ruby-progressbar (~> 1.13)
78
82
  avm-eac_generic_base0 (0.13.0)
79
83
  avm (~> 0.90)
80
84
  eac_ruby_utils (~> 0.121)
81
- avm-eac_ruby_base1 (0.33.1)
82
- aranha-parsers (~> 0.22)
83
- avm (~> 0.84)
84
- avm-eac_generic_base0 (~> 0.12, >= 0.12.1)
85
- eac_envs-http (~> 0.4, >= 0.4.1)
86
- eac_ruby_utils (~> 0.119, >= 0.119.2)
85
+ avm-eac_ruby_base1 (0.34.1)
86
+ avm (~> 0.92)
87
+ avm-eac_generic_base0 (~> 0.13)
88
+ eac_envs-http (~> 0.5, >= 0.5.1)
89
+ eac_ruby_utils (~> 0.122)
87
90
  avm-files (0.7.0)
88
91
  avm (~> 0.84, >= 0.84.2)
89
92
  eac_cli (~> 0.40)
@@ -99,7 +102,7 @@ GEM
99
102
  coercible (1.0.0)
100
103
  descendants_tracker (~> 0.0.1)
101
104
  colorize (0.8.1)
102
- concurrent-ruby (1.2.3)
105
+ concurrent-ruby (1.3.2)
103
106
  content-type (0.0.2)
104
107
  parslet (~> 2.0)
105
108
  dentaku (3.5.2)
@@ -141,15 +144,15 @@ GEM
141
144
  rubocop (~> 1.60, >= 1.60.1)
142
145
  rubocop-rails (~> 2.23, >= 2.23.1)
143
146
  rubocop-rspec (~> 2.26, >= 2.26.1)
144
- eac_ruby_utils (0.121.0)
147
+ eac_ruby_utils (0.122.0)
145
148
  activesupport (>= 4, < 7)
146
149
  addressable (~> 2.8, >= 2.8.6)
147
150
  bundler
148
151
  filesize (~> 0.2)
149
152
  net-ssh (~> 4.2)
150
- eac_templates (0.5.1)
151
- eac_config (~> 0.14, >= 0.14.1)
152
- eac_ruby_utils (~> 0.121)
153
+ eac_templates (0.7.0)
154
+ eac_config (~> 0.14, >= 0.14.2)
155
+ eac_ruby_utils (~> 0.122)
153
156
  faraday (2.8.1)
154
157
  base64
155
158
  faraday-net_http (>= 2.0, < 3.1)
@@ -173,7 +176,7 @@ GEM
173
176
  json (2.7.2)
174
177
  language_server-protocol (3.17.0.3)
175
178
  minitar (0.9)
176
- minitest (5.23.0)
179
+ minitest (5.23.1)
177
180
  multipart-post (2.4.1)
178
181
  net-ssh (4.2.0)
179
182
  nokogiri (1.15.6-x86_64-linux)
@@ -181,20 +184,20 @@ GEM
181
184
  ofx-parser (1.1.0)
182
185
  hpricot (>= 0.6)
183
186
  os (1.1.4)
184
- parallel (1.24.0)
185
- parser (3.3.1.0)
187
+ parallel (1.25.1)
188
+ parser (3.3.2.0)
186
189
  ast (~> 2.4.1)
187
190
  racc
188
191
  parslet (2.0.0)
189
192
  pastel (0.8.0)
190
193
  tty-color (~> 0.5)
191
194
  public_suffix (5.0.5)
192
- racc (1.7.3)
195
+ racc (1.8.0)
193
196
  rack (3.0.11)
194
197
  rainbow (3.1.1)
195
198
  regexp_parser (2.9.2)
196
- rexml (3.2.8)
197
- strscan (>= 3.0.9)
199
+ rexml (3.2.9)
200
+ strscan
198
201
  rspec (3.13.0)
199
202
  rspec-core (~> 3.13.0)
200
203
  rspec-expectations (~> 3.13.0)
@@ -208,7 +211,7 @@ GEM
208
211
  diff-lcs (>= 1.2.0, < 2.0)
209
212
  rspec-support (~> 3.13.0)
210
213
  rspec-support (3.13.1)
211
- rubocop (1.63.5)
214
+ rubocop (1.64.1)
212
215
  json (~> 2.3)
213
216
  language_server-protocol (>= 3.17.0)
214
217
  parallel (~> 1.10)
@@ -221,21 +224,21 @@ GEM
221
224
  unicode-display_width (>= 2.4.0, < 3.0)
222
225
  rubocop-ast (1.31.3)
223
226
  parser (>= 3.3.1.0)
224
- rubocop-capybara (2.20.0)
227
+ rubocop-capybara (2.21.0)
225
228
  rubocop (~> 1.41)
226
- rubocop-factory_bot (2.25.1)
229
+ rubocop-factory_bot (2.26.0)
227
230
  rubocop (~> 1.41)
228
- rubocop-rails (2.24.1)
231
+ rubocop-rails (2.25.0)
229
232
  activesupport (>= 4.2.0)
230
233
  rack (>= 1.1)
231
234
  rubocop (>= 1.33.0, < 2.0)
232
235
  rubocop-ast (>= 1.31.1, < 2.0)
233
- rubocop-rspec (2.29.2)
236
+ rubocop-rspec (2.31.0)
234
237
  rubocop (~> 1.40)
235
238
  rubocop-capybara (~> 2.17)
236
239
  rubocop-factory_bot (~> 2.22)
237
240
  rubocop-rspec_rails (~> 2.28)
238
- rubocop-rspec_rails (2.28.3)
241
+ rubocop-rspec_rails (2.29.0)
239
242
  rubocop (~> 1.40)
240
243
  ruby-filemagic (0.7.3)
241
244
  ruby-progressbar (1.13.0)
@@ -275,13 +278,14 @@ GEM
275
278
  axiom-types (~> 0.1)
276
279
  coercible (~> 1.0)
277
280
  descendants_tracker (~> 0.0, >= 0.0.3)
278
- zeitwerk (2.6.14)
281
+ zeitwerk (2.6.15)
279
282
  zlib (2.1.1)
280
283
 
281
284
  PLATFORMS
282
285
  x86_64-linux
283
286
 
284
287
  DEPENDENCIES
288
+ aranha-selenium!
285
289
  eac_cli!
286
290
  eac_ruby_gem_support (~> 0.9)
287
291
  ehbrs-tools!
@@ -15,7 +15,7 @@ module Ehbrs
15
15
  end
16
16
 
17
17
  def check(value, date = ::Time.required_zone.now)
18
- save if super(value, date)
18
+ save if super
19
19
  end
20
20
 
21
21
  def load
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_base0/core_ext'
4
+ require 'ehbrs_ruby_utils/booking/processors/list'
5
+
6
+ module Ehbrs
7
+ module Tools
8
+ class Runner
9
+ class Booking
10
+ class Accommodations
11
+ FIELDS = [
12
+ [:link, 'Link'],
13
+ [:price, 'Diárias'],
14
+ [:tax, 'Taxas'],
15
+ [:total, 'Total'],
16
+ [:address, 'Localização'],
17
+ [:distance, 'Dist. centro (Km)'],
18
+ [:review_score, 'Nota'],
19
+ [:review_count, 'Avaliações'],
20
+ [:unit_title, 'Descrição']
21
+ ].freeze
22
+
23
+ runner_with :help, :output_list do
24
+ desc 'Extrai as acomodações de uma página-lista do Booking.'
25
+ pos_arg :url
26
+ end
27
+
28
+ def run
29
+ run_output
30
+ infov 'Actual count found', list_rows.count
31
+ infov 'Declared count', processor.declared_count
32
+ if list_rows.count == processor.declared_count
33
+ success 'Ok!'
34
+ else
35
+ fatal_error 'Actual and declared counts are different'
36
+ end
37
+ end
38
+
39
+ protected
40
+
41
+ # @return [EhbrsRubyUtils::Booking::Processors::List]
42
+ def processor_uncached
43
+ ::EhbrsRubyUtils::Booking::Processors::List.new(url)
44
+ end
45
+
46
+ # @return [Array<Symbol>]
47
+ def list_columns
48
+ FIELDS.map(&:first)
49
+ end
50
+
51
+ # @return [Array<Object>]
52
+ def list_rows
53
+ processor.accommodations
54
+ end
55
+
56
+ # @return [Addressable::URI]
57
+ def url
58
+ parsed.url.to_uri
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+
5
+ module Ehbrs
6
+ module Tools
7
+ class Runner
8
+ class Booking
9
+ require_sub __FILE__
10
+
11
+ runner_with :help, :subcommands do
12
+ desc 'Utilidades para o site booking.com.'
13
+ subcommands
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ehbrs
4
4
  module Tools
5
- VERSION = '0.41.0'
5
+ VERSION = '0.42.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.41.0
4
+ version: 0.42.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: 2024-05-16 00:00:00.000000000 Z
11
+ date: 2024-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm-files
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.41'
33
+ version: '0.42'
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.41'
40
+ version: '0.42'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: eac_ruby_base0
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.121'
61
+ version: '0.122'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.121'
68
+ version: '0.122'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ehbrs_ruby_utils
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.43'
75
+ version: '0.44'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.43'
82
+ version: '0.44'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: filesize
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -172,6 +172,8 @@ files:
172
172
  - lib/ehbrs/tools/executables.rb
173
173
  - lib/ehbrs/tools/instance.rb
174
174
  - lib/ehbrs/tools/runner.rb
175
+ - lib/ehbrs/tools/runner/booking.rb
176
+ - lib/ehbrs/tools/runner/booking/accommodations.rb
175
177
  - lib/ehbrs/tools/runner/cooking_book.rb
176
178
  - lib/ehbrs/tools/runner/cooking_book/build.rb
177
179
  - lib/ehbrs/tools/runner/finances.rb