avmtrf1-tools 0.26.0 → 0.27.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10d3b52fd72e610bdf5a2024f9c470515fb80ba2c561ee9c0034de160dbce8ba
|
4
|
+
data.tar.gz: 1bd4ba694ce3fb8882eef48c67decddf0e3cf3e06047034206af840b95f0fdd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb87800657023bd8db9b1b2ed1934ad3ba963fa6d8a529ed5ce552667a34563f84096f1e03f903be7ed633affa9a7a4ffdc31eaf75ebd9a693cd3b75f93ba983
|
7
|
+
data.tar.gz: 199c3a3168c1746edfca9156c5b9550ecb52d6e7502aaa204ab6d1c5a1759521e77f055ff079583449acd4182bbb2012490e97b168f331f3720f2abb57253a7a
|
@@ -6,8 +6,12 @@ require 'avmtrf1/ad_user'
|
|
6
6
|
module Avmtrf1
|
7
7
|
class << self
|
8
8
|
def default_esosti
|
9
|
-
@default_esosti ||=
|
10
|
-
|
9
|
+
@default_esosti ||= trf1_esosti('https://esosti.trf1.jus.br')
|
10
|
+
end
|
11
|
+
|
12
|
+
def trf1_esosti(url)
|
13
|
+
::Avmtrf1::Esosti::Instance.new(
|
14
|
+
url,
|
11
15
|
"#{::Avmtrf1.ad_user.username}@#{::Avmtrf1.ad_user.domain.downcase}.gov.br",
|
12
16
|
::Avmtrf1.ad_user.password
|
13
17
|
)
|
@@ -1,8 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/console/docopt_runner'
|
4
|
-
require 'eac_ruby_utils/
|
5
|
-
require 'eac_ruby_utils/simple_cache'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
6
5
|
require 'avmtrf1/default_esosti'
|
7
6
|
require 'avmtrf1/ini'
|
8
7
|
require 'avmtrf1/red/profile'
|
@@ -11,8 +10,8 @@ module Avmtrf1
|
|
11
10
|
module Tools
|
12
11
|
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
13
12
|
class Esosti < ::EacRubyUtils::Console::DocoptRunner
|
14
|
-
|
15
|
-
|
13
|
+
enable_console_speaker
|
14
|
+
enable_simple_cache
|
16
15
|
|
17
16
|
DOC = <<~DOCOPT
|
18
17
|
Utilidades para e-Sosti (Control Desk).
|
@@ -22,8 +21,9 @@ module Avmtrf1
|
|
22
21
|
__PROGRAM__ -h | --help
|
23
22
|
|
24
23
|
Options:
|
25
|
-
-h --help
|
26
|
-
-u --user
|
24
|
+
-h --help Mostra esta ajuda.
|
25
|
+
-u --user Usuário no e-Sosti.
|
26
|
+
-U --url=<url> Utiliza o Control Desk em <url>.
|
27
27
|
DOCOPT
|
28
28
|
|
29
29
|
def run
|
@@ -34,12 +34,24 @@ module Avmtrf1
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
private
|
38
|
+
|
39
|
+
def esosti_instance_uncached
|
40
|
+
options.fetch('--url').if_present(::Avmtrf1.default_esosti) do |url|
|
41
|
+
::Avmtrf1.trf1_esosti(url)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
37
45
|
def fetch
|
38
|
-
infom "Recuperando informações de #{
|
39
|
-
issue =
|
40
|
-
fatal_error("Issue não encontrado: #{
|
46
|
+
infom "Recuperando informações de #{solicitacao_id}..."
|
47
|
+
issue = esosti_instance.issue(solicitacao_id)
|
48
|
+
fatal_error("Issue não encontrado: #{solicitacao_id}") unless issue
|
41
49
|
out issue.data.to_yaml
|
42
50
|
end
|
51
|
+
|
52
|
+
def solicitacao_id
|
53
|
+
options.fetch('<solicitacao_id>')
|
54
|
+
end
|
43
55
|
end
|
44
56
|
end
|
45
57
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avmtrf1-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.27.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo H. Bogoni
|
@@ -236,7 +236,6 @@ files:
|
|
236
236
|
- lib/avmtrf1/esosti/entities.rb
|
237
237
|
- lib/avmtrf1/esosti/entities/issue.rb
|
238
238
|
- lib/avmtrf1/esosti/instance.rb
|
239
|
-
- lib/avmtrf1/esosti/parsers/solicitacao/main.rb
|
240
239
|
- lib/avmtrf1/esosti/session.rb
|
241
240
|
- lib/avmtrf1/esosti/session/action_base.rb
|
242
241
|
- lib/avmtrf1/esosti/session/atividades.rb
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'active_support/core_ext/object' # To-to: declare in gem "aranha"
|
4
|
-
require 'active_support/core_ext/string' # To-to: declare in gem "aranha"
|
5
|
-
require 'aranha/parsers/html/item'
|
6
|
-
require 'nokogiri' # To-to: declare in gem "aranha"
|
7
|
-
|
8
|
-
module Avmtrf1
|
9
|
-
module Esosti
|
10
|
-
module Parsers
|
11
|
-
module Solicitacao
|
12
|
-
class Main < ::Aranha::Parsers::Html::Item
|
13
|
-
field :pessoa_afetada_email, :string,
|
14
|
-
'//input[@type="text" and ' \
|
15
|
-
'following-sibling::img[contains(@aria-label, "Pessoa Afetada")]]/@value'
|
16
|
-
|
17
|
-
def item_xpath; end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|