{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":669905153,"defaultBranch":"master","name":"decorator","ownerLogin":"withbelay","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2023-07-23T20:08:32.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/63662837?v=4","public":true,"private":false,"isOrgOwned":true},"refInfo":{"name":"","listCacheKey":"v0:1707516826.0","currentOid":""},"activityList":{"items":[{"before":"4e7022f43987bcbbdbda4013344c6429bb4fed67","after":null,"ref":"refs/tags/v1.4.7-a","pushedAt":"2024-02-09T22:13:46.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"leggebroten","name":"lee eggebroten","path":"/leggebroten","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5223530?s=80&v=4"}},{"before":"f4c3220a81b0281896716b0b6b461756172919b9","after":null,"ref":"refs/tags/v1.4.1","pushedAt":"2024-02-09T19:44:10.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"leggebroten","name":"lee eggebroten","path":"/leggebroten","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5223530?s=80&v=4"}},{"before":"f4c3220a81b0281896716b0b6b461756172919b9","after":null,"ref":"refs/tags/v1.4.1","pushedAt":"2024-02-09T19:43:29.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"leggebroten","name":"lee eggebroten","path":"/leggebroten","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5223530?s=80&v=4"}},{"before":"f4c3220a81b0281896716b0b6b461756172919b9","after":"4e7022f43987bcbbdbda4013344c6429bb4fed67","ref":"refs/heads/master","pushedAt":"2024-02-09T19:42:19.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"leggebroten","name":"lee eggebroten","path":"/leggebroten","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5223530?s=80&v=4"},"commit":{"message":"Ensure any trailing whitespace doesn't mess up Elixir version","shortMessageHtmlLink":"Ensure any trailing whitespace doesn't mess up Elixir version"}},{"before":"9bea402a54f9b542c5d8669cff1b021bb6a88afd","after":"f4c3220a81b0281896716b0b6b461756172919b9","ref":"refs/heads/master","pushedAt":"2024-02-09T18:44:10.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"leggebroten","name":"lee eggebroten","path":"/leggebroten","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5223530?s=80&v=4"},"commit":{"message":"Update VERSION\n\nAdded __decorated_functions__ function to the created macro so that unit tests could assert the proper decoration had been done and not have to assert the decorated functionality","shortMessageHtmlLink":"Update VERSION"}},{"before":"3f8be23bb3b60e8c49b525898492c2a52a2d5f62","after":null,"ref":"refs/heads/add_decorated_functions","pushedAt":"2024-02-09T18:41:43.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"leggebroten","name":"lee eggebroten","path":"/leggebroten","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5223530?s=80&v=4"}},{"before":"a32053ae884014320940d2a8cefe55181203db93","after":"9bea402a54f9b542c5d8669cff1b021bb6a88afd","ref":"refs/heads/master","pushedAt":"2023-07-24T15:05:22.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"leggebroten","name":"lee eggebroten","path":"/leggebroten","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5223530?s=80&v=4"},"commit":{"message":"Merge pull request #1 from withbelay/add_decorated_functions\n\nAdded a \"reflection\" function `__decorated_functions__` to return lis…","shortMessageHtmlLink":"Merge pull request #1 from withbelay/add_decorated_functions"}},{"before":"f5d666607e68eb84e820c630ae9a221f043f428f","after":"3f8be23bb3b60e8c49b525898492c2a52a2d5f62","ref":"refs/heads/add_decorated_functions","pushedAt":"2023-07-24T14:57:39.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"leggebroten","name":"lee eggebroten","path":"/leggebroten","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5223530?s=80&v=4"},"commit":{"message":"Added a \"reflection\" function `__decorated_functions__` to return list of all decorated functions\n\n### Simple reflection for all decorated functions\nA \"hidden\" function `__decorated_functions__/0` is added to any module that decorates functions and returns a list of\nall decorated functions within that module.\n\nThis can be useful for testing purposes since you don't have to assert the decorated behaviors of the decorated\nfunctions. So long as your decorator function is well tested, you can just assert the expected decorators are present\nfor the given function.\n\nThe function returns a map with the function name and arguments as the key and a list of tuples with the decorator.\nThis permits multiple decorators to be asserted with a single function call so that adding new decorators will cause\nthe assertion to fail.\n\nFor example, given the following module:\n```elixir\n defmodule NewModule do\n use Decorator.Define, [new_decorator: 1, another_decorator: 2]\n\n @decorate new_decorator(\"one\")\n def func(%StructOne{} = msg) do\n msg\n end\n\n @decorate new_decorator(\"two\")\n @decorate another_decorator(\"a\", \"b\")\n @decorate new_decorator(\"b\")\n def func(%StructTwo{c: 2} = _msg) do\n :ok\n end\n end\n```\n\nYou can assert the decorated functions like so:\n```elixir\n test \"Module with decorated functions are returned by `__decorated_functions__()\" do\n assert %{\n {:func, [\"%StructOne{} = msg\"]} => [\n {DecoratorTest.Fixture.NewDecorator, :new_decorator, [\"one\"]}\n ],\n {:func, [\"%StructTwo{c: 2} = _msg\"]} => [\n {DecoratorTest.Fixture.NewDecorator, :new_decorator, [\"two\"]},\n {DecoratorTest.Fixture.AnotherDecorator, :another_decorator, [\"a\", \"b\"]},\n {DecoratorTest.Fixture.NewDecorator, :new_decorator, [\"b\"]}\n ]\n } == NewModule.__decorated_functions__()\n end\n```\n\nObviously, any changes to the parameters of the decorated function will cause the simple assertion to fail, but that's\nintentional, as the decorator may be dependent on the parameters of the decorated function.","shortMessageHtmlLink":"Added a \"reflection\" function __decorated_functions__ to return lis…"}},{"before":null,"after":"f5d666607e68eb84e820c630ae9a221f043f428f","ref":"refs/heads/add_decorated_functions","pushedAt":"2023-07-23T20:36:57.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"leggebroten","name":"lee eggebroten","path":"/leggebroten","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5223530?s=80&v=4"},"commit":{"message":"Added a \"reflection\" function `__decorated_functions__` to return list of all decorated functions\n\n### Simple reflection for all decorated functions\nA \"hidden\" function `__decorated_functions__/0` is added to any module that decorates functions and returns a list of\nall decorated functions within that module.\n\nThis can be useful for testing purposes since you don't have to assert the decorated behaviors of the decorated\nfunctions. So long as your decorator function is well tested, you can just assert the expected decorators are present\nfor the given function.\n\nThe function returns a map with the function name and arguments as the key and a list of tuples with the decorator.\nThis permits multiple decorators to be asserted with a single function call so that adding new decorators will cause\nthe assertion to fail.\n\nFor example, given the following module:\n```elixir\n defmodule NewModule do\n use Decorator.Define, [new_decorator: 1, another_decorator: 2]\n\n @decorate new_decorator(\"one\")\n def func(%StructOne{} = msg) do\n msg\n end\n\n @decorate new_decorator(\"two\")\n @decorate another_decorator(\"a\", \"b\")\n @decorate new_decorator(\"b\")\n def func(%StructTwo{c: 2} = _msg) do\n :ok\n end\n end\n```\n\nYou can assert the decorated functions like so:\n```elixir\n test \"Module with decorated functions are returned by `__decorated_functions__()\" do\n assert %{\n {:func, [\"%StructOne{} = msg\"]} => [\n {DecoratorTest.Fixture.NewDecorator, :new_decorator, [\"one\"]}\n ],\n {:func, [\"%StructTwo{c: 2} = _msg\"]} => [\n {DecoratorTest.Fixture.NewDecorator, :new_decorator, [\"two\"]},\n {DecoratorTest.Fixture.AnotherDecorator, :another_decorator, [\"a\", \"b\"]},\n {DecoratorTest.Fixture.NewDecorator, :new_decorator, [\"b\"]}\n ]\n } == NewModule.__decorated_functions__()\n end\n```\n\nObviously, any changes to the parameters of the decorated function will cause the simple assertion to fail, but that's\nintentional, as the decorator may be dependent on the parameters of the decorated function.","shortMessageHtmlLink":"Added a \"reflection\" function __decorated_functions__ to return lis…"}},{"before":"e142933f9ae15dd2d1dcda3bd0dec007a344bebc","after":"a32053ae884014320940d2a8cefe55181203db93","ref":"refs/heads/master","pushedAt":"2023-07-23T20:35:57.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"leggebroten","name":"lee eggebroten","path":"/leggebroten","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5223530?s=80&v=4"},"commit":{"message":"Add test case to verify we can decorate 'defdelegate'","shortMessageHtmlLink":"Add test case to verify we can decorate 'defdelegate'"}},{"before":"a32053ae884014320940d2a8cefe55181203db93","after":"e142933f9ae15dd2d1dcda3bd0dec007a344bebc","ref":"refs/heads/master","pushedAt":"2023-07-23T20:32:16.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"leggebroten","name":"lee eggebroten","path":"/leggebroten","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5223530?s=80&v=4"},"commit":{"message":"Added a \"reflection\" function `__decorated_functions__` to return list of all decorated functions\n\n### Simple reflection for all decorated functions\nA \"hidden\" function `__decorated_functions__/0` is added to any module that decorates functions and returns a list of\nall decorated functions within that module.\n\nThis can be useful for testing purposes since you don't have to assert the decorated behaviors of the decorated\nfunctions. So long as your decorator function is well tested, you can just assert the expected decorators are present\nfor the given function.\n\nThe function returns a map with the function name and arguments as the key and a list of tuples with the decorator.\nThis permits multiple decorators to be asserted with a single function call so that adding new decorators will cause\nthe assertion to fail.\n\nFor example, given the following module:\n```elixir\n defmodule NewModule do\n use Decorator.Define, [new_decorator: 1, another_decorator: 2]\n\n @decorate new_decorator(\"one\")\n def func(%StructOne{} = msg) do\n msg\n end\n\n @decorate new_decorator(\"two\")\n @decorate another_decorator(\"a\", \"b\")\n @decorate new_decorator(\"b\")\n def func(%StructTwo{c: 2} = _msg) do\n :ok\n end\n end\n```\n\nYou can assert the decorated functions like so:\n```elixir\n test \"Module with decorated functions are returned by `__decorated_functions__()\" do\n assert %{\n {:func, [\"%StructOne{} = msg\"]} => [\n {DecoratorTest.Fixture.NewDecorator, :new_decorator, [\"one\"]}\n ],\n {:func, [\"%StructTwo{c: 2} = _msg\"]} => [\n {DecoratorTest.Fixture.NewDecorator, :new_decorator, [\"two\"]},\n {DecoratorTest.Fixture.AnotherDecorator, :another_decorator, [\"a\", \"b\"]},\n {DecoratorTest.Fixture.NewDecorator, :new_decorator, [\"b\"]}\n ]\n } == NewModule.__decorated_functions__()\n end\n```\n\nObviously, any changes to the parameters of the decorated function will cause the simple assertion to fail, but that's\nintentional, as the decorator may be dependent on the parameters of the decorated function.","shortMessageHtmlLink":"Added a \"reflection\" function __decorated_functions__ to return lis…"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"Y3Vyc29yOnYyOpK7MjAyNC0wMi0wOVQyMjoxMzo0Ni4wMDAwMDBazwAAAAP27mJT","startCursor":"Y3Vyc29yOnYyOpK7MjAyNC0wMi0wOVQyMjoxMzo0Ni4wMDAwMDBazwAAAAP27mJT","endCursor":"Y3Vyc29yOnYyOpK7MjAyMy0wNy0yM1QyMDozMjoxNi4wMDAwMDBazwAAAANbYmny"}},"title":"Activity · withbelay/decorator"}