{"id":28509133,"url":"https://github.com/atomicobject/publisher","last_synced_at":"2025-07-02T23:31:27.031Z","repository":{"id":718733,"uuid":"365862","full_name":"atomicobject/publisher","owner":"atomicobject","description":"Simple event firing/subscribing mechanism in Ruby.","archived":false,"fork":false,"pushed_at":"2012-09-09T22:12:23.000Z","size":1553,"stargazers_count":23,"open_issues_count":0,"forks_count":4,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-06-08T22:08:06.646Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://atomicobject.github.com/publisher","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atomicobject.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-11-09T03:16:23.000Z","updated_at":"2018-08-14T15:19:51.000Z","dependencies_parsed_at":"2022-08-16T10:45:21.219Z","dependency_job_id":null,"html_url":"https://github.com/atomicobject/publisher","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/atomicobject/publisher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fpublisher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fpublisher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fpublisher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fpublisher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomicobject","download_url":"https://codeload.github.com/atomicobject/publisher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fpublisher/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263232550,"owners_count":23434692,"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":[],"created_at":"2025-06-08T22:07:32.471Z","updated_at":"2025-07-02T23:31:26.987Z","avatar_url":"https://github.com/atomicobject.png","language":"Ruby","readme":"== Publisher\n\n* http://atomicobject.github.com/publisher\n* http://github.com/atomicobject/publisher\n* http://rubygems.org/gems/publisher\n* http://rubydoc.info/gems/publisher/frames\n\n== Description\n  \npublisher is a module for extending a class with event subscription and firing capabilities.  This is helpful for implementing objects that participate in the Observer design pattern.\n\n== Features\n  \n* Nice syntax for declaring events that can be subscribed for\n* Convenient event firing syntax\n* Subscribe / unsubscribe functionality\n* Several method name aliases give you the flexibility to make your code more readable (eg, *fire*, *notify*, *emit*)\n\n== Synopsis\n\n  require 'rubygems'\n  require 'publisher'\n\n  class CustomerListHolder\n    extend Publisher\n    can_fire :customer_added, :list_cleared\n\n    def add_customer(cust)\n      (@list ||= []) \u003c\u003c cust\n      fire :customer_added, cust\n    end\n\n    def clear_list\n      @list.clear\n      fire :list_cleared\n    end\n  end\n\n  holder = CustomerListHolder.new\n  holder.when :customer_added do |cust|\n    puts \"Customer added! #{cust}\"\n  end\n  holder.when :list_cleared do\n    puts \"All gone.\"\n  end\n\n  holder.add_customer(\"Croz\")\n  holder.add_customer(\"Matt\")\n  holder.clear_list\n\n== Install\n\n* gem install publisher\n\n== License\n\n(The MIT License)\n\nCopyright (c) 2011 Atomic Object\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicobject%2Fpublisher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomicobject%2Fpublisher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicobject%2Fpublisher/lists"}