avmtrf1-tools 0.42.0 → 0.42.2

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.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/exe/avmtrf1 +1 -1
  4. data/lib/avmtrf1/check_point/session/login.rb +5 -5
  5. data/lib/avmtrf1/check_point/session.rb +5 -5
  6. data/lib/avmtrf1/docker/image.rb +9 -9
  7. data/lib/avmtrf1/docker/image_runner.rb +1 -1
  8. data/lib/avmtrf1/esosti/entities/issue.rb +2 -2
  9. data/lib/avmtrf1/esosti/instance/changed.rb +1 -1
  10. data/lib/avmtrf1/esosti/session/solicitacao.rb +4 -4
  11. data/lib/avmtrf1/esosti/session.rb +1 -1
  12. data/lib/avmtrf1/executables.rb +1 -1
  13. data/lib/avmtrf1/forponto/parsers/espelho/methods_as_fields.rb +1 -1
  14. data/lib/avmtrf1/forponto/parsers/espelho/summary_node.rb +3 -3
  15. data/lib/avmtrf1/forponto/parsers/espelho/utils.rb +1 -1
  16. data/lib/avmtrf1/forponto/session/day_registers.rb +1 -1
  17. data/lib/avmtrf1/forponto/session.rb +1 -1
  18. data/lib/avmtrf1/forponto/user/balance.rb +4 -6
  19. data/lib/avmtrf1/forponto/user/day_registers.rb +2 -2
  20. data/lib/avmtrf1/forponto/user/month.rb +2 -2
  21. data/lib/avmtrf1/forponto/user.rb +1 -1
  22. data/lib/avmtrf1/git/cached_repository.rb +2 -2
  23. data/lib/avmtrf1/git/push_large/lfs_commit/helpers.rb +1 -1
  24. data/lib/avmtrf1/git/push_large/lfs_commit/push.rb +1 -1
  25. data/lib/avmtrf1/git/push_large/lfs_commit.rb +1 -1
  26. data/lib/avmtrf1/git/reference.rb +1 -1
  27. data/lib/avmtrf1/gitlab/repository.rb +2 -2
  28. data/lib/avmtrf1/ini/profile.rb +1 -1
  29. data/lib/avmtrf1/ini.rb +2 -2
  30. data/lib/avmtrf1/inventario_sistemas/parser/body_row.rb +1 -1
  31. data/lib/avmtrf1/inventario_sistemas/site_build/html_page_base/elements.rb +2 -2
  32. data/lib/avmtrf1/inventario_sistemas/site_build/html_page_base/layout.rb +21 -21
  33. data/lib/avmtrf1/inventario_sistemas/site_build/sistema.rb +2 -2
  34. data/lib/avmtrf1/inventario_sistemas/site_build.rb +3 -3
  35. data/lib/avmtrf1/jira/entities/issue.rb +2 -2
  36. data/lib/avmtrf1/jira/instance.rb +2 -2
  37. data/lib/avmtrf1/openvpn/config/builder.rb +1 -1
  38. data/lib/avmtrf1/openvpn/config/parser/builder.rb +1 -1
  39. data/lib/avmtrf1/openvpn/config/parser/simple.rb +1 -1
  40. data/lib/avmtrf1/oracle/connection/string_builder.rb +1 -2
  41. data/lib/avmtrf1/oracle/connection.rb +1 -1
  42. data/lib/avmtrf1/oracle/objects/sql_builder.rb +1 -1
  43. data/lib/avmtrf1/oracle/objects.rb +1 -1
  44. data/lib/avmtrf1/oracle/oci8.rb +2 -2
  45. data/lib/avmtrf1/oracle.rb +1 -1
  46. data/lib/avmtrf1/patches/avm/git/issue/complete.rb +3 -3
  47. data/lib/avmtrf1/patches/avm/git/issue.rb +1 -1
  48. data/lib/avmtrf1/patches/avm/git/launcher/base.rb +4 -4
  49. data/lib/avmtrf1/patches/avm/git/launcher.rb +1 -1
  50. data/lib/avmtrf1/patches/avm/git.rb +1 -1
  51. data/lib/avmtrf1/patches/avm.rb +1 -1
  52. data/lib/avmtrf1/patches.rb +1 -1
  53. data/lib/avmtrf1/php/docker_images/v5.rb +13 -13
  54. data/lib/avmtrf1/red/client.rb +1 -1
  55. data/lib/avmtrf1/redmine/instance.rb +1 -1
  56. data/lib/avmtrf1/rest_provider/request.rb +1 -1
  57. data/lib/avmtrf1/rest_provider/response.rb +1 -1
  58. data/lib/avmtrf1/result.rb +1 -1
  59. data/lib/avmtrf1/tools/msgraph/token_retrieve.rb +2 -2
  60. data/lib/avmtrf1/{ruby/gems → tools/rubygems}/dependency.rb +4 -4
  61. data/lib/avmtrf1/{ruby/gems → tools/rubygems}/not_found_error.rb +4 -4
  62. data/lib/avmtrf1/{ruby/gems.rb → tools/rubygems.rb} +2 -2
  63. data/lib/avmtrf1/tools/runner/forponto/resumos.rb +2 -2
  64. data/lib/avmtrf1/tools/runner/forponto/saldo.rb +1 -1
  65. data/lib/avmtrf1/tools/runner/git/gitlab/commit_link.rb +3 -3
  66. data/lib/avmtrf1/tools/runner/git/gitlab.rb +2 -2
  67. data/lib/avmtrf1/tools/runner/git/issues_check.rb +1 -1
  68. data/lib/avmtrf1/tools/runner/git/push_large.rb +5 -5
  69. data/lib/avmtrf1/tools/runner/git.rb +2 -2
  70. data/lib/avmtrf1/tools/runner/msgraph/request.rb +1 -1
  71. data/lib/avmtrf1/tools/runner/openvpn.rb +2 -2
  72. data/lib/avmtrf1/tools/runner/oracle.rb +2 -2
  73. data/lib/avmtrf1/tools/runner/red.rb +4 -4
  74. data/lib/avmtrf1/tools/runner.rb +6 -5
  75. data/lib/avmtrf1/tools/version.rb +1 -1
  76. metadata +58 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73ca9a438c2acc50c74bda3da77ac125188cde76748561f720fce83c98501594
