cnab 0.4.0 → 0.4.1

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.
@@ -44,4 +44,12 @@ module Cnab
44
44
  :trailer_arquivo => trailer_arquivo })
45
45
  end
46
46
  end
47
+
48
+ def self.root_path
49
+ File.expand_path(File.join(File.dirname(__FILE__), '..'))
50
+ end
51
+
52
+ def self.lib_path
53
+ File.join(root_path, 'lib')
54
+ end
47
55
  end
@@ -1,7 +1,7 @@
1
1
  module Cnab
2
2
  class Definition
3
3
  def initialize(version)
4
- raise Exceptions::VersionNotImplemented unless File.directory?("lib/cnab/versions/#{version}")
4
+ raise Exceptions::VersionNotImplemented unless File.directory?("#{Cnab.lib_path}/cnab/versions/#{version}")
5
5
 
6
6
  @header_arquivo = Definitions::HeaderArquivo.new(version)
7
7
  @header_lote = Definitions::HeaderLote.new(version)
@@ -2,7 +2,7 @@ module Cnab
2
2
  module Definitions
3
3
  class HeaderArquivo
4
4
  def initialize(version)
5
- @definition = YAML.load_file("lib/cnab/versions/#{version}/header_arquivo.yml")
5
+ @definition = YAML.load_file("#{Cnab.lib_path}/cnab/versions/#{version}/header_arquivo.yml")
6
6
  end
7
7
 
8
8
  def method_missing(method)
@@ -2,7 +2,7 @@ module Cnab
2
2
  module Definitions
3
3
  class HeaderLote
4
4
  def initialize(version)
5
- @definition = YAML.load_file("lib/cnab/versions/#{version}/header_lote.yml")
5
+ @definition = YAML.load_file("#{Cnab.lib_path}/cnab/versions/#{version}/header_lote.yml")
6
6
  end
7
7
 
8
8
  def method_missing(method)
@@ -2,7 +2,7 @@ module Cnab
2
2
  module Definitions
3
3
  class SegmentoT
4
4
  def initialize(version)
5
- @definition = YAML.load_file("lib/cnab/versions/#{version}/segmento_t.yml")
5
+ @definition = YAML.load_file("#{Cnab.lib_path}/cnab/versions/#{version}/segmento_t.yml")
6
6
  end
7
7
 
8
8
  def method_missing(method)
@@ -2,7 +2,7 @@ module Cnab
2
2
  module Definitions
3
3
  class SegmentoU
4
4
  def initialize(version)
5
- @definition = YAML.load_file("lib/cnab/versions/#{version}/segmento_u.yml")
5
+ @definition = YAML.load_file("#{Cnab.lib_path}/cnab/versions/#{version}/segmento_u.yml")
6
6
  end
7
7
 
8
8
  def method_missing(method)
@@ -2,7 +2,7 @@ module Cnab
2
2
  module Definitions
3
3
  class TrailerArquivo
4
4
  def initialize(version)
5
- @definition = YAML.load_file("lib/cnab/versions/#{version}/trailer_arquivo.yml")
5
+ @definition = YAML.load_file("#{Cnab.lib_path}/cnab/versions/#{version}/trailer_arquivo.yml")
6
6
  end
7
7
 
8
8
  def method_missing(method)
@@ -2,7 +2,7 @@ module Cnab
2
2
  module Definitions
3
3
  class TrailerLote
4
4
  def initialize(version)
5
- @definition = YAML.load_file("lib/cnab/versions/#{version}/trailer_lote.yml")
5
+ @definition = YAML.load_file("#{Cnab.lib_path}/cnab/versions/#{version}/trailer_lote.yml")
6
6
  end
7
7
 
8
8
  def method_missing(method)
@@ -1,3 +1,3 @@
1
1
  module Cnab
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cnab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-02 00:00:00.000000000 Z
13
+ date: 2013-04-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -148,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  segments:
150
150
  - 0
151
- hash: -501080544786458903
151
+ hash: -1160814427250196255
152
152
  required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  none: false
154
154
  requirements:
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  version: '0'
158
158
  segments:
159
159
  - 0
160
- hash: -501080544786458903
160
+ hash: -1160814427250196255
161
161
  requirements: []
162
162
  rubyforge_project:
163
163
  rubygems_version: 1.8.25