nfe_reader 1.0.3 → 1.0.4

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: 045adfe5a0e11fa9b1a661523ffa243276c0afac
4
- data.tar.gz: 674f22af409a640a8e504e1e5ab66d8f6185587f
3
+ metadata.gz: 4e774c8870d885012e9766d7414e929602371814
4
+ data.tar.gz: 9560d73f3be52d68614849708bc60d58d2b7ee1c
5
5
  SHA512:
6
- metadata.gz: c0a54ed483a156ba868daf2a36136bdae9b01ab7a22a0defcdea28bd2ab92453c0041a32dcea1c4de66491a869764ab4f27483f253f4bcadf6d76e5728d19bbe
7
- data.tar.gz: 705395d6f7a1e32c16bd9c5f9c002d40171f379470b690213eccc1d44efa88ddf8878a336f2a4c83eac84da443cef74a55ff203d8902cd57d2f5dcb6d6bc166d
6
+ metadata.gz: adeda4aa09c7718a6dc5738dca02dfce761629d9f8ca45baf511c09248540b5dc8921c264595a300638d6914c79914c1d0fb332d1c5ab11629f972f80eafda07
7
+ data.tar.gz: 006d0e2d8dfa36543cbb00706b7d4c7fd33b33c8e296c907a38070b610a77512c12f71dd6cd7a74bc53a1aad90f45010847ba2fcdf1ca97c229ae07dbdb8e1a8
@@ -1,5 +1,5 @@
1
1
  module Nfe
2
2
  module Reader
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
data/lib/nfe_reader.rb CHANGED
@@ -17,7 +17,9 @@ module Nfe
17
17
  :total, :authorizations, :error, :trace
18
18
 
19
19
  def initialize(file)
20
- xml = Nokogiri::XML(file).to_hash
20
+
21
+ xml = file.is_a?(Nokogiri::XML::Document) ? file : Nokogiri::XML(file)
22
+ xml = xml.to_hash
21
23
 
22
24
  # Versao da NFe
23
25
  @version = xml[:nfeProc][:versao]
data/nfe-reader.gemspec CHANGED
@@ -20,6 +20,6 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.6"
22
22
  spec.add_development_dependency "rake"
23
- spec.add_development_dependency "turn", "~> 0.9.7"
24
- spec.add_dependency "nokogiri", "~> 1.6.3.1"
23
+ spec.add_development_dependency "turn", "~> 0.9"
24
+ spec.add_dependency "nokogiri", "~> 1.6"
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nfe_reader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Becker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-25 00:00:00.000000000 Z
11
+ date: 2014-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.9.7
47
+ version: '0.9'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.9.7
54
+ version: '0.9'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: nokogiri
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.6.3.1
61
+ version: '1.6'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.6.3.1
68
+ version: '1.6'
69
69
  description: NFe XML Extractor
70
70
  email:
71
71
  - edu.bkr@gmail.com