4
- data.tar.gz: abd8fb430e69bc6e79612950f519f390ac2ba1113642e6be8d615c16e25599e0
3
+ metadata.gz: b45258f2a26fa84f4cd260b0fb7a9d3c7f9fee7ee7c6eeb68cb6d38ff5f9da83
4
+ data.tar.gz: '048f5a5d7470fee5e367564d8a659ca4afdc3fd7ef304bcd7f35d700f19005c2'
5
5
  SHA512:
6
- metadata.gz: 56891d5de729710444c7279ed072e826b5f2bb91fe575415d92bf40789187e8342e6db923c0faabd784ac175f6e2601ac8b14e503bcc27217ae0308b67126cb5
7
- data.tar.gz: fa085736e91ce1b4064c4e2ca217810de040ccc44cac42476ed553ca729f757d0c633d56cfaaee2bef0f9c36b3f9909895879ff303e6313f0821beff9fabf088
6
+ metadata.gz: e73b7fa5b3e73226e44d905cfbbe7a1968576f5d8aff4b86ca378ebeb5c80c3dbd78584206c57241d747e2f7411fd5cc301212328f1782caeeea752fe9496fa5
7
+ data.tar.gz: 398603198d52759c0b4498998328334064cfabda33565832f5d13f3944b8cac62eb05c8afa23f83d1cf90d759218f166f44fde5a27b69699a0b9d9a8f0b15c76
data/Gemfile CHANGED
@@ -8,5 +8,5 @@ group :oracle do
8
8
  gem 'ruby-oci8'
9
9
  end
10
10
 
11
- local_gemfile = ::File.join(::File.dirname(__FILE__), 'Gemfile.local')
12
- eval_gemfile local_gemfile if ::File.exist?(local_gemfile)
11
+ local_gemfile = File.join(File.dirname(__FILE__), 'Gemfile.local')
12
+ eval_gemfile local_gemfile if File.exist?(local_gemfile)
data/exe/avmtrf1 CHANGED
@@ -5,4 +5,4 @@ $LOAD_PATH.unshift("#{__dir__}/../lib")
5
5
 
6
6
  require 'avmtrf1/tools/runner'
7
7
 
8
- ::Avmtrf1::Tools::Runner.run(program_name: ::File.basename(__FILE__))
8
+ Avmtrf1::Tools::Runner.run(program_name: File.basename(__FILE__))
@@ -30,15 +30,15 @@ module Avmtrf1
30
30
  end
