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.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/exe/avmtrf1 +1 -1
- data/lib/avmtrf1/check_point/session/login.rb +5 -5
- data/lib/avmtrf1/check_point/session.rb +5 -5
- data/lib/avmtrf1/docker/image.rb +9 -9
- data/lib/avmtrf1/docker/image_runner.rb +1 -1
- data/lib/avmtrf1/esosti/entities/issue.rb +2 -2
- data/lib/avmtrf1/esosti/instance/changed.rb +1 -1
- data/lib/avmtrf1/esosti/session/solicitacao.rb +4 -4
- data/lib/avmtrf1/esosti/session.rb +1 -1
- data/lib/avmtrf1/executables.rb +1 -1
- data/lib/avmtrf1/forponto/parsers/espelho/methods_as_fields.rb +1 -1
- data/lib/avmtrf1/forponto/parsers/espelho/summary_node.rb +3 -3
- data/lib/avmtrf1/forponto/parsers/espelho/utils.rb +1 -1
- data/lib/avmtrf1/forponto/session/day_registers.rb +1 -1
- data/lib/avmtrf1/forponto/session.rb +1 -1
- data/lib/avmtrf1/forponto/user/balance.rb +4 -6
- data/lib/avmtrf1/forponto/user/day_registers.rb +2 -2
- data/lib/avmtrf1/forponto/user/month.rb +2 -2
- data/lib/avmtrf1/forponto/user.rb +1 -1
- data/lib/avmtrf1/git/cached_repository.rb +2 -2
- data/lib/avmtrf1/git/push_large/lfs_commit/helpers.rb +1 -1
- data/lib/avmtrf1/git/push_large/lfs_commit/push.rb +1 -1
- data/lib/avmtrf1/git/push_large/lfs_commit.rb +1 -1
- data/lib/avmtrf1/git/reference.rb +1 -1
- data/lib/avmtrf1/gitlab/repository.rb +2 -2
- data/lib/avmtrf1/ini/profile.rb +1 -1
- data/lib/avmtrf1/ini.rb +2 -2
- data/lib/avmtrf1/inventario_sistemas/parser/body_row.rb +1 -1
- data/lib/avmtrf1/inventario_sistemas/site_build/html_page_base/elements.rb +2 -2
- data/lib/avmtrf1/inventario_sistemas/site_build/html_page_base/layout.rb +21 -21
- data/lib/avmtrf1/inventario_sistemas/site_build/sistema.rb +2 -2
- data/lib/avmtrf1/inventario_sistemas/site_build.rb +3 -3
- data/lib/avmtrf1/jira/entities/issue.rb +2 -2
- data/lib/avmtrf1/jira/instance.rb +2 -2
- data/lib/avmtrf1/openvpn/config/builder.rb +1 -1
- data/lib/avmtrf1/openvpn/config/parser/builder.rb +1 -1
- data/lib/avmtrf1/openvpn/config/parser/simple.rb +1 -1
- data/lib/avmtrf1/oracle/connection/string_builder.rb +1 -2
- data/lib/avmtrf1/oracle/connection.rb +1 -1
- data/lib/avmtrf1/oracle/objects/sql_builder.rb +1 -1
- data/lib/avmtrf1/oracle/objects.rb +1 -1
- data/lib/avmtrf1/oracle/oci8.rb +2 -2
- data/lib/avmtrf1/oracle.rb +1 -1
- data/lib/avmtrf1/patches/avm/git/issue/complete.rb +3 -3
- data/lib/avmtrf1/patches/avm/git/issue.rb +1 -1
- data/lib/avmtrf1/patches/avm/git/launcher/base.rb +4 -4
- data/lib/avmtrf1/patches/avm/git/launcher.rb +1 -1
- data/lib/avmtrf1/patches/avm/git.rb +1 -1
- data/lib/avmtrf1/patches/avm.rb +1 -1
- data/lib/avmtrf1/patches.rb +1 -1
- data/lib/avmtrf1/php/docker_images/v5.rb +13 -13
- data/lib/avmtrf1/red/client.rb +1 -1
- data/lib/avmtrf1/redmine/instance.rb +1 -1
- data/lib/avmtrf1/rest_provider/request.rb +1 -1
- data/lib/avmtrf1/rest_provider/response.rb +1 -1
- data/lib/avmtrf1/result.rb +1 -1
- data/lib/avmtrf1/tools/msgraph/token_retrieve.rb +2 -2
- data/lib/avmtrf1/{ruby/gems → tools/rubygems}/dependency.rb +4 -4
- data/lib/avmtrf1/{ruby/gems → tools/rubygems}/not_found_error.rb +4 -4
- data/lib/avmtrf1/{ruby/gems.rb → tools/rubygems.rb} +2 -2
- data/lib/avmtrf1/tools/runner/forponto/resumos.rb +2 -2
- data/lib/avmtrf1/tools/runner/forponto/saldo.rb +1 -1
- data/lib/avmtrf1/tools/runner/git/gitlab/commit_link.rb +3 -3
- data/lib/avmtrf1/tools/runner/git/gitlab.rb +2 -2
- data/lib/avmtrf1/tools/runner/git/issues_check.rb +1 -1
- data/lib/avmtrf1/tools/runner/git/push_large.rb +5 -5
- data/lib/avmtrf1/tools/runner/git.rb +2 -2
- data/lib/avmtrf1/tools/runner/msgraph/request.rb +1 -1
- data/lib/avmtrf1/tools/runner/openvpn.rb +2 -2
- data/lib/avmtrf1/tools/runner/oracle.rb +2 -2
- data/lib/avmtrf1/tools/runner/red.rb +4 -4
- data/lib/avmtrf1/tools/runner.rb +6 -5
- data/lib/avmtrf1/tools/version.rb +1 -1
- metadata +58 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b45258f2a26fa84f4cd260b0fb7a9d3c7f9fee7ee7c6eeb68cb6d38ff5f9da83
|
|
4
|
+
data.tar.gz: '048f5a5d7470fee5e367564d8a659ca4afdc3fd7ef304bcd7f35d700f19005c2'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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 =
|
|
12
|
-
eval_gemfile local_gemfile if
|
|
11
|
+
local_gemfile = File.join(File.dirname(__FILE__), 'Gemfile.local')
|
|
12
|
+
eval_gemfile local_gemfile if File.exist?(local_gemfile)
|
data/exe/avmtrf1
CHANGED
|
@@ -30,15 +30,15 @@ module Avmtrf1
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def fill_username
|
|
33
|
-
element_send_keys('
|
|
33
|
+
element_send_keys('sg_username_input', parent.username)
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
def fill_password
|
|
37
|
-
element_send_keys('
|
|
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: '
|
|
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: '
|
|
51
|
-
element && element
|
|
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}/
|
|
14
|
-
LOGGED_TITLE_TEXT = '
|
|
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.
|
|
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: '
|
|
44
|
+
element = session.find_element(id: 'sg_login_button')
|
|
45
45
|
return false unless element
|
|
46
46
|
|
|
47
47
|
result_text = element.text.strip
|
data/lib/avmtrf1/docker/image.rb
CHANGED
|
@@ -12,15 +12,15 @@ module Avmtrf1
|
|
|
12
12
|
|
|
13
13
|
common_constructor :registry, :platform_version
|
|
14
14
|
|
|
15
|
-
APT_SETUP =
|
|
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 =
|
|
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
|
|
@@ -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__)}/#{
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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__)}/#{
|
|
5
|
+
Dir["#{File.dirname(__FILE__)}/#{File.basename(__FILE__, '.*')}/*.rb"].sort.each do |path|
|
|
6
6
|
require path
|
|
7
7
|
end
|
|
8
8
|
|
data/lib/avmtrf1/executables.rb
CHANGED
|
@@ -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
|
|
@@ -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
|
|
@@ -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
|
|
@@ -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
|
-
|
|
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
|
|
@@ -9,7 +9,7 @@ module Avmtrf1
|
|
|
9
9
|
|
|
10
10
|
def initialize(url)
|
|
11
11
|
@url = url
|
|
12
|
-
super
|
|
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
|
|
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
|
|
@@ -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
|
|
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
|
data/lib/avmtrf1/ini/profile.rb
CHANGED
|
@@ -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([^\:]+)(
|
|
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)
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
@@ -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
|
-
|
|
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]+)
|
|
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
|
|