rpi_marca 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 89b8ff9d5799be6df203aee821a3e21fa4b2d8d8
4
- data.tar.gz: 2a4b0797e93655983a54446ebcdd2bb0509b2c43
3
+ metadata.gz: 0c150b5c095d2395ce166361ef7d9d5f7dd3d5f2
4
+ data.tar.gz: e0272de61c74489e0a9868113d4e1361ed4bb27a
5
5
  SHA512:
6
- metadata.gz: 2d052f834c85b89730d1c6491d90e0f660ff069c31e07767022edbe6bf9b7ca1a0a41c168f63d0e1e68f55984e5f639704b52be04b8748ce56bb4e0f28ca6a2e
7
- data.tar.gz: dbf9817596a3716f5ba97cd1beaedb984471cb0c2d3575b425d86772b025d32063e710bd3f24c1824f135f9403648c714fe2b79e6b92230724d7cf62e5767da2
6
+ metadata.gz: c7d0eb8d1809f4e3810db0a15a7ef9307080eaa6125e3cf3573acede6e2770b9ac9b31c5626b8a238c9d1868aac46f24a109141cfd5b45b09fca5986c3660c2b
7
+ data.tar.gz: 1e4c298775fcc66a027e16c6c92adb41d388aebca1e813f9076915328e2081a9b2f35d47bdb4ab27f595c278f1b95cfde52c9a73b0ab95eeb75061bfc821832b
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1
4
+ - 2.2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rpi_marca (0.0.1)
4
+ rpi_marca (0.0.3)
5
5
  nokogiri (~> 1.6)
6
6
 
7
7
  GEM
@@ -14,46 +14,57 @@ GEM
14
14
  docile (1.1.5)
15
15
  ffi (1.9.6)
16
16
  formatador (0.2.5)
17
- guard (2.8.0)
17
+ guard (2.11.1)
18
18
  formatador (>= 0.2.4)
19
19
  listen (~> 2.7)
20
20
  lumberjack (~> 1.0)
21
+ nenv (~> 0.1)
22
+ notiffany (~> 0.0)
21
23
  pry (>= 0.9.12)
24
+ shellany (~> 0.0)
22
25
  thor (>= 0.18.1)
23
- guard-rspec (4.3.1)
26
+ guard-compat (1.2.1)
27
+ guard-rspec (4.5.0)
24
28
  guard (~> 2.1)
25
- rspec (>= 2.14, < 4.0)
29
+ guard-compat (~> 1.1)
30
+ rspec (>= 2.99.0, < 4.0)
26
31
  hitimes (1.2.2)
27
- listen (2.7.11)
32
+ listen (2.8.5)
28
33
  celluloid (>= 0.15.2)
29
34
  rb-fsevent (>= 0.9.3)
30
35
  rb-inotify (>= 0.9)
31
36
  lumberjack (1.0.9)
32
37
  method_source (0.8.2)
33
- mini_portile (0.6.1)
38
+ mini_portile (0.6.2)
34
39
  multi_json (1.10.1)
35
- nokogiri (1.6.4)
40
+ nenv (0.2.0)
41
+ nokogiri (1.6.6.2)
36
42
  mini_portile (~> 0.6.0)
43
+ notiffany (0.0.4)
44
+ nenv (~> 0.1)
45
+ shellany (~> 0.0)
37
46
  pry (0.10.1)
38
47
  coderay (~> 1.1.0)
39
48
  method_source (~> 0.8.1)
40
49
  slop (~> 3.4)
41
- rake (10.3.2)
50
+ rake (10.4.2)
42
51
  rb-fsevent (0.9.4)
43
52
  rb-inotify (0.9.5)
44
53
  ffi (>= 0.5.0)
45
- rspec (3.1.0)
46
- rspec-core (~> 3.1.0)
47
- rspec-expectations (~> 3.1.0)
48
- rspec-mocks (~> 3.1.0)
49
- rspec-core (3.1.7)
50
- rspec-support (~> 3.1.0)
51
- rspec-expectations (3.1.2)
54
+ rspec (3.2.0)
55
+ rspec-core (~> 3.2.0)
56
+ rspec-expectations (~> 3.2.0)
57
+ rspec-mocks (~> 3.2.0)
58
+ rspec-core (3.2.0)
59
+ rspec-support (~> 3.2.0)
60
+ rspec-expectations (3.2.0)
52
61
  diff-lcs (>= 1.2.0, < 2.0)