31
31
 
32
32
  def fill_username
33
- element_send_keys('LoginUserPassword_auth_username', parent.username)
33
+ element_send_keys('sg_username_input', parent.username)
34
34
  end
35
35
 
36
36
  def fill_password
37
- element_send_keys('LoginUserPassword_auth_password', parent.password)
37
+ element_send_keys('sg_password_input', parent.password)
38
38
  end
39
39
 
40
40
  def click_login_button
41
- session.wait_for_element(id: 'UserCheck_Login_Button_span').click
41
+ session.wait_for_element(id: 'sg_login_button').click
42
42
  end
43
43
 
44
44
  def element_send_keys(element_id, text)
@@ -47,8 +47,8 @@ module Avmtrf1
47
47
 
48
48
  def wait_for_result_page
49
49
  session.wait.until do
50
- element = session.find_element(id: 'usercheck_title_div')
51
- element && element.text == 'Network Access Granted'
50
+ element = session.find_element(id: 'sg_login_button')
51
+ element && element != ::Avmtrf1::CheckPoint::Session::LOGGED_TITLE_TEXT
52
52
  end
53
53
  end
54
54
  end
@@ -10,20 +10,20 @@ module Avmtrf1
10
10
  enable_simple_cache
11
11
 
12
12
  ROOT_URL = 'https://cp.trf1.jus.br'
13
- LOGIN_URL = "#{ROOT_URL}/connect/PortalMain"
14
- LOGGED_TITLE_TEXT = 'Network Access Granted'
13
+ LOGIN_URL = "#{ROOT_URL}/"
14
+ LOGGED_TITLE_TEXT = 'Re-Authenticate'
15
15
 
16
16
  class << self
17
17
  def by_ad_user(ad_user, driver_options = {})
18
18
  new(
19
- ad_user.username_with_domain,
19
+ ad_user.username,
20
20
  ad_user.password,
21
21
  driver_options
22
22
  )
23
23
  end
24
24
 
25
25
  def by_default_ad_user(driver_options = {})
26
- by_ad_user(::Avmtrf1.ad_user, driver_options)
26
+ by_ad_user(::Avmtrf1.ad_user, driver_options.merge(driver: :firefox))
27
27
  end
28
28
  end
29
29
 
@@ -41,7 +41,7 @@ module Avmtrf1
41
41
  def title_text
42
42
  result_text = nil
43
43
  session.wait.until do
44
- element = session.find_element(id: 'usercheck_title_div')
44
+ element = session.find_element(id: 'sg_login_button')
45
45
  return false unless element
46
46
 
47
47
  result_text = element.text.strip
@@ -12,15 +12,15 @@ module Avmtrf1
12
12
 
13
13
  common_constructor :registry, :platform_version
14
14
 
15
- APT_SETUP = <<CODE
16
- ENV DEBIAN_FRONTEND=noninteractive
17
- RUN apt-get -y update
18
- RUN apt-get -y dist-upgrade
19
- CODE
20
- DEBIAN_STRETCH_FIX_SOURCES = <<CODE
21
- RUN echo 'deb http://security.debian.org/debian-security stable-security/updates main' > /etc/apt/sources.list
22
- RUN echo 'deb http://archive.debian.org/debian stretch main' >> /etc/apt/sources.list
23
- CODE
15
+ APT_SETUP = <<~CODE
16
+ ENV DEBIAN_FRONTEND=noninteractive
17
+ RUN apt-get -y update
18
+ RUN apt-get -y dist-upgrade
19
+ CODE
20
+ DEBIAN_STRETCH_FIX_SOURCES = <<~CODE
21
+ RUN echo 'deb http://security.debian.org/debian-security stable-security/updates main' > /etc/apt/sources.list
22
+ RUN echo 'deb http://archive.debian.org/debian stretch main' >> /etc/apt/sources.list
23
+ CODE
24
24
  DEBIAN_STRETCH_APT_SETUP = DEBIAN_STRETCH_FIX_SOURCES + APT_SETUP
25
25
 
26
26
  # @return [String]
@@ -26,7 +26,7 @@ module Avmtrf1
26
26
 
27
27
  def default_versions
28
28
  ::EacConfig::Node.context.current.entry(default_versions_config_key).value.split(',')
