sigep_web 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: fed0ac7c0c2722cb123298fafc721c7b727a1460
4
- data.tar.gz: 1fc2f981799143776ee37bcd27ee7036509b929c
3
+ metadata.gz: 171fb05793ca9e554aafa219dbfc92cca2944b6b
4
+ data.tar.gz: 00e6a7362573132b6bf84c4fef682baf29ed4b04
5
5
  SHA512:
6
- metadata.gz: 67f186c6b0924431d6fdfd195aeb96d9ea0c31bd14696b28f8b35ae17c83d825795eb89443aeef2164be1e44e7feff842bc8d1117b5d8066efc23adbea772cd0
7
- data.tar.gz: 2e19e2a3b1fe033c2f41ab516cf36f0a36b84c88079912849884ec18a692dccbd7317a0d826f146c3c4c250997aa9cd306d127f5644beb17b2dbafc664828c5d
6
+ metadata.gz: 7deed62676ce171997b2edece70f2a356a556d0871c8bcf44016b4837376b43f4e17efdfdf881539b54a0063c43aa90cfcdc82afb0bc18545e6e3c2bb1b35d12
7
+ data.tar.gz: a5b261995a9eb43c464df157764be328cb6b7998d6ce9430fdb6d66cf3bf7c6ac450db38a71a0b6e0d85758ea1a4d50d2ef26d7fbfc4bbe9915f994011c2a7d4
data/Gemfile.lock CHANGED
@@ -1,7 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sigep_web (0.1.0)
4
+ sigep_web (0.2.1)
5
+ nokogiri (~> 1.6)
6
+ savon (~> 2.10.0)
5
7
 
6
8
  GEM
7
9
  remote: https://rubygems.org/
@@ -57,10 +59,8 @@ PLATFORMS
57
59
 
58
60
  DEPENDENCIES
59
61
  bundler (~> 1.11)
60
- nokogiri (~> 1.6)
61
62
  rake (~> 10.0)
62
63
  rspec (~> 3.0)
63
- savon (~> 2.10.0)
64
64
  sigep_web!
65
65
 
66
66
  BUNDLED WITH
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # sigep_web
2
2
 
