{"id":19483517,"url":"https://github.com/librity/ignite_reports_generator","last_synced_at":"2025-08-12T06:38:56.259Z","repository":{"id":99704048,"uuid":"345910122","full_name":"librity/ignite_reports_generator","owner":"librity","description":"Rocket Seat - Ignite - Elixir - A simple Elixir program that generates sales reports from raw CSV data.","archived":false,"fork":false,"pushed_at":"2022-02-25T12:06:16.000Z","size":1711,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T07:39:03.021Z","etag":null,"topics":["challenge","elixir","ignite","rocketseat"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/librity.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-09T06:48:08.000Z","updated_at":"2021-03-10T22:27:43.000Z","dependencies_parsed_at":"2023-07-31T13:17:16.325Z","dependency_job_id":null,"html_url":"https://github.com/librity/ignite_reports_generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librity%2Fignite_reports_generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librity%2Fignite_reports_generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librity%2Fignite_reports_generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librity%2Fignite_reports_generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/librity","download_url":"https://codeload.github.com/librity/ignite_reports_generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240718943,"owners_count":19846482,"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":["challenge","elixir","ignite","rocketseat"],"created_at":"2024-11-10T20:15:24.800Z","updated_at":"2025-02-25T17:45:19.946Z","avatar_url":"https://github.com/librity.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ReportsGenerator\n\nA simple Elixir program that generates customer sales reports from raw CSV data.\n\n## Commands\n\n```bash\n$ mix deps.get\n$ mix credo gen.config\n$ mix credo\n$ mix credo --strict\n$ mix test\n$ mix test test/reports_generator/parser_test.exs\n$ mix test test/reports_generator/parser_test.exs:7\n```\n\n```elixir\n\u003e \"Foo\" \u003c\u003e \"bar\"\n\"Foobar\"\n\u003e [1, 2, 3] ++ [2, 3, 4]\n[1, 2, 3, 2, 3, 4]\n\n\u003e Enum.reduce([1, 2, 3, 4], 0, fn element, accumulator -\u003e element + accumulator end)\n10\n\u003e Enum.reduce([1, 2, 3, 4], %{}, fn element, accumulator -\u003e IO.inspect(element); IO.inspect(accumulator); Map.put(accumulator, element, element) end)\n1\n%{}\n2\n%{1 =\u003e 1}\n3\n%{1 =\u003e 1, 2 =\u003e 2}\n4\n%{1 =\u003e 1, 2 =\u003e 2, 3 =\u003e 3}\n%{1 =\u003e 1, 2 =\u003e 2, 3 =\u003e 3, 4 =\u003e 4}\n\n\u003e Enum.into(1..5, %{}, fn number -\u003e {Integer.to_string(number), 0} end)\n%{\"1\" =\u003e 0, \"2\" =\u003e 0, \"3\" =\u003e 0, \"4\" =\u003e 0, \"5\" =\u003e 0}\n\u003e Enum.into(1..5, %{}, \u0026{Integer.to_string(\u00261), 0})\n%{\"1\" =\u003e 0, \"2\" =\u003e 0, \"3\" =\u003e 0, \"4\" =\u003e 0, \"5\" =\u003e 0}\n\n\u003e %{\"1\" =\u003e 278849, \"2\" =\u003e 2, \"3\" =\u003e 65} |\u003e Enum.max_by(fn {_key, value} -\u003e value end)\n{\"1\", 278849}\n```\n\nUsing Erlang modules:\n\n```elixir\n# Measure the execution time of a function in microseconds:\n\u003e :timer.tc(fn -\u003e ReportsGenerator.build(\"report_complete\") end)\n{920_548, :FUNCTION_RETURN}\n# microsecond / 1000000 = seconds\n\u003e :timer.tc(fn -\u003e ReportsGenerator.build_from_many([\"report_1\", \"report_2\", \"report_3\"]) end)\n{249_578, :FUNCTION_RETURN}\n```\n\nMessing with processes:\n\n```elixir\n# Execute function in a separate process\n\u003e pid = spawn fn -\u003e IO.puts(\"banana\") end\nbanana\n#PID\u003c0.206.0\u003e\n\u003e Process.alive?(pid)\nfalse\n\n\u003e self()\n#PID\u003c0.203.0\u003e\n\u003e Process.alive?(self())\ntrue\n\n# Send a message to a process\n\u003e send self(), {:ok, \"Success!\"}\n{:ok, \"Success!\"}\n\u003e receive do\n{:ok, message} -\u003e message\n{:error, _message} -\u003e \"FUBAR\"\nend\n\"Success!\"\n\n\u003e send self(), {:error, \"ERROR\"}\n{:error, \"ERROR\"}\n\u003e receive do\n{:ok, message} -\u003e message\n{:error, _message} -\u003e \"FUBAR\"\nend\n\"FUBAR\"\n\n\u003e self_id = self()\n\u003e spawn(fn -\u003e send(self_id, {:ok, \"Did it work?\"}) end)\n\u003e receive do\n{:ok, message} -\u003e message\n{:error, _message} -\u003e \"FUBAR\"\nend\n\"Did it work?\"\n```\n\n## Resources\n\n- https://github.com/rrrene/credo\n- https://dev.to/dnovais/aridade-de-uma-funcao-41mo\n- https://github.com/Microsoft/vscode-docs/blob/vnext/release-notes/v1_9.md#control-the-dimensions-of-new-windows\n- https://github.com/christopheradams/elixir_style_guide\n- https://hexdocs.pm/elixir/master/Task.html\n\nRecompile error:\n\n- https://app.rocketseat.com.br/h/forum/elixir/b0d85d7b-a2f1-4024-aa61-7fcc73a537be\n- https://github.com/iampeterbanjo/vscode-elixir-linter/issues/25\n- https://github.com/JakeBecker/elixir-ls/issues/93\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibrity%2Fignite_reports_generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibrity%2Fignite_reports_generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibrity%2Fignite_reports_generator/lists"}