29
- .map(&:strip).reject(&:blank?)
29
+ .map(&:strip).reject(&:blank?) # rubocop:disable Rails/CompactBlank
30
30
  end
31
31
 
32
32
  def versions_to_s
@@ -15,8 +15,8 @@ module Avmtrf1
15
15
  end
16
16
  end
17
17
 
18
- def initialize(instance, data)
19
- super instance, data
18
+ def initialize(instance, data) # rubocop:disable Lint/UselessMethodDefinition, Style/RedundantInitialize
19
+ super(instance, data)
20
20
  end
21
21
  end
22
22
  end
@@ -20,7 +20,7 @@ module Avmtrf1
20
20
  end
21
21
 
22
22
  def changed_url_suffix(since)
23
- '/mbo/ticket?_includecols=ticketid&changedate=~gt~' +
23
+ '/mbo/ticket?_includecols=ticketid&changedate=~gt~' + # rubocop:disable Style/StringConcatenation
24
24
  ::CGI.escape(formatted_time(since))
25
25
  end
26
26
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'action_base'
4
- Dir["#{File.dirname(__FILE__)}/#{::File.basename(__FILE__, '.*')}/*.rb"].sort.each do |path|
4
+ Dir["#{File.dirname(__FILE__)}/#{File.basename(__FILE__, '.*')}/*.rb"].sort.each do |path|
5
5
  require path
6
6
  end
7
7
 
@@ -11,7 +11,7 @@ module Avmtrf1
11
11
  class Solicitacao < ::Avmtrf1::Esosti::Session::ActionBase
12
12
  def initialize(parent, solicitacao_id)
13
13
  @solicitacao_id = solicitacao_id.to_s.upcase
14
- super parent
14
+ super(parent)
15
15
  end
16
16
 
17
17
  private
@@ -50,7 +50,7 @@ module Avmtrf1
50
50
  def search_by_id
51
51
  session.wait_for_element(
52
52
  xpath: '//.[@id = "SystemNavAppContent-sc_div"]' \
53
- '//input[@type = "text" and contains(@class, "queryField")]'
53
+ '//input[@type = "text" and contains(@class, "queryField")]'
54
54
  ).send_keys(solicitacao_id)
55
55
  session.action.send_keys("\n").perform
56
56
  end
@@ -66,7 +66,7 @@ module Avmtrf1
66
66
 
67
67
  def first_result
68
68
  session.find_element(xpath: '//*[@id="SystemNavAppContent-chld"]' \
69
- '//span[contains(@id, "tdrow_[C:1]_ttxt-lb[R:0]")]')
69
+ '//span[contains(@id, "tdrow_[C:1]_ttxt-lb[R:0]")]')
70
70
  end
71
71
 
72
72
  def wait_for_solicitacao_page
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'active_support/json' # To-to: declare in gem "aranha"
4
4
  require 'aranha/selenium/session'
5
- Dir["#{File.dirname(__FILE__)}/#{::File.basename(__FILE__, '.*')}/*.rb"].sort.each do |path|
5
+ Dir["#{File.dirname(__FILE__)}/#{File.basename(__FILE__, '.*')}/*.rb"].sort.each do |path|
6
6
  require path
7
7
  end
8
8
 
@@ -14,7 +14,7 @@ module Avmtrf1
14
14
  private
15
15
 
16
16
  %w[docker sudo].each do |program|
17
- define_method(program.underscore + '_uncached') do
17
+ define_method(program.underscore + '_uncached') do # rubocop:disable Style/StringConcatenation
18
18
  env.executable(program, '--version')
19
19
  end
20
20
  end
@@ -8,7 +8,7 @@ module Avmtrf1
8
8
  class Espelho < ::Aranha::Parsers::Html::Item
9
9
  module MethodsAsFields
10
10
  def methods_as_fields(fields)
11
- fields.map { |field| [field, send(field)] }.to_h
11
+ fields.index_with { |field| send(field) }
12
12
  end
13
13
 
14
14
  def data
@@ -27,7 +27,7 @@ module Avmtrf1
27
27
  m = /\A(\d+):(\d+)\z/.match(time)
28
28
  raise "\"#{time}\" does not match time pattern" unless m
29
29
 
30
- m[1].to_i * 60 + m[2].to_i
30
+ (m[1].to_i * 60) + m[2].to_i
31
31
  end