53
- rspec-support (~> 3.1.0)
54
- rspec-mocks (3.1.3)
55
- rspec-support (~> 3.1.0)
56
- rspec-support (3.1.2)
62
+ rspec-support (~> 3.2.0)
63
+ rspec-mocks (3.2.0)
64
+ diff-lcs (>= 1.2.0, < 2.0)
65
+ rspec-support (~> 3.2.0)
66
+ rspec-support (3.2.1)
67
+ shellany (0.0.1)
57
68
  simplecov (0.9.1)
58
69
  docile (~> 1.1.0)
59
70
  multi_json (~> 1.0)
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # RpiMarca
2
2
 
3
+ [![Build Status](https://travis-ci.org/automatto/rpi_marca.svg?branch=master)](https://travis-ci.org/automatto/rpi_marca)
4
+ [![Gem Version](https://badge.fury.io/rb/rpi_marca.svg)](http://badge.fury.io/rb/rpi_marca)
5
+
3
6
  Leitura da RPI de Marcas do INPI em formato XML.
4
7
 
5
8
  ## Installation
@@ -20,8 +20,8 @@ module RpiMarca
20
20
  @assignee = assignee
21
21
  end
22
22
 
23
- def self.parse(el, rule_code)
24
- return if el.nil? && IPAS_RECEIPT_NOT_REQUIRED.include?(rule_code)
23
+ def self.parse(el)
24
+ return if el.nil?
25
25
 
26
26
  number = Helpers.get_attribute_value(el, 'numero') or
27
27
  fail ParseError, 'Receipt number is required'
@@ -23,12 +23,10 @@ module RpiMarca
23
23
  end
24
24
 
25
25
  def self.parse(el)
26
- ipas = Helpers.get_attribute_value(el, 'codigo')
27
-
28
26
  new(
29
- ipas: ipas,
27
+ ipas: Helpers.get_attribute_value(el, 'codigo'),
30
28
  description: Helpers.get_attribute_value(el, 'nome'),
31
- receipt: Receipt.parse(el.at_xpath('protocolo'), ipas),
29
+ receipt: Receipt.parse(el.at_xpath('protocolo')),
32
30
  complement: Helpers.get_element_value(
33
31
  el.at_xpath('texto-complementar')
34
32
  )
@@ -1,3 +1,3 @@
1
1
  module RpiMarca
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -409,13 +409,13 @@ describe RpiMarca::Publication do
409
409
  end
410
410
 
411
411
  context 'protocolo' do
412
- it 'deve ter protocolo para despachos onde é obrigatório' do
412
+ it 'deve ter número de protocolo' do
413
413
  # rubocop:disable Metrics/LineLength
414
414
  xml = <<-XML
415
415
  <processo numero="905653858">
416
416
  <despachos>
417
417
  <despacho codigo="IPAS270" nome="Notificação de oposição para manifestação">
418
- <texto-complementar>850130127025 de 02/07/2013, 850130131596 de 08/07/2013 e 850130122879 de 28/06/2013</texto-complementar>
418
+ <protocolo data="01/07/2013"/>
419
419
  </despacho>
420
420
  </despachos>
421
421
  </processo>
@@ -426,9 +426,21 @@ describe RpiMarca::Publication do
426
426
  .to raise_error(RpiMarca::ParseError)
427
427
  end
428
428
 
429
- it 'não tem protocolo para despachos onde não é obrigatório' do
430
- expect { RpiMarca::Publication.new(PUBLICACAO_SEM_PROTOCOLO) }
431
- .not_to raise_error
429
+ it 'deve ter data de protocolo' do
430
+ # rubocop:disable Metrics/LineLength
431
+ xml = <<-XML
432
+ <processo numero="905653858">
433
+ <despachos>
434
+ <despacho codigo="IPAS270" nome="Notificação de oposição para manifestação">
435
+ <protocolo numero="99999999999"/>
436
+ </despacho>
437
+ </despachos>
438
+ </processo>
439
+ XML
440
+ # rubocop:enable Metrics/LineLength
441
+
442
+ expect { RpiMarca::Publication.new(xml) }
443
+ .to raise_error(RpiMarca::ParseError)
432
444
  end
433
445
 
434
446
  it 'protocolo tem dados corretos' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpi_marca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luiz Damim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-05 00:00:00.000000000 Z
11
+ date: 2015-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,6 +108,7 @@ files:
108
108
  - ".rubocop.yml"
109
109
  - ".rubocop_todo.yml"
110
110
  - ".ruby-version"
111
+ - ".travis.yml"
111
112
  - Gemfile
112
113
  - Gemfile.lock
113
114
  - Guardfile