Packages

A library which allows to store temporary data in the process dictionary.

Current section

2 Versions

Jump to

Compare versions

5 files changed
+18 additions
-17 deletions
  @@ -4,11 +4,15 @@ All notable changes to this project will be documented in this file.
4 4 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5 5 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6 6
7 - ## [Unreleased]
7 + ## [Unreleased]\n\n## [0.2.0] - 2020-09-25
8 + ### Changed
9 + - Fixes `ProcessStore.fetch/1`. Now the function is able to retrieve the value from the process
10 + dictionary when the process is nested into a process tree.
11 + - Update Hex libraries and Elixir version.
8 12
9 13 ## [0.1.0] - 2019-11-26
10 14 ### Added
11 15 - Project created.
12 16
13 - [Unreleased]: https://github.com/FindHotel/process_store/compare/0.1.0...HEAD
17 + [unreleased]: https://github.com/FindHotel/process_store/compare/0.2.0...HEADn[0.2.0]: https://github.com/FindHotel/process_store/compare/0.1.0...0.2.0
14 18 [0.1.0]: https://github.com/FindHotel/process_store/releases/tag/0.1.0
  @@ -15,7 +15,7 @@ adding `process_store` to your list of dependencies in `mix.exs`:
15 15 ```elixir
16 16 def deps do
17 17 [
18 - {:process_store, "~> 0.1.0"}
18 + {:process_store, "~> 0.2.0"}
19 19 ]
20 20 end
21 21 ```
  @@ -2,7 +2,7 @@
2 2 {<<"build_tools">>,[<<"mix">>]}.
3 3 {<<"description">>,
4 4 <<"A library which allows to store temporary data in the process dictionary.">>}.
5 - {<<"elixir">>,<<"~> 1.9">>}.
5 + {<<"elixir">>,<<"~> 1.10">>}.
6 6 {<<"files">>,
7 7 [<<"lib">>,<<"lib/process_store.ex">>,<<"mix.exs">>,<<"README.md">>,
8 8 <<"CHANGELOG.md">>]}.
  @@ -11,4 +11,4 @@
11 11 [{<<"GitHub">>,<<"https://github.com/FindHotel/process_store">>}]}.
12 12 {<<"name">>,<<"process_store">>}.
13 13 {<<"requirements">>,[]}.
14 - {<<"version">>,<<"0.1.0">>}.
14 + {<<"version">>,<<"0.2.0">>}.
  @@ -39,11 +39,9 @@ defmodule ProcessStore do
39 39
40 40 """
41 41 @spec fetch(key()) :: data()
42 - def fetch(key), do: Process.get() |> find_data(key)
42 + def fetch(key), do: Process.get(key) || find_data(Process.get(), key)
43 43
44 44 @spec find_data(keyword(), key()) :: data()
45 - defp find_data([{key, value} | _data], wanted_key) when key == wanted_key, do: value
46 -
47 45 defp find_data([{:"$callers", callers} | _data], key) do
48 46 callers
49 47 |> List.wrap()
  @@ -1,7 +1,7 @@
1 1 defmodule ProcessStore.MixProject do
2 2 use Mix.Project
3 3
4 - @version "0.1.0"
4 + @version "0.2.0"
5 5 @source_url "https://github.com/FindHotel/process_store"
6 6
7 7 def project do
  @@ -11,7 +11,7 @@ defmodule ProcessStore.MixProject do
11 11 description: "A library which allows to store temporary data in the process dictionary.",
12 12 dialyzer: dialyzer(),
13 13 docs: docs(),
14 - elixir: "~> 1.9",
14 + elixir: "~> 1.10",
15 15 package: package(),
16 16 source_url: @source_url,
17 17 start_permanent: Mix.env() == :prod,
  @@ -27,9 +27,9 @@ defmodule ProcessStore.MixProject do
27 27
28 28 defp deps do
29 29 [
30 - {:credo, "~> 1.1", only: [:dev, :test], runtime: false},
31 - {:dialyxir, "~> 1.0.0-rc.7", only: [:dev], runtime: false},
32 - {:ex_doc, "~> 0.21", only: :dev, runtime: false}
30 + {:credo, "~> 1.4", only: [:dev, :test], runtime: false},
31 + {:dialyxir, "~> 1.0", only: [:dev], runtime: false},
32 + {:ex_doc, "~> 0.22.6", only: :dev, runtime: false}
33 33 ]
34 34 end
35 35
  @@ -41,14 +41,12 @@ defmodule ProcessStore.MixProject do
41 41
42 42 defp docs do
43 43 [
44 - extras: extras(),
44 + extras: ["README.md", "CHANGELOG.md"],
45 45 main: "readme",
46 46 source_ref: @version
47 47 ]
48 48 end
49 49
50 - defp extras, do: ["README.md", "CHANGELOG.md"]
51 -
52 50 defp package do
53 51 %{
54 52 files: ["lib", "mix.exs", "README.md", "CHANGELOG.md"],
  @@ -57,7 +55,8 @@ defmodule ProcessStore.MixProject do
57 55 maintainers: [
58 56 "Antonio Lorusso",
59 57 "Felipe Vieira",
60 - "Fernando Hamasaki de Amorim"
58 + "Fernando Hamasaki de Amorim",
59 + "Sergio Rodrigues"
61 60 ],
62 61 name: "process_store"
63 62 }