3
3
  [![Build Status](https://travis-ci.org/Sidoniuns/sigep_web.svg?branch=master)](https://travis-ci.org/Sidoniuns/sigep_web)
4
+ [![Gem Version](https://badge.fury.io/rb/sigep_web.svg)](https://badge.fury.io/rb/sigep_web)
5
+ [![Code Climate](https://codeclimate.com/github/Sidoniuns/sigep_web/badges/gpa.svg)](https://codeclimate.com/github/Sidoniuns/sigep_web)
4
6
 
5
7
  ## Installation
6
8
  gem install sigep_web
@@ -8,13 +8,21 @@ module SigepWeb
8
8
  def request
9
9
  authenticate = SigepWeb.configuration.authenticate
10
10
  begin
11
- process(:gera_digito_verificador_etiquetas, {
11
+ response = process(:gera_digito_verificador_etiquetas, {
12
12
  etiquetas: @labels,
13
13
  usuario: authenticate.user,
14
14
  senha: authenticate.password
15
15
  }).to_hash[:gera_digito_verificador_etiquetas_response][:return]
16
+
17
+ {
18
+ success: true,
19
+ response: response
20
+ }
16
21
  rescue Savon::SOAPFault => msg
17
- msg
22
+ {
23
+ success: false,
24
+ error: msg
25
+ }
18
26
  end
19
27
  end
20
28
  end
@@ -8,13 +8,21 @@ module SigepWeb
8
8
  def request
9
9
  authenticate = SigepWeb.configuration.authenticate
10
10
  begin
11
- process(:get_status_cartao_postagem, {
11
+ response = process(:get_status_cartao_postagem, {
12
12
  numeroCartaoPostagem: @postage_number_card,
13
13
  usuario: authenticate.user,
14
14
  senha: authenticate.password
15
15
  }).to_hash[:get_status_cartao_postagem_response][:return]
16
+
17
+ {
18
+ success: true,
19
+ response: response
20
+ }
16
21
  rescue Savon::SOAPFault => msg
17
- msg
22
+ {
23
+ success: false,
24
+ error: msg
25
+ }
18
26
  end
19
27
  end
20
28
  end
@@ -20,9 +20,15 @@ module SigepWeb
20
20
  senha: authenticate.password
21
21
  }).to_hash[:solicita_etiquetas_response][:return]
22
22
 
23
- build_label_array(response)
23
+ {
24
+ success: true,
25
+ response: build_label_array(response)
26
+ }
24
27
  rescue Savon::SOAPFault => msg
25
- msg
28
+ {
29
+ success: false,
30
+ error: msg
31
+ }
26
32
  end
27
33
  end
28
34
 
@@ -11,7 +11,7 @@ module SigepWeb
11
11
  def request
12
12
  authenticate = SigepWeb.configuration.authenticate
13
13
  begin
14
- process(:fecha_plp_varios_servicos, {
14
+ response = process(:fecha_plp_varios_servicos, {
15
15
  xml: @plp.to_xml,
16
16
  idPlpCliente: @id_plp_client,
17
17
  cartaoPostagem: authenticate.card,
@@ -19,8 +19,16 @@ module SigepWeb
19
19
  usuario: authenticate.user,
20
20
  senha: authenticate.password
21
21
  }).to_hash[:fecha_plp_varios_servicos_response][:return].to_s
22
+
23
+ {
24
+ success: true,
25
+ response: response
26
+ }
22
27
  rescue Savon::SOAPFault => msg
23
- msg
28
+ {
29
+ success: false,
30
+ error: msg
31
+ }
24
32
  end
25
33
  end
26
34
  end
@@ -14,11 +14,17 @@ module SigepWeb
14
14
  idCartaoPostagem: @id_post_card,
15
15
  usuario: authenticate.user,
16
16
  senha: authenticate.password
17
- })
17
+ }).to_hash[:busca_cliente_response][:return]
18
18
 
19
- response.to_hash[:busca_cliente_response][:return]
19
+ {
20
+ success: true,
21
+ response: response
22
+ }
20
23
  rescue Savon::SOAPFault => msg
21
- msg
24
+ {
25
+ success: false,
26
+ error: msg
27
+ }
22
28
  end
23
29
  end
24
30
  end
@@ -8,15 +8,27 @@ module SigepWeb
8
8
  end
9
9
 
10
10
  def request
11
- authenticate = SigepWeb.configuration.authenticate
12
- process(:verifica_disponibilidade_servico, {
13
- codAdministrativo: authenticate.administrative_code,
14
- numeroServico: @service_number,
15
- cepOrigem: @source_zip,
16
- cepDestino: @target_zip,
17
- usuario: authenticate.user,
18
- senha: authenticate.password
19
- }).to_hash[:verifica_disponibilidade_servico_response][:return]
11
+ begin
12
+ authenticate = SigepWeb.configuration.authenticate
13
+ response = process(:verifica_disponibilidade_servico, {
14
+ codAdministrativo: authenticate.administrative_code,
15
+ numeroServico: @service_number,
16
+ cepOrigem: @source_zip,
17
+ cepDestino: @target_zip,
18
+ usuario: authenticate.user,
19
+ senha: authenticate.password
20
+ }).to_hash[:verifica_disponibilidade_servico_response][:return]
21
+
22
+ {
23
+ success: true,
24
+ response: response
25
+ }
26
+ rescue Savon::SOAPFault => msg
27
+ {
28
+ success: false,
29
+ error: msg
30
+ }
31
+ end
20
32
  end
21
33
  end
22
34
  end
@@ -1,3 +1,3 @@
1
1
  module SigepWeb
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -11,9 +11,15 @@ module SigepWeb
11
11
  cep: @zip
12
12
  }).to_hash[:consulta_cep_response][:return]
13
13
 
14
- ApiResponse.new(response)
14
+ {
15
+ success: true,
16
+ response: ApiResponse.new(response)
17
+ }
15
18
  rescue Savon::SOAPFault => msg
16
- msg
19
+ {
20
+ success: false,
21
+ error: msg
22
+ }
17
23
  end
18
24
  end
19
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sigep_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - |+