{"id":18837073,"url":"https://github.com/bkuhlmann/spek","last_synced_at":"2025-04-14T06:22:02.689Z","repository":{"id":45695618,"uuid":"453540298","full_name":"bkuhlmann/spek","owner":"bkuhlmann","description":"An enhanced gem specification wrapper.","archived":false,"fork":false,"pushed_at":"2025-03-25T02:12:47.000Z","size":261,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T09:50:14.105Z","etag":null,"topics":["gem","ruby","specification"],"latest_commit_sha":null,"homepage":"https://alchemists.io/projects/spek","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bkuhlmann.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.adoc","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["bkuhlmann"]}},"created_at":"2022-01-29T23:08:12.000Z","updated_at":"2025-03-25T02:12:51.000Z","dependencies_parsed_at":"2023-02-12T17:31:00.480Z","dependency_job_id":"8cfae52f-27a6-490c-92e4-5e27f39908ea","html_url":"https://github.com/bkuhlmann/spek","commit_stats":{"total_commits":87,"total_committers":1,"mean_commits":87.0,"dds":0.0,"last_synced_commit":"0d645275b07f1091ad87157d242b3877b7432cb5"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkuhlmann%2Fspek","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkuhlmann%2Fspek/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkuhlmann%2Fspek/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkuhlmann%2Fspek/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bkuhlmann","download_url":"https://codeload.github.com/bkuhlmann/spek/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248830904,"owners_count":21168368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gem","ruby","specification"],"created_at":"2024-11-08T02:33:43.961Z","updated_at":"2025-04-14T06:22:02.659Z","avatar_url":"https://github.com/bkuhlmann.png","language":"Ruby","funding_links":["https://github.com/sponsors/bkuhlmann"],"categories":[],"sub_categories":[],"readme":":toc: macro\n:toclevels: 5\n:figure-caption!:\n\n= Spek\n\nSpek is short for _specification_ and enhances Ruby gem\nlink:https://guides.rubygems.org/specification-reference[specifications] with additional information\nand tooling. You can use this library as foundational support to build on top of with your own\nenhancements.\n\ntoc::[]\n\n== Features\n\n* Supports finding gems by name.\n* Supports loading gems by path to specification.\n* Supports picking gems by name with optional version selection.\n* Supports link:https://semver.org[semantic versions] via\n  link:https://alchemists.io/projects/versionaire[Versionaire].\n\n== Requirements\n\n. link:https://www.ruby-lang.org[Ruby].\n\n== Setup\n\nTo set up the project, run:\n\n[source,bash]\n----\nbin/setup\n----\n\n== Usage\n\nThis gem makes interacting with Ruby gems easier by providing foundational objects for which you can\nbuilt on top of. link:https://alchemists.io/projects/gemsmith[Gemsmith] is built on top of this\ngem if you need working example.\n\n=== Presenter\n\nThis object wraps the `Gem::Specification` for presentation purposes, provides semantic versioning, direct access to metadata information, pathnames, and other enriched information. You can obtain an\ninstance using the following code, for example:\n\n[source,ruby]\n----\nspecification = Gem::Specification.new do |spec|\n  spec.name = \"demo\"\n  spec.version = \"0.0.0\"\n  spec.authors = [\"Jill Smith\"]\n  spec.email = [\"demo@alchemists.io\"]\n  spec.homepage = \"https://alchemists.io/projects/demo\"\n  spec.summary = \"A demo summary.\"\n  spec.license = \"Hippocratic-2.1\"\n\n  spec.signing_key = Gem.default_key_path\n  spec.cert_chain = [Gem.default_cert_path]\n\n  spec.metadata = {\n    \"bug_tracker_uri\" =\u003e \"https://github.com/bkuhlmann/demo/issues\",\n    \"changelog_uri\" =\u003e \"https://alchemists.io/projects/demo/versions\",\n    \"homepage_uri\" =\u003e \"https://alchemists.io/projects/demo\",\n    \"funding_uri\" =\u003e \"https://github.com/sponsors/bkuhlmann\",\n    \"label\" =\u003e \"Demo\",\n    \"rubygems_mfa_required\" =\u003e \"true\",\n    \"source_code_uri\" =\u003e \"https://github.com/bkuhlmann/demo\"\n  }\nend\n\npresenter = Spek::Presenter.new specification\n\npresenter.allowed_push_host  # \"https://rubygems.org\"\npresenter.allowed_push_key   # \"rubygems_api_key\"\npresenter.authors            # [\"Jill Smith\"]\npresenter.banner             # \"Demo 0.0.0: A demo summary.\"\npresenter.certificate_chain  # [#\u003cPathname:~/.gem/gem-public_cert.pem\u003e]\npresenter.documentation_url  # \"https://alchemists.io/projects/demo\"\npresenter.emails             # [\"demo@alchemists.io\"]\npresenter.funding_url        # \"https://github.com/sponsors/bkuhlmann\"\npresenter.homepage_url       # \"https://alchemists.io/projects/demo\"\npresenter.issues_url         # \"https://github.com/bkuhlmann/demo/issues\"\npresenter.label              # \"Demo\"\npresenter.labeled_summary    # \"Demo: A demo summary.\"\npresenter.labeled_version    # \"Demo 0.0.0\"\npresenter.named_version      # \"demo 0.0.0\"\npresenter.package_name       # \"demo-0.0.0.gem\"\npresenter.package_path       # #\u003cPathname:tmp/demo-0.0.0.gem\u003e\npresenter.rubygems_mfa?      # true\npresenter.signing_key        # #\u003cPathname:~/.gem/gem-private_key.pem\u003e\npresenter.source_path        # #\u003cPathname:~/.cache/.../3.2.0/gems/demo-0.0.0\u003e\npresenter.source_url         # \"https://github.com/bkuhlmann/demo\"\npresenter.version            # #\u003cstruct Versionaire::Version major=0, minor=0, patch=0\u003e\npresenter.versions_url       # \"https://alchemists.io/projects/demo/versions\"\n----\n\nThe presenter is a read-only object so you'll only have access to _getter_ methods which are mostly\ndocumented link:https://guides.rubygems.org/specification-reference[here]. Please note that not all\nmethods map one-to-one so you'll want to look at the public API of this object for further details.\n\n=== Loader\n\nWhen given a path to a gem specification file, the loader will load a gem specification for you.\nExample:\n\n[source,ruby]\n----\npresenter = Spek::Loader.call \"path/to/my/test.gemspec\"\npresenter.class  # Spek::Presenter\n----\n\n=== Finder\n\nThe finder will find all gem specifications for a given name. Example:\n\n[source,ruby]\n----\npresenters = Spek::Finder.call \"refinements\"\npresenters.map(\u0026:class)  # [Spek::Presenter]\n----\n\n=== Picker\n\nWhen given a gem name, this will allow you pick from a list of gem versions if any. Otherwise, if\nmultiple versions don't exist, the first version found will be answered instead. Example:\n\n[source,ruby]\n----\nrequire \"dry/monads\"\n\ninclude Dry::Monads[:result]\n\ncase Spek::Picker.call(\"refinements\")\n  in Success(specification) then puts \"You selected: #{specification.name}.\"\n  in Failure(error) then puts error\nend\n----\n\nThe picker always answers a link:https://dry-rb.org/gems/dry-monads[monad] so you can quickly\nlink:https://alchemists.io/articles/ruby_pattern_matching[pattern match] for further action.\n\n=== Versioner\n\nWhen given a version and path, the versioner will update the version of your gem specification.\nExample:\n\n[source,ruby]\n----\nspecification = Spek::Versioner.call \"1.0.0\", \"path/to/my/test.gemspec\"\nspecification.version  # \u003cstruct Versionaire::Version major=1, minor=0, patch=0\u003e\n----\n\nThis makes it easier to automate the updating of your gem specification version information.\n\n== Development\n\nTo contribute, run:\n\n[source,bash]\n----\ngit clone https://github.com/bkuhlmann/spek\ncd spek\nbin/setup\n----\n\nYou can also use the IRB console for direct access to all objects:\n\n[source,bash]\n----\nbin/console\n----\n\n== Tests\n\nTo test, run:\n\n[source,bash]\n----\nbin/rake\n----\n\n== link:https://alchemists.io/policies/license[License]\n\n== link:https://alchemists.io/policies/security[Security]\n\n== link:https://alchemists.io/policies/code_of_conduct[Code of Conduct]\n\n== link:https://alchemists.io/policies/contributions[Contributions]\n\n== link:https://alchemists.io/policies/developer_certificate_of_origin[Developer Certificate of Origin]\n\n== link:https://alchemists.io/projects/spek/versions[Versions]\n\n== link:https://alchemists.io/community[Community]\n\n== Credits\n\n* Built with link:https://alchemists.io/projects/gemsmith[Gemsmith].\n* Engineered by link:https://alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkuhlmann%2Fspek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkuhlmann%2Fspek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkuhlmann%2Fspek/lists"}