hotcell-client 0.6.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acb581746375493247ece1d1962ef0f534cbca23e97851c1539f6b75e0eaa495
4
- data.tar.gz: 621d326e537edb6bdd1125cbb229e20588a3312b7f63bbba56f039ff9c42bf45
3
+ metadata.gz: 1ba1bb0047670fef637ea304c58ca6589c68c68491b84df357745f4c35dba740
4
+ data.tar.gz: ec3e1cac68b95f6af2c00982538ce95a19a1257014c1c8bec53a49a860e68f83
5
5
  SHA512:
6
- metadata.gz: 9b94270d6241921e1f8b9793e1fafa3dd3c3928d21a68ff14b2012c50eb2fc612007b31c072462ac1b90adb738c61bbf1ab64ee3827a3c31825a20d1718f3e4c
7
- data.tar.gz: 536992cc18c2777bb5e7ae31e0b7445ebec24987b3d691c8a50d9e8b251d0b00283fdf93cfd94b58c2a6a3f224833f7c3ab4462950db9218073779c3142245d1
6
+ metadata.gz: 26eaf78d5f835becb66508a423f91f73223e843d531e6d44723c5d635f9cab1b16f7560f58fc322ab25b50c6503d6d6227d88665a0ca2f81533de19e16f3b84d
7
+ data.tar.gz: e12b678e13d8327c502ae440e923970dd7bcd32b1e828ba9d1ffedabbf724e678c6d36a63bf412d50b289be46c513698f62af187d4a35a6ee13a8d573bfe16a5
@@ -3,6 +3,6 @@
3
3
  module HotCell
4
4
  # A class and not a module: this file loads before hot_cell/client.rb opens the same name.
5
5
  class Client
6
- VERSION = "0.6.0"
6
+ VERSION = "1.1.0"
7
7
  end
8
8
  end
@@ -126,7 +126,7 @@ module HotCell
126
126
  # premise is that restoring is worse than carrying it: the cell may still hold the descriptor, undoing
127
127
  # it mid-request adds a failure path to the answer, and a caller that could not share the file could
128
128
  # not use this at all. Active Storage hands over tempfiles it then unlinks, so nothing survives there.
129
- # docs/DEPLOYMENT.md tells anyone writing their own client to pass files they are willing to share.
129
+ # docs/client-api.md tells anyone writing their own client to pass files they are willing to share.
130
130
  def shared(io, mode)
131
131
  return io if HotCell.group.nil?
132
132
 
@@ -200,7 +200,7 @@ module HotCell
200
200
  return if response.ok?
201
201
 
202
202
  failure = response.failure
203
- error = cell.exception_for(failure).new(failure.to_s)
203
+ error = Verdict.wrap(cell.exception_for(failure).new(failure.to_s), failure)
204
204
  cell.report_contract_skew error if failure.code == "protocol"
205
205
 
206
206
  raise error
@@ -21,4 +21,17 @@ module HotCell
21
21
  # classification, so a later tidying pass that gives both a common ancestor silently turns every retryable
22
22
  # failure into a permanent one.
23
23
  class TransientFailure < StandardError; end
24
+
25
+ # Extended onto every exception the client raises, so an application can read the failure's code,
26
+ # cause and permanence without parsing the message — and rescue HotCell::Verdict itself, whatever
27
+ # classes the registration injected.
28
+ module Verdict
29
+ attr_reader :hot_cell_failure
30
+
31
+ def self.wrap(error, failure)
32
+ error.extend(self)
33
+ error.instance_variable_set(:@hot_cell_failure, failure)
34
+ error
35
+ end
36
+ end
24
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotcell-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.6.0
18
+ version: 1.1.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.6.0
25
+ version: 1.1.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: activesupport
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -71,8 +71,9 @@ licenses:
71
71
  - MIT
72
72
  metadata:
73
73
  homepage_uri: https://github.com/basecamp/hotcell
74
- source_code_uri: https://github.com/basecamp/hotcell/tree/v0.6.0/hotcell-client
75
- changelog_uri: https://github.com/basecamp/hotcell/blob/v0.6.0/CHANGELOG.md
74
+ source_code_uri: https://github.com/basecamp/hotcell/tree/v1.1.0/hotcell-client
75
+ changelog_uri: https://github.com/basecamp/hotcell/blob/v1.1.0/CHANGELOG.md
76
+ documentation_uri: https://basecamp.github.io/hotcell/
76
77
  bug_tracker_uri: https://github.com/basecamp/hotcell/issues
77
78
  rubygems_mfa_required: 'true'
78
79
  rdoc_options: []
@@ -89,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
90
  - !ruby/object:Gem::Version
90
91
  version: '0'
91
92
  requirements: []
92
- rubygems_version: 4.0.6
93
+ rubygems_version: 4.0.16
93
94
  specification_version: 4
94
95
  summary: Call a HotCell from an application.
95
96
  test_files: []