{"id":16701682,"url":"https://github.com/coryodaniel/yodeler-old","last_synced_at":"2025-03-14T06:41:43.764Z","repository":{"id":20416323,"uuid":"23692667","full_name":"coryodaniel/yodeler-old","owner":"coryodaniel","description":"Spouting nonsense no one wants to hear.","archived":false,"fork":false,"pushed_at":"2015-02-26T02:07:05.000Z","size":236,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-21T01:26:19.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/coryodaniel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-05T06:25:29.000Z","updated_at":"2016-01-08T00:42:32.000Z","dependencies_parsed_at":"2022-07-31T19:08:08.887Z","dependency_job_id":null,"html_url":"https://github.com/coryodaniel/yodeler-old","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2Fyodeler-old","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2Fyodeler-old/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2Fyodeler-old/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2Fyodeler-old/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coryodaniel","download_url":"https://codeload.github.com/coryodaniel/yodeler-old/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243538121,"owners_count":20307101,"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":"2024-10-12T18:45:10.625Z","updated_at":"2025-03-14T06:41:43.727Z","avatar_url":"https://github.com/coryodaniel.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yodeler\n=======\n\nSpouting noise to whoever is listening.\n\nYodeler is an easy way to notify users of different events that occur in your app.\n\n  * Notify your marketing team on the 10,000 sign-up.\n  * Notify user's when their profile has been viewed\n  * Notify your dev team about events that are not quite exception worthy, but you don't want to dig through a bunch of logs to find.\n\n\nFeatures\n========\n\n  * store notifications via ActiveRecord\n  * benchmark event duration\n  * i18n support  \n  * flexible payloads\n\n\nWhat's wrong with XMPP?\n=======================\n\n  Why don't you fly to Walmart on a rocket?\n\n  Don't even say it's because you don't have a rocket.\n\n  Why don't you kill ants with a bazooka?\n\n  Nevermind, you get it.\n\n\nUsage\n=====\n\n```ruby\n# in config/initializers/yodeler.rb\nYodeler.register :another_thousand_users\n\nYodeler.register :view_user do\n  # Default states are unread: 0, read: 1\n  config.states = {\n    unread:    0,\n    read:      1,\n    ignored:   2\n  }\nend\n```\n\n```ruby\n# in a controller or Anywhere you want to hear some noise\nclass UserController \u003c ApplicationController\n  around_action :track_user_view, only: :show\n  \n  def show\n    # do your User#show as normal\n  end\n\n  private\n\n  def track_user_view\n    # This will also benchmark the action since it is in a block\n    Yodeler.dispatch :view_user, {viewer_id: 3, viewee_id: 23} do |payload|\n      yield #yield the action dispatch, the payload is available\n    end\n  end\nend\n```\n\n```ruby\n# off in some scorned rails-observer\nclass UserObserver\n  observers :user\n\n  def after_create\n    # let the marketing know another thousandth user has registered!\n    if (User.count % 1000).zero?\n      Yodeler.dispatch :another_thousand_users, {give_him_a_prize: @user.id}\n    end\n  end\nend\n```\n\n\nGetting around the objects\n==========================\n\n```ruby\n@event.subscriptions #=\u003e Array\u003cYodeler::Subscription\u003e all subscriber subscriptions\n@event.notifications #=\u003e Array\u003cYodeler::Notifications\u003e\n\n@notification.subscriber #=\u003e Your 'subscriber' class, delegated to #subscription\n@notification.subscription.subscriber\n@notification.event #=\u003e The subscriber to event, delegated to #subscription\n@notification.message #=\u003e i18n message interpolated w/ the payload\n\n@subscription.subscriber #=\u003e the 'subscriber' subscribed to this event\n@subscription.notifications #=\u003e all notifications of this event type for this subscriber\n@subscription.event\n\n```\n\nTODO\n=======\n* Pluggable back-end, redis, obvi","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoryodaniel%2Fyodeler-old","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoryodaniel%2Fyodeler-old","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoryodaniel%2Fyodeler-old/lists"}