32
32
 
33
33
  private
@@ -41,12 +41,12 @@ module Avmtrf1
41
41
  end
42
42
 
43
43
  def code_description_parsed_uncached
44
- return ::OpenStruct.new(code: nil, description: nil) if code_description.blank?
44
+ return ::OpenStruct.new(code: nil, description: nil) if code_description.blank? # rubocop:disable Style/OpenStructUse
45
45
 
46
46
  m = /\A(\d+)\s*-\s*(\S.+)\z/.match(code_description)
47
47
  raise "Code/description pattern not match: \"#{code_description}\"" unless m
48
48
 
49
- ::OpenStruct.new(code: m[1].to_i, description: m[2].strip)
49
+ ::OpenStruct.new(code: m[1].to_i, description: m[2].strip) # rubocop:disable Style/OpenStructUse
50
50
  end
51
51
  end
52
52
  end
@@ -16,7 +16,7 @@ module Avmtrf1
16
16
  s = ''
17
17
  node.children.each do |child|
18
18
  child_s = string_recursive(child)
19
- s += ' ' + child_s if child_s.present?
19
+ s += ' ' + child_s if child_s.present? # rubocop:disable Style/StringConcatenation
20
20
  end
21
21
  sanitize_string(s)
22
22
  end
@@ -15,7 +15,7 @@ module Avmtrf1
15
15
  private
16
16
 
17
17
  def day_registers_source_code
18
- login(::Date.today.at_beginning_of_month, Date.today.at_end_of_month)
18
+ login(::Date.today.at_beginning_of_month, Date.today.at_end_of_month) # rubocop:disable Rails/Date
19
19
  click_on_consultas_on_top_menu
20
20
  select_marcacoes_option
21
21
  sub.current_source
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'aranha/selenium/session'
4
4
  require 'eac_ruby_utils/require_sub'
5
- ::EacRubyUtils.require_sub(__FILE__)
5
+ EacRubyUtils.require_sub(__FILE__)
6
6
 
7
7
  module Avmtrf1
8
8
  module Forponto
@@ -28,7 +28,7 @@ module Avmtrf1
28
28
  end
29
29
 
30
30
  def head_month
31
- today = ::Date.today
31
+ today = ::Date.today # rubocop:disable Rails/Date
32
32
  date = ::Date.civil(today.year, today.month, 1)
33
33
  user.month(date.year, date.month)
34
34
  end
@@ -81,9 +81,7 @@ module Avmtrf1
81
81
  @lost = true
82
82
  end
83
83
 
84
- def to_s
85
- month.to_s
86
- end
84
+ delegate :to_s, to: :month
87
85
 
88
86
  def consume(previous)
89
87
  debito.consume_from_months(previous)
@@ -125,7 +123,7 @@ module Avmtrf1
125
123
  self.left -= value
126
124
  raise "Left less than zero: #{left} (Value: #{value})" if left.negative?
127
125
 
128
- @withdrawals << OpenStruct.new(month: month, value: value)
126
+ @withdrawals << OpenStruct.new(month: month, value: value) # rubocop:disable Style/OpenStructUse
129
127
  end
130
128
 
131
129
  private
@@ -139,7 +137,7 @@ module Avmtrf1
139
137
  value = [left, month_attr.left].min
140
138
  self.left -= value
141
139
  month_attr.withdrawal(owner_month, value)
142
- @requests << OpenStruct.new(month: month, value: value)
140
+ @requests << OpenStruct.new(month: month, value: value) # rubocop:disable Style/OpenStructUse
143
141
  end
144
142
 
145
143
  def attr
@@ -15,7 +15,7 @@ module Avmtrf1
15
15
  end
16
16
 
17
17
  def times
18
- fresh_data.map { |r| r[:hora] }
18
+ fresh_data.map { |r| r[:hora] } # rubocop:disable Rails/Pluck
19
19
  end
20
20
 
21
21
  private
@@ -23,7 +23,7 @@ module Avmtrf1
23
23
  def fresh_data_uncached
24
24
  r = ::Avmtrf1::Forponto::Session.new(user.url, user.matricula, user.codigo)
25
25
  .day_registers_data
26
- @date = ::Date.today
26
+ @date = ::Date.today # rubocop:disable Rails/Date
27
27
  r
28
28
  end
29
29
  end
@@ -35,7 +35,7 @@ module Avmtrf1
35
35
  end
