
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
This library contains the most root objects I found myself re-implementing over and over. It is meant to serve as an abstract base for object modeling a domain.
To install through Rubygems:
gem install primitive
You can also add this to your Gemfile using:
bundle add primitive
Base class for objects identified by a string value (ID). Extension examples:
class Team < Primitive::Entity
attr_reader :name
def initialize(id:, name:)
super(id)
@name = name
end
end
# Not allowing direct manipulation of ID in the case it is controlled by the repository.
class Player < Primitive::Entity
attr_reader :name
def initialize(name:)
super()
@name = name
end
end
Several features are now provided by its base-class via the ID attribute:
#eql?
and #==
#hash
#<=>
#to_s
An interface that describes how a repository should function for loading/saving entities. A concrete example (albeit simple) is the Primitive::CompactFile
class which leverages YAML for serialization. Note that ID, in this case, is representative of the file path.
Basic steps to take to get this repository compiling:
To execute the test suite run:
bin/rspec spec --format documentation
Alternatively, you can have Guard watch for changes:
bin/guard
Also, do not forget to run Rubocop:
bin/rubocop
And auditing the dependencies:
bin/bundler-audit check --update
And Sorbet:
bin/srb
Note: ensure you have proper authorization before trying to publish new versions.
After code changes have successfully gone through the Pull Request review process then the following steps should be followed for publishing new versions:
version.rb
using semantic versioningbundle
CHANGELOG.md
with release notesbin/rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.Everyone interacting in this codebase, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
This project is MIT Licensed.
FAQs
Unknown package
We found that primitive demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.