metanorma / oscal-ruby

Gem for accessing/writing OSCAL content
BSD 2-Clause "Simplified" License
5 stars 3 forks source link

Updates for Assessment Result with some general refactoring #21

Closed RS-Credentive closed 4 months ago

RS-Credentive commented 4 months ago

Hi, I have made several updates to the oscal-ruby library. I haven't made any changes to the existing files, so it should continue to work as before for existing code. I implemented the "Assessment Result" assembly, but I made some changes to the functionality of the library as part of this work.

First, I have implemented some new basic classes:

OscalDatatype - represents basic Oscal Datatypes. Subclasses String and provides a validation function against a Regex Assembly - Represents a Metaschema "Assembly", and ensures conformance of the fields/flags to the specification OscalArray - a class that represents an Array of Oscal Datatypes or Assemblies.

Hopefully the code is pretty self-explanatory, but I am a python guy who hasn't written ruby in several years, so it might not be idiomatic ruby. I am very happy to accept suggestions and recommendations on how to make this fit more with the ruby ecosystem.

I am using ruby 3.3.0 for this, but I'm not sure if I am using any features that will not work with Ruby 2.5.

This PR aligns the library more closely to Metaschema, but is still written by hand. I have some ideas for implementing metaschema in the library in a different branch, and I am working on a python-metaschema library that I would love to collaboration with your team on.

RS-Credentive commented 4 months ago

Woah, missed a big bug! I'm retracting this but I will be back soon!