36
36
 
37
37
  def to_s
38
- month.to_s.rjust(2, '0') + '/' + year.to_s
38
+ month.to_s.rjust(2, '0') + '/' + year.to_s # rubocop:disable Style/StringConcatenation
39
39
  end
40
40
 
41
41
  def empty?
@@ -90,7 +90,7 @@ module Avmtrf1
90
90
  end
91
91
 
92
92
  def yesterday_uncached?
93
- last_cached_day < end_date && last_cached_day < (::Date.today - 1.day)
93
+ last_cached_day < end_date && last_cached_day < (::Date.today - 1.day) # rubocop:disable Rails/Date
94
94
  end
95
95
 
96
96
  def last_cached_day_uncached
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_ruby_utils/require_sub'
4
- ::EacRubyUtils.require_sub(__FILE__)
4
+ EacRubyUtils.require_sub(__FILE__)
5
5
 
6
6
  module Avmtrf1
7
7
  module Forponto
@@ -9,7 +9,7 @@ module Avmtrf1
9
9
 
10
10
  def initialize(url)
11
11
  @url = url
12
- super local_path
12
+ super(local_path)
13
13
  init
14
14
  assert_remote_url('origin', url)
15
15
  system!('fetch', 'origin', '-pPt')
@@ -18,7 +18,7 @@ module Avmtrf1
18
18
  private
19
19
 
20
20
  def local_path
21
- r = ::File.join(ENV['HOME'], '.cache', 'git_cached_repositories', url.parameterize)
21
+ r = ::File.join(ENV.fetch('HOME', nil), '.cache', 'git_cached_repositories', url.parameterize) # rubocop:disable Style/EnvHome, Layout/LineLength
22
22
  ::FileUtils.mkdir_p(::File.dirname(r))
23
23
  r
24
24
  end
@@ -8,7 +8,7 @@ module Avmtrf1
8
8
  private
9
9
 
10
10
  def message(suffix, padding = 0)
11
- "#{(' ' * (padding + 2))}* #{suffix}"
11
+ "#{' ' * (padding + 2)}* #{suffix}"
12
12
  end
13
13
 
14
14
  def git
@@ -81,7 +81,7 @@ module Avmtrf1
81
81
 
82
82
  def push_message(suffix)
83
83
  message("Push of #{commit.sha1} (Size: #{commit.files_size}, " \
84
- "Files: #{commit.files.count}): #{suffix}.")
84
+ "Files: #{commit.files.count}): #{suffix}.")
85
85
  end
86
86
  end
87
87
  end
@@ -21,7 +21,7 @@ module Avmtrf1
21
21
 
22
22
  def start_banner
23
23
  infov ' * LFS push', "revision: #{source_revision}" \
24
- ", lfs_file_min_size: #{PushLarge.bytes_size(lfs_file_min_size)}"
24
+ ", lfs_file_min_size: #{PushLarge.bytes_size(lfs_file_min_size)}"
25
25
  end
26
26
 
27
27
  private
@@ -25,7 +25,7 @@ module Avmtrf1
25
25
 
26
26
  def parsed_fullname_uncached
27
27
  m = %r{\Arefs/([^/]+)s/(.+)\z}.match(fullname)
28
- return ::OpenStruct.new(name: m[2], type: m[1]) if m
28
+ return ::OpenStruct.new(name: m[2], type: m[1]) if m # rubocop:disable Style/OpenStructUse
29
29
 
30
30
  raise "\"#{fullname}\" not match ref pattern"
31
31
  end
@@ -23,14 +23,14 @@ module Avmtrf1
23
23
  # @param uri [String]
24
24
  # @return [Avmtrf1::Gitlab::Address, nil]
25
25
  def by_https_uri(uri)
