amazing-activist 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccad58a6e900c0d926811f0f5520a807665c3966efff845ac4359c00493cf0cf
4
- data.tar.gz: 79b51504d7c1bea9dc76bcefe0d78697d7a3e30f15bd21c3dac8684ebaf81dac
3
+ metadata.gz: 290c18d206342a875bfadb61a6d1cda66e7df96a44ecda1379a18e3aefc187fd
4
+ data.tar.gz: d21e98ee9f606a7264cdf743f935f7c845832c884f86feef55076f8a3eae535f
5
5
  SHA512:
6
- metadata.gz: 36d6f413e5a39dbde9bf7c0aa6ef40bb58f438096ba659963536c7a2c059c135a00f88f765058edfdb53bdc572352f48f5ac6ebd3d7e4444205b9c34c85ccf51
7
- data.tar.gz: 56347f7ea9356a1edfdff9f41816b34036f25184ccc7e102ebb11524371b7e3e2e1f134d17bf6644c47ebc7ffd1f36fc369f12f438c62571837f9ae48e8684b2
6
+ metadata.gz: 3056d150ef3732e54396acd8915056cd20f5d11c6efc00eb3d131920deeaac92f42cbe5d92955e2667671fe3a14af93fc6cc495108fb797692b3280cb5449f7d
7
+ data.tar.gz: 68886df50e8d078f52b03804ec09f146d64f6fcc6ad27c1153bc71b078e2b9b49868e5bb496a3caef9708321c18fe088d371c8a9eb4f9b8a1c09d62365d84ced
data/CHANGES.md ADDED
@@ -0,0 +1,59 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.5.0] - 2023-03-13
11
+
12
+ ### Changed
13
+
14
+ - (BREAKING) i18n does not remove `_activity` suffix from keys anymore, e.g.
15
+ for `Foo::BarActivity` expected i18n key will be `foo/bar_activity`, not
16
+ `foo/bar` as it was before.
17
+
18
+
19
+ ## [0.4.0] - 2024-02-19
20
+
21
+ ### Added
22
+
23
+ - `Base.on_broken_outcome` allows registering custom handler for the broken
24
+ outcome contract (when `#call` returns neither `Success` nor `Failure`)
25
+ - `Base.rescue_from` allows registering unhandled exception handlers.
26
+
27
+
28
+ ## [0.3.0] - 2024-02-19
29
+
30
+ ### Added
31
+
32
+ - `UnwrapError#cause` respects failure's `#exception`.
33
+
34
+ ### Changed
35
+
36
+ - (BREAKING) `Base#failure` context must be given as keyword argument.
37
+ - (BREAKING) `Failure#message` is no longer part of its `#context`.
38
+ - (BREAKING) `Failure#exception` is no longer part of its `#context`.
39
+
40
+
41
+ ## [0.2.0] - 2024-01-28
42
+
43
+ ### Added
44
+
45
+ - Generate default failure messages with
46
+ [i18n](https://github.com/ruby-i18n/i18n).
47
+
48
+
49
+ ## [0.1.0] - 2024-01-27
50
+
51
+ ### Added
52
+
53
+ - Initial release.
54
+
55
+ [0.5.0]: https://github.com/ixti/amazing-activist/compare/v0.4.0...v0.5.0
56
+ [0.4.0]: https://github.com/ixti/amazing-activist/compare/v0.3.0...v0.4.0
57
+ [0.3.0]: https://github.com/ixti/amazing-activist/compare/v0.2.0...v0.3.0
58
+ [0.2.0]: https://github.com/ixti/amazing-activist/compare/v0.1.0...v0.2.0
59
+ [0.1.0]: https://github.com/ixti/amazing-activist/tree/v0.1.0
@@ -1,4 +1,4 @@
1
1
  en:
2
2
  amazing_activist:
3
3
  failures:
4
- not_implemented: "<%{activity}> activity has no implementation"
4
+ not_implemented: "<%{activity}> has no implementation"
@@ -1,4 +1,4 @@
1
1
  gl:
2
2
  amazing_activist:
3
3
  failures:
4
- not_implemented: "<%{activity}> actividade non ten implementación"
4
+ not_implemented: "<%{activity}> non ten implementación"
@@ -10,9 +10,6 @@ I18n.load_path += Dir[File.expand_path("#{__dir__}/locale/*.yml")]
10
10
  module AmazingActivist
11
11
  # @api internal
12
12
  class Polyglot
13
- ANONYMOUS_ACTIVITY_NAME = "anonymous"
14
- private_constant :ANONYMOUS_ACTIVITY_NAME
15
-
16
13
  def initialize(activity)
17
14
  @activity = activity
18
15
  end
@@ -25,26 +22,26 @@ module AmazingActivist
25
22
  # Thus, if activity `Pretty::DamnGoodActivity` failed with `:bad_choise`
26
23
  # code the lookup will be:
27
24
  #
28
- # * `amazing_activist.activities.pretty/damn_good.failures.bad_choice
25
+ # * `amazing_activist.activities.pretty/damn_good_activity.failures.bad_choice
29
26
  # * `amazing_activist.failures.bad_choice
30
27
  #
31
28
  # If there's no translation with any of the above keys, a generic
32
29
  # non-translated message will be used:
33
30
  #
34
- # <pretty/damn_good> activity failed - bad_choice
31
+ # <pretty/damn_good_activity> failed - bad_choice
35
32
  #
36
33
  # @return [String] Failure message
37
34
  def message(code, **context)
38
35
  default = [
39
36
  :"amazing_activist.failures.#{code}",
40
- "<%{activity}> activity failed - %{code}" # rubocop:disable Style/FormatStringToken
37
+ "<%{activity}> failed - %{code}" # rubocop:disable Style/FormatStringToken
41
38
  ]
42
39
 
43
40
  if @activity.class.name
44
- activity = @activity.class.name.underscore.presence.delete_suffix("_activity")
41
+ activity = @activity.class.name.underscore.presence
45
42
  i18n_key = :"amazing_activist.activities.#{activity}.failures.#{code}"
46
43
  else
47
- activity = "(anonymous)"
44
+ activity = "(anonymous activity)"
48
45
  i18n_key = default.shift
49
46
  end
50
47
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AmazingActivist
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazing-activist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Zapparov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-20 00:00:00.000000000 Z
11
+ date: 2024-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -45,6 +45,7 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - CHANGES.md
48
49
  - LICENSE.txt
49
50
  - README.adoc
50
51
  - lib/amazing-activist.rb
@@ -68,9 +69,9 @@ licenses:
68
69
  - MIT
69
70
  metadata:
70
71
  homepage_uri: https://github.com/ixti/amazing-activist
71
- source_code_uri: https://github.com/ixti/amazing-activist/tree/v0.4.0
72
+ source_code_uri: https://github.com/ixti/amazing-activist/tree/v0.5.0
72
73
  bug_tracker_uri: https://github.com/ixti/amazing-activist/issues
73
- changelog_uri: https://github.com/ixti/amazing-activist/blob/v0.4.0/CHANGES.md
74
+ changelog_uri: https://github.com/ixti/amazing-activist/blob/v0.5.0/CHANGES.md
74
75
  rubygems_mfa_required: 'true'
75
76
  post_install_message:
76
77
  rdoc_options: []