REX12 0.1.0 → 0.1.2

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: 5cc9b4181ab6eef0202f152e4439f0f8e910a2b4
4
- data.tar.gz: 7a24fe67b66a65ecf873f66c8b5d679f634c7572
3
+ metadata.gz: 81999a8ca44b2857706d80a1fc81b5ccd4706cc3
4
+ data.tar.gz: 74076d6beac2a9a25ad779fb6e04245c8878d1bb
5
5
  SHA512:
6
- metadata.gz: bef125ee1434d128bdf29dbef47690f08e56dc49f059ff60ab8efa626f51aa6f66613ccc01cd03438c380ba7812d28b1cf5b0ba51daa867eea4828572f317940
7
- data.tar.gz: fa887dbd357176382fc73bffc59b001aa572eca3b8e2724d5558960f2ad57cc7c99bb037e56f58fb92b4f8174758a84449e923ff2834f8d0f56a16dcc764db09
6
+ metadata.gz: b7e04d2f6dbaca9143825ec3b05582769eb85314e3623b660838e092604b94ccab421521b12eb0bdc71933a40446af41281d33c8b5b6eb87c43ea8562b457365
7
+ data.tar.gz: b690143ef5c8e3c21c53f75529772ba9cc1d19cc13b7d6e5a59d9a10d1e2d7516356c592a466a3b047932bdc561fafc89579f37d47752ad32caa25453795773f
data/README.md CHANGED
@@ -23,7 +23,19 @@ Or install it yourself as:
23
23
 
24
24
  ## Usage
25
25
 
26
- TODO: Write usage instructions here
26
+ Array form:
27
+
28
+ ```ruby
29
+ require 'rex12'
30
+
31
+ sgements = REX12::Document.read('myfilepath.edi')
32
+ some_date = segments.find {|seg| seg.segment_type=='DTM' && seg.elements[1].value=='056'}
33
+ if some_date
34
+ puts some_date.elements[2].value
35
+ else
36
+ puts "This is not the date you're looking for"
37
+ end
38
+ ```
27
39
 
28
40
  ## Development
29
41
 
@@ -0,0 +1,3 @@
1
+ module REX12
2
+ VERSION = "0.1.2"
3
+ end
@@ -5,6 +5,7 @@ module REX12; class ParseError < StandardError
5
5
  # REX12::Element that was being parsed when error was generated (may be nil)
6
6
  attr_reader :element
7
7
  def initialize message, segment=nil, element=nil
8
+ super(message)
8
9
  @segment = segment
9
10
  @element = element
10
11
  end
data/rex12.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'rex12/version'
4
+ require 'REX12/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "REX12"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: REX12
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Glick
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-16 00:00:00.000000000 Z
11
+ date: 2016-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -83,12 +83,12 @@ files:
83
83
  - Rakefile
84
84
  - bin/console
85
85
  - bin/setup
86
+ - lib/REX12/version.rb
86
87
  - lib/rex12.rb
87
88
  - lib/rex12/document.rb
88
89
  - lib/rex12/element.rb
89
90
  - lib/rex12/parse_error.rb
90
91
  - lib/rex12/segment.rb
91
- - lib/rex12/version.rb
92
92
  - rex12.gemspec
93
93
  homepage: https://github.com/Vandegrift/rex12
94
94
  licenses:
data/lib/rex12/version.rb DELETED
@@ -1,3 +0,0 @@
1
- module REX12
2
- VERSION = "0.1.0"
3
- end