{"id":28817530,"url":"https://github.com/hugomarquez/ffi-cups","last_synced_at":"2026-03-10T04:34:01.115Z","repository":{"id":47263443,"uuid":"358671546","full_name":"hugomarquez/ffi-cups","owner":"hugomarquez","description":"Ruby FFI C bindings for libcups","archived":false,"fork":false,"pushed_at":"2023-10-10T08:31:07.000Z","size":74,"stargazers_count":9,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-01T11:37:17.734Z","etag":null,"topics":["cups","cups-api","cups-server","ffi","ffi-bindings","ffi-cups","ruby","rubygem","rubygems"],"latest_commit_sha":null,"homepage":"","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/hugomarquez.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,"governance":null}},"created_at":"2021-04-16T17:21:32.000Z","updated_at":"2025-06-13T07:11:37.000Z","dependencies_parsed_at":"2022-09-09T00:52:41.528Z","dependency_job_id":null,"html_url":"https://github.com/hugomarquez/ffi-cups","commit_stats":{"total_commits":38,"total_committers":2,"mean_commits":19.0,"dds":0.02631578947368418,"last_synced_commit":"749c726a131926f396dcf7ef558c60dd2685c39f"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/hugomarquez/ffi-cups","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugomarquez%2Fffi-cups","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugomarquez%2Fffi-cups/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugomarquez%2Fffi-cups/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugomarquez%2Fffi-cups/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugomarquez","download_url":"https://codeload.github.com/hugomarquez/ffi-cups/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugomarquez%2Fffi-cups/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30324450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"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":["cups","cups-api","cups-server","ffi","ffi-bindings","ffi-cups","ruby","rubygem","rubygems"],"created_at":"2025-06-18T18:30:29.365Z","updated_at":"2026-03-10T04:34:01.100Z","avatar_url":"https://github.com/hugomarquez.png","language":"Ruby","readme":"# FFI-Cups\n[![Gem Version](https://badge.fury.io/rb/ffi-cups.svg)](https://badge.fury.io/rb/ffi-cups)\n\nffi-cups is a FFI bindings for libcups providing access to the Cups API through Ruby.\n\nCUPS is the standards-based, open source printing system developed by Apple Inc. for macOS® and other UNIX®-like operating systems. CUPS uses the Internet Printing Protocol (IPP) to support printing to local and network printers. - from http://www.cups.org/\n\n## Installation\n```bash\ngem install ffi-cups\n```\n\n## Setup \u0026 Requirements\nffi-cups requires libcups2 to be installed\n\n## Example usage\n```ruby\nrequire 'ffi-cups'\n\nprinters = Cups::Printer.get_destinations\n# [#\u003cCups::Printer:0x000055fe50b15798 @name=\"Virtual_PDF_Printer\",\n#  @options={\"copies\"=\u003e\"1\", \"device-uri\"=\u003e\"cups-pdf:/\", \"finishings\"=\u003e\"3\" \n#  \"job-cancel-after\"=\u003e\"10800\", \"job-hold-until\"=\u003e\"no-hold\", ...\n\nprinter = Cups::Printer.get_destination(\"Virtual_PDF_Printer\")\n# \u003cCups::Printer:0x0000560f1d4e0958 @name=\"Virtual_PDF_Printer\", @options={\"copies\"=\u003e\"1\" \n#   \"device-uri\"=\u003e\"cups-pdf:/\", ...\n\nprinter.state\n# :idle \n\nprinter.state_reasons\n# [\"none\"]\n\n# Print a file (PDF, JPG, etc) you can pass a hash of printing options if you\n# want to override the printer's default. See Cups::Constants for more options\noptions = {\n  Cups::MEDIA =\u003e Cups::MEDIA_A4,\n  Cups::ORIENTATION =\u003e Cups::ORIENTATION_LANDSCAPE\n}\n\njob = printer.print_file('/tmp/example.jpg', 'Title', options)\n# \u003cCups::Job:0x000055c87104d1e0 @id=10, @title=\"README\", @printer=\"Virtual_PDF_Printer\", @format=\"text/plain\", @state=:processing, @size=4, @completed_time=1969-12-31 18:00:00 -0600, @creation_time=2021-04-18 17:35:04 -0500, @processing_time=2021-04-18 17:35:04 -0500\u003e \n\n# Get all jobs from a printer\njobs = Cups::Job.get_jobs('Virtual_PDF_Printer')\n# [#\u003cCups::Job:0x0000563aa6359008 @id=1, @title=\"Test Print\", @printer=\"Virtual_PDF_Printer\", @format=\"text/plain\", @state=:completed, @size=1, @completed_time=2021-04-08 07:06:23 -0500, @creation_time=2021-04-08 07:06:18 -0500, @processing_time=2021-04-08 07:06:18 -0500\u003e, ...]\n\n# filtering job's query, see Constants file for more options\njobs = Cups::Job.get_jobs('Virtual_PDF_Printer', Cups::WHICHJOBS_ACTIVE)\n\n# Query job with id and printer's name\njob = Cups::Job.get_job(10, 'Virtual_PDF_Printer')\n# \u003cCups::Job:0x000055c870fc8490 @id=10, @title=\"README\", @printer=\"Virtual_PDF_Printer\", @format=\"text/plain\", @state=:completed, @size=4, @completed_time=2021-04-18 17:35:04 -0500, @creation_time=2021-04-18 17:35:04 -0500, @processing_time=2021-04-18 17:35:04 -0500\u003e\n```\n\n## Remote CUPS Server\nYou may create a connection object passing a :hostname and/or :port arguments.\n\n```ruby\n# Create a Connection object with hostname and/or port\nconnection = Cups::Connection.new('print.example.com')\n\n# Get all printers from the remote connection\nremote_printers = Cups::Printer.get_destinations(connection)\n```\n\n## Documentation\nCheck out the documentation - [docs](https://www.rubydoc.info/gems/ffi-cups/0.2.1)\n\n## Authors\n- Hugo Marquez @ www.hugomarquez.mx\n- Contributors @ https://github.com/hugomarquez/ffi-cups/graphs/contributors\n\n## License\nThe MIT License\n\nCopyright (c) 2022 Hugo Marquez \u0026 Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugomarquez%2Fffi-cups","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugomarquez%2Fffi-cups","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugomarquez%2Fffi-cups/lists"}