-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Reorganization #164
WIP: Reorganization #164
Conversation
…s, revealing a couple more instances of ambiguous grammar
… in Validation::Ambiguity, add specs
…rom a char already used in data elements
…:FunctionalGroups, Stupidedi::Versions::Interchanges
afde1ed
to
132abf0
Compare
132abf0
to
953dafa
Compare
specs for IdentifierStack and fix a bug; Change Navigation#elementn to strictly validate its arguments, even when corresponding data is not present; Fix validation in Navigation#iterate (#126); Write many more specs
… ID, Nn, R, TM) - Invalid#map and Invalid#copy always return Invalid - Invaild#== is now #eql?, so it will not == nil any longer - Empty#map and Empty#copy always call the type's .value constructor; previously sometimes it only constructed another Empty - Empty#== is true for "" on AN and ID, and nil on DT, Nn, R, TM - Empty#value is now implemented and returns "" for AN and ID, and nil for DT, Nn, R, and TM - Empty#map now yields #value, which is either nil or "" - All non-Invalid values implement #coerce - Each type now has a case in .value for when the argument is already the correct type (similar to a copy constructor), this is used in #coerce - Each type also has a case in .value for the data in #value of the corresponding type, so eg. DateVal.value(date_val.value) == date_val - DateVal::Improper#value is now [year, month, day], and now #map yields this single argument (a three-element array) instead of three arguments - TimeVal::Valid#value is now [hour, minute, second], and now #map yields this single argument instead of three arguments - Greatly reduce duplication of specs for each element type by using shared_examples for invalid, empty, and non-empty cases
improve the style of existing specs by using expect { } instead of expect(lambda { })
strict; implement remaining 'todo' specs
Hey @irobayna, this is probably ready to merge, but I'm hoping you can try it out first. There are lot more specs, but it's still possible I missed something among all the changes in this branch. The goal is to be backward compatible with the current release. So let me know if you're able to do any smoke testing and find a problem. I will take a day or so to make sure all the changes are documented in the PR description above, then it should be good to merge. |
@kputnam I will try it out and let you know |
@kputnam seeing this issue with this release while parsing a document
This is the culprit (worked on previous version) service[:code] = svc.element(6, 2).map(&:node).fetch(0).to_s |
I have a hunch what's going on. Do you know if that particular SVC segment has an empty value in SVC02? I'll see if I can reproduce it, but if you can past the SVC segment then I can be more certain of fixing the right thing. |
@kputnam
|
Oops, I should have said SVC06. Looks like that isn't present. Definitely a regression, apparently caused by not checking that SVC06 occurs before trying to get SVC06-02. Thanks, I should be able to fix it soon! |
Should be fixed now, @irobayna |
@kputnam That problem is fixed now. On another project that leverages stupidEDI I have 6 specs failing. Will take a look as to what's the problem and report back. |
@kputnam So far so good, I have exercised the system and I am happy to report, it works. I get a lot of deprecations warnings (rightly so). Did not try to get rid of them now as I will have to it once we merge this code. Thanks! |
@irobayna thanks for testing the waters! I spent a few hours trying to clean up the commit history a little, but gave up and decided it wasn't worth the time. Now that I've let it sit for a couple weeks, I'll review everything one last time with fresh eyes and make sure it's well-documented. We can probably merge this weekend. |
@kputnam seems like you merged this PR already, I have updated the version to |
Yep, I just merged. Thanks for updating the version, and feel free to release whenever you like. Hopefully this goes smoothly! 😓 |
@kputnam All set! |
This isn't quite ready to merge, since there might be a few more potentially breaking changes still coming. Quite a few changes here:
Bug fixes
Standards::FortyTen::HC837
Standards::FiftyTen::BE834
Standards::FiftyTen::HB271
Standards::FiftyTen::RA820
"10B"
would be read as10.0
, and"AB10"
would be read as0.0
due to using bigdecimal/util's implementation ofString#to_d
TimeVal
issue in all versions (not only005010
)Added
Stupidedi::Parser.build
as a shortcut forStupidedi::Parser::StateMachine.build
RA820
and others.edi-pp
can now print different formats with--format html
,--format x12
, and--format tree
(default)Deprecation notices
Symbol#call
andSymbol#to_proc
refinementsRenamed
Stupidedi::Builder
is renamed toStupidedi::Parser
Stupidedi::Guides::*::GuideBuilder
is renamed toStupidedi::TransactionSets::Builder
Stupidedi::Versions::Interchanges
is renamed toStupidedi::Interchanges
Stupidedi::Versions::FunctionalGroups
is renamed toStupidedi::Versions
Stupidedi::Versions::Common
HC837P
andHC837I
toHC837
Guides
andContrib
, toStupidedi::TransactionSets
::Standards
and::Implementations
Stupidedi::Schema::Auditor
is renamed toStupidedi::TransactionSets::Validation::Ambiguity
Most of these renames aren't breaking changes (yet), but using the old name will print a warning:
Specs
spec/fixtures/<version>/<name>/pass/*.x12
rcov
. Use onlysimplecov
nowexpect(value).to matcher
syntax, instead ofvalue.should matcher
id
(eg,E123.id == :E123
)id
(egST.id == :ST
)Config.hipaa
,Config.contrib
, andConfig.default
reference valid definitionsStupidedi::TransactionSets::Validation::Ambiguity
\n
as a segment terminator but didn't have one afterIEA
Miscellaneous
examples/
that demonstrate undocumentedIdentifierStack
, and moreStupidedi::TransactionSets::Builder.build
no longer requires aTransactionSetDef
argument