{"id":24678300,"url":"https://github.com/firstclasspostcodes/firstclasspostcodes-ruby","last_synced_at":"2026-05-19T06:34:30.466Z","repository":{"id":56846599,"uuid":"233236927","full_name":"firstclasspostcodes/firstclasspostcodes-ruby","owner":"firstclasspostcodes","description":"💎 Ruby library for the Firstclasspostcodes API","archived":false,"fork":false,"pushed_at":"2020-04-03T08:20:09.000Z","size":57,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-06T05:06:21.546Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://firstclasspostcodes.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firstclasspostcodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-11T13:34:11.000Z","updated_at":"2020-04-03T08:20:10.000Z","dependencies_parsed_at":"2022-09-17T21:53:52.510Z","dependency_job_id":null,"html_url":"https://github.com/firstclasspostcodes/firstclasspostcodes-ruby","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/firstclasspostcodes/firstclasspostcodes-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstclasspostcodes%2Ffirstclasspostcodes-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstclasspostcodes%2Ffirstclasspostcodes-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstclasspostcodes%2Ffirstclasspostcodes-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstclasspostcodes%2Ffirstclasspostcodes-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstclasspostcodes","download_url":"https://codeload.github.com/firstclasspostcodes/firstclasspostcodes-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstclasspostcodes%2Ffirstclasspostcodes-ruby/sbom","scorecard":{"id":401213,"data":{"date":"2025-08-11","repo":{"name":"github.com/firstclasspostcodes/firstclasspostcodes-ruby","commit":"8fbf2a16d1f08934b7868d902164583160318fd1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/gem.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gem.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/firstclasspostcodes/firstclasspostcodes-ruby/gem.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gem.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/firstclasspostcodes/firstclasspostcodes-ruby/gem.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T20:08:06.436Z","repository_id":56846599,"created_at":"2025-08-18T20:08:06.436Z","updated_at":"2025-08-18T20:08:06.436Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33204729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"online","status_checked_at":"2026-05-19T02:00:06.763Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-01-26T13:16:35.331Z","updated_at":"2026-05-19T06:34:30.450Z","avatar_url":"https://github.com/firstclasspostcodes.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Cover](/.github/images/cover.png)\n\n# Firstclasspostcodes\nThe Firstclasspostcodes Ruby library provides convenient access to the Firstclasspostcodes API from applications written in the Ruby language. It includes pre-defined methods and helpers to help you easily integrate the library into any application.\n\nThe library also provides other features. For example:\n\n* Easy configuration path for fast setup and use.\n* Helpers for listing and formatting addresses.\n* Built-in methods for easily interacting with the Firstclasspostcodes API.\n\n## Documentation\nSee [Ruby API docs](https://docs.firstclasspostcodes.com/ruby/getting-started) for detailed usage and examples.\n\n## Installation\nYou don't need this source code unless you want to modify the gem. If you just want to use the package, just run:\n\n```\ngem install firstclasspostcodes\n```\n\nOr alternatively, install from the GitHub package registry:\n\n```\ngem install firstclasspostcodes --source \"https://rubygems.pkg.github.com/firstclasspostcodes\"\n```\n\nIf you want to build the gem from source:\n\n```\ngem build firstclasspostcodes.gemspec\n```\n\n## Requirements\n\n* Ruby 2.3+\n* An API key from [https://firstclasspostcodes.com](https://firstclasspostcodes.com)\n\n## Bundler\n\nIf you are installing via bundler, you should be sure to use the https rubygems source in your Gemfile, as any gems fetched over http could potentially be compromised in transit and alter the code of gems fetched securely over https:\n\n```ruby\nsource 'https://rubygems.org'\n\ngem 'rails'\ngem 'firstclasspostcodes'\n```\n\nWe also host this gem on the [GitHub Package Registry](https://github.com/firstclasspostcodes/firstclasspostcodes-ruby/packages/108443):\n\n```ruby\nsource \"https://rubygems.pkg.github.com/firstclasspostcodes\" do\n  gem \"firstclasspostcodes\", \"0.1.0\"\nend\n```\n\n## Usage\nOnce you have configured the library, initialise a client and start calling the API.\n\n```ruby\nrequire 'firstclasspostcodes'\nrequire 'json'\n\nFirstclasspostcodes.configure do |c|\n  c.api_key = 'sw34567ujbvcd'\nend\n\nclient = Firstclasspostcodes::Client.new\n\nresponse = client.get_postcode('SW13 6HY')\n\nputs JSON.pretty_generate(response)\n```\n\n## Configuration\nThe library can be configured with several options depending on the requirements of your setup:\n\n```ruby\nrequire 'firstclasspostcodes'\n\nAPI_KEY = 'werthj75rtfgds'\n\nFirstclasspostcodes.configure do |c|\n  # The API Key to be used when sending requests to the \n  # Firstclasspostcodes API\n  c.api_key = API_KEY\n\n  # The host to send API requests to. This is typically changed\n  # to use the mock service for testing purposes\n  c.host = \"api.firstclasspostcodes.com\"\n  \n  # The default content type is json, but can be changed to \"geo+json\"\n  # to return responses as GeoJSON content type\n  c.content = \"json\"\n\n  # Typically, always HTTPS, but useful to change for testing\n  # purposes\n  c.protocol = \"https\"\n\n  # The base path is \"/data\", but useful to change for testing\n  # purposes\n  c.base_path = \"/data\"\n  \n  # The default logger being used with the library. This defaults\n  # to the Rails logger (if it is available)\n  c.logger = Logger.new(STDOUT)\n\n  # Output helpful debug statements to STDOUT\n  c.debug = false\n\n  # The default request timeout for the library.\n  c.timeout = 30\nend\n```\n\n## Events\nYou can subscribe to events using an initialized client, using the Ruby block pattern.\n\n```ruby\nrequire 'firstclasspostcodes'\nrequire 'json'\n\nclient = Firstclasspostcodes::Client.new\n\nclient.on(:request) do |request_params|\n  puts JSON.pretty_generate(request_params)\nend\n```\n\n| Event name | Description |\n|:-----|:-----|\n| `request` | Triggered before a request is sent. The request object to be sent is passed to the event handler. |\n| `response` | Triggered with the parsed JSON response body upon a successful reques. |\n| `error` | Triggered with a client error when the request fails. |\n| `operation:{name}` | Triggered by an operation with the parameter object. |\n\n**Note:** `{name}` is replaced with the operation name of the method, as defined inside the OpenAPI specification.\n\n## Debugging\nDebugging through logging can be enabled inside the configuration (demonstrated below). A custom logger can also be assigned if required.\n\n```ruby\nrequire 'firstclasspostcodes'\nrequire 'logger'\n\ncustom_logger = Logger.new(STDOUT)\ncustom_logger.level = Logger::DEBUG\n\nFirstclasspostcodes.configure do |c|\n  c.debug = true\n  c.logger = custom_logger\nend\n```\n\n## Integration / Testing\nWe provide a mock service of our API as a docker container [available here](https://github.com/firstclasspostcodes/firstclasspostcodes-mock). Once the container is running, the library can be easily configured to use it:\n\n```ruby\nrequire \"firstclasspostcodes\"\nrequire \"uri\"\n\nMOCK_API_URL = \"http://localhost:3000\"\n\nMOCK_API_KEY = \"111111111111\"\n\nuri = URI.parse(MOCK_API_URL)\n\nFirstclasspostcodes.configure do |c|\n  # The mock API key is always 111111111111 (\"12x1\")\n  c.api_key = MOCK_API_KEY\n  \n  # Alter the configuration to use the mock service\n  c.base_path = uri.path\n  c.protocol = uri.scheme\n  c.host = uri.host\n  c.host = \"#{uri.host}:#{uri.port}\" if uri.port\nend\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstclasspostcodes%2Ffirstclasspostcodes-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstclasspostcodes%2Ffirstclasspostcodes-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstclasspostcodes%2Ffirstclasspostcodes-ruby/lists"}