26
- %r{\Ahttps?:\/\/([^\/]+)\/(.+)\z}i.if_match(uri, false) do |m|
26
+ %r{\Ahttps?://([^\/]+)/(.+)\z}i.if_match(uri, false) do |m|
27
27
  new(:https, m[1], m[2])
28
28
  end
29
29
  end
30
30
  end
31
31
 
32
32
  common_constructor :protocol, :authority, :path do
33
- self.path = '/' + path.to_s.gsub(/\.git\Z/, '').gsub(%r{\A/+}, '')
33
+ self.path = '/' + path.to_s.gsub(/\.git\Z/, '').gsub(%r{\A/+}, '') # rubocop:disable Style/StringConcatenation
34
34
  end
35
35
 
36
36
  def web_url
@@ -23,7 +23,7 @@ module Avmtrf1
23
23
 
24
24
  def to_h(prefix = '')
25
25
  data.select { |k, _v| k.start_with?(prefix) }
26
- .map { |e| [e[0].gsub(/\A#{Regexp.quote(prefix)}/, ''), e[1]] }.to_h
26
+ .map { |e| [e[0].gsub(/\A#{Regexp.quote(prefix)}/, ''), e[1]] }.to_h # rubocop:disable Style/MapToHash
27
27
  end
28
28
 
29
29
  private
data/lib/avmtrf1/ini.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_ruby_utils/simple_cache'
4
- require 'pp'
4
+ require 'pp' # rubocop:disable Lint/RedundantRequireStatement
5
5
  require 'avmtrf1/ini/profile'
6
6
  require 'avmtrf1/patches/inifile'
7
7
 
@@ -11,7 +11,7 @@ module Avmtrf1
11
11
  include ::EacRubyUtils::SimpleCache
12
12
 
13
13
  class << self
14
- SECTION_NAME_PATTERN = /\A([^\:]+)(?:\:([^\:]+))?\z/.freeze
14
+ SECTION_NAME_PATTERN = /\A([^\:]+)(?::([^\:]+))?\z/.freeze
15
15
 
16
16
  # @return Um [Array] em que o primeiro elemento é o perfil e o segundo é seu super-perfil.
17
17
  def parse_section_name(section_name)
@@ -5,7 +5,7 @@ require 'eac_ruby_utils/core_ext'
5
5
  module Avmtrf1
6
6
  class InventarioSistemas
7
7
  class Parser
8
- class BodyRow
8
+ class BodyRow # rubocop:disable Lint/EmptyClass
9
9
  end
10
10
  end
11
11
  end
@@ -27,13 +27,13 @@ module Avmtrf1
27
27
  rows.each_with_index do |row, index|
28
28
  b += html_table_row(row, 'td', (index % 2).zero? ? 'even' : 'odd')
29
29
  end
30
- b + '</tbody></theader>'
30
+ b + '</tbody></theader>' # rubocop:disable Style/StringConcatenation
31
31
  end
32
32
 
33
33
  def html_table_row(values, tag, css_class)
34
34
  begin_tag = "<#{tag} class='#{css_class}'>"
35
35
  end_tag = "</#{tag}>"
36
- '<tr>' + values.map { |v| begin_tag + v + end_tag }.join + "</tr>\n"
36
+ '<tr>' + values.map { |v| begin_tag + v + end_tag }.join + "</tr>\n" # rubocop:disable Style/StringConcatenation
37
37
  end
38
38
 
39
39
  def self_html_link
@@ -12,36 +12,36 @@ module Avmtrf1
12
12
  end
13
13
 
14
14
  def output_body
15
- <<HTML
16
- <body><div id="top">
17
- #{output_navbar}
18
- <h1>#{site_title}</h1>
19
- #{metadata_info}
20
- </div><div id="inner">
21
- <h2>#{title}</h2>
22
- #{output_inner_content}
23
- </div></body>
24
- HTML
15
+ <<~HTML
16
+ <body><div id="top">
17
+ #{output_navbar}
18
+ <h1>#{site_title}</h1>
19
+ #{metadata_info}
20
+ </div><div id="inner">
21
+ <h2>#{title}</h2>
22
+ #{output_inner_content}
23
+ </div></body>
24
+ HTML
25
25
  end
26
26
 
27
27
  def output_content
28
- "<html>\n" + output_header + output_body + '</html>'
28
+ "<html>\n" + output_header + output_body + '</html>' # rubocop:disable Style/StringConcatenation
29
29
  end
30
30
 
31
31
  def output_header
32
- <<HTML
33
- <head>
34
- <meta charset="UTF-8">
35
- <title>#{site_title} - #{title}</title>
36
- <style>
37
- #{::File.read(::File.join(__dir__, 'stylesheet.css'))}
38
- </style>
39
- </head>
40
- HTML
32
+ <<~HTML
33
+ <head>
34
+ <meta charset="UTF-8">
35
+ <title>#{site_title} - #{title}</title>
36
+ <style>
37
+ #{::File.read(::File.join(__dir__, 'stylesheet.css'))}
38
+ </style>
39
+ </head>
40
+ HTML
41
41
  end
42
42
 
43
43
  def output_navbar
44
- '<nav>' + output_navbar_path(false) + '</nav>'
44
+ '<nav>' + output_navbar_path(false) + '</nav>' # rubocop:disable Style/StringConcatenation
45
45
  end
46
46
 
47
47
  def output_navbar_path(links)
@@ -34,12 +34,12 @@ module Avmtrf1
34
34
  def responsavel
35
35
  %w[unidade seção nome]
36
36
  .map { |sub| column_value('responsável pelo desenvolvimento', sub) }
37
- .reject(&:blank?).join(' » ')
37
+ .reject(&:blank?).join(' » ') # rubocop:disable Rails/CompactBlank
38
38
  end
39
39
 
40
40
  def output_inner_content
41
41
  column_values = site.parser.header_columns.map { |c| [c.key, column_value(c)] }
42
- '<h3>Detalhes</h3>' + html_table(%w[Campo Valor], column_values)
42
+ '<h3>Detalhes</h3>' + html_table(%w[Campo Valor], column_values) # rubocop:disable Style/StringConcatenation
43
43
  end
44
44
 
45
45
  def title
@@ -48,9 +48,9 @@ module Avmtrf1
48
48
  end
49
49
 
50
50
  def indexed_columns_uncached
51
- parser.header_columns.map do |c|
52
- [c.id, c]
53
- end.to_h
51
+ parser.header_columns.index_by do |c| # rubocop:disable Style/SymbolProc
52
+ c.id
53
+ end
54
54
  end
55
55
 
56
56
  def index_uncached
@@ -21,8 +21,8 @@ module Avmtrf1
21
21
  return true if CATEGORY_CLOSED_STATUSES.include?(status_category_name)
22
22
  return false if CATEGORY_OPEN_STATUSES.include?(status_category_name)
23
23
 
24
- raise "Unknown category status \"#{status_category_name}\"" \
25
- " (Status: \"#{status_name}\")"
24
+ raise "Unknown category status \"#{status_category_name}\" " \
25
+ "(Status: \"#{status_name}\")"
26
26
  end
27
27
  end
28
28
  end
@@ -5,14 +5,14 @@ require 'avmtrf1/rest_provider/instance'
5
5
  module Avmtrf1
6
6
  module Jira
7
7
  class Instance < ::Avmtrf1::RestProvider::Instance
8
- ISSUE_ID_PATTERN = /\A([a-z][a-z0-9]+)\-(\d+)\z/i.freeze
8
+ ISSUE_ID_PATTERN = /\A([a-z][a-z0-9]+)-(\d+)\z/i.freeze
9
9
 
10
10
  class << self
11
11
  def parse_issue_id(global_issue_id)
12
12
  m = ISSUE_ID_PATTERN.match(global_issue_id)
13
13
  return nil unless m
14
14
 
15
- ::OpenStruct.new(provider_issue_id: m[0], project_id: m[1], project_issue_id: m[2])
15
+ ::OpenStruct.new(provider_issue_id: m[0], project_id: m[1], project_issue_id: m[2]) # rubocop:disable Style/OpenStructUse
16
16
  end
17
17
  end
18
18
 
@@ -15,7 +15,7 @@ module Avmtrf1
15
15
  end
16
16
 
17
17
  def data
18
- [simple, tags].reject(&:blank?).join("\n")
18
+ [simple, tags].reject(&:blank?).join("\n") # rubocop:disable Rails/CompactBlank
19
19
  end
20
20
 
21
21
  def on_data_file
@@ -29,7 +29,7 @@ module Avmtrf1
29
29
  if line.close_tag?
30
30
  if line.tag_name != current_tag.name
31
31
  raise("Closing tag \"#{line.tag_name}\" does not match current tag " \
32
- "\"#{current_tag}\"")
32
+ "\"#{current_tag}\"")
33
33
  end
34
34
 
35
35
  current_tag.close
@@ -18,7 +18,7 @@ module Avmtrf1
18
18
  end
19
19
 
20
20
  def args
21
- parts[1..-1]
21
+ parts[1..-1] # rubocop:disable Style/SlicingWithRange
22
22
  end
23
23
  end
24
24
  end