cfdi_processor 1.0.2 → 1.0.3

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
  SHA256:
3
- metadata.gz: ded9471832de7943f5940c0e3ceb5b90307c1de2872d364347d31a6f72346dc5
4
- data.tar.gz: cdb7ac480c1e20f5e66b6da23aab51cebc86351122cd64e04312e49f932ee6a5
3
+ metadata.gz: 899a00e43777ff07c4ff554249a2ceb4070dc375986828ba6f2fd133c41c5230
4
+ data.tar.gz: 54c9bfbdc0fa09c62dc4fda6f1de6b5e0e11e587976a8a9ce7d46af1016058a0
5
5
  SHA512:
6
- metadata.gz: 037c2c240b08cda34dbecece75001dae3d88bb258541fd82990a097dcadd65db3fde619b4fdea1bacf504bc33b9c9bb946d5f115935b973d0134bd0f6215e98b
7
- data.tar.gz: 1e0a8e31743eee24399bb8975bc548e1c083540a8ccfa06183b0ce462ae782a20dbc0b0736a6fb74e74bbd305b45aa99726e1b0064767aac9f9636bea8045d86
6
+ metadata.gz: 5bf8985366fad2bd104d70dd5f97ed3f322722ed5f871b9cf0206f0d20b3d03ce53e94b136c432345675e4d7d0625b5c74b811f7c61a14ddc0235edebf98199e
7
+ data.tar.gz: 38273c556fee3d09310569b791dd0574b6a1eb8f1c2b70781dc1295007d1460c3494d1c0b71f9f889088bbf88ccfdc966ffd4ef4c74ac940b5d3fa8e6d57d7ad
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cfdi_processor (1.0.2)
4
+ cfdi_processor (1.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,4 @@
1
1
  require "cfdi_processor/version"
2
+ require "cfdi_processor/i18n"
2
3
  require "cfdi_processor/data_extractor_base"
3
4
  require "cfdi_processor/stamped_extractor"
@@ -1,5 +1,4 @@
1
1
  require 'nokogiri'
2
- require_relative "i18n"
3
2
 
4
3
  module CfdiProcessor
5
4
  class DataExtractorBase
@@ -9,6 +8,8 @@ module CfdiProcessor
9
8
  @xml = xml
10
9
  @nokogiri_xml = ::Nokogiri::XML(xml)
11
10
  @nokogiri_xml.remove_namespaces!
11
+ I18n.load_path << File.expand_path("locale/en.yml", __dir__)
12
+ I18n.locale = :en
12
13
 
13
14
  # => Hook methods:
14
15
  #
@@ -39,12 +40,12 @@ module CfdiProcessor
39
40
  if value.kind_of?(Array)
40
41
  next if value.empty?
41
42
  items = value.each do |item|
42
- item.transform_keys!{ |k| ::I18n.t("#{args.first}.#{key}.#{k}") }
43
+ item.transform_keys!{ |k| I18n.t("#{args.first}.#{key}.#{k}") }
43
44
  end
44
45
 
45
- translated.merge!(::I18n.t("#{args.first}.#{resource_name}.#{key}") => items)
46
+ translated.merge!(I18n.t("#{args.first}.#{resource_name}.#{key}") => items)
46
47
  else
47
- translated.merge!(::I18n.t("#{args.first}.#{resource_name}.#{key}") => value)
48
+ translated.merge!(I18n.t("#{args.first}.#{resource_name}.#{key}") => value)
48
49
  end
49
50
 
50
51
  instance_variable_set("@#{resource_name}", translated)
@@ -1,3 +1,3 @@
1
1
  module CfdiProcessor
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfdi_processor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Armando Alejandre