hanami-utils 2.0.0.rc1 → 2.0.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: e32b8748a32b673f476ffc41c81608f5e6d372f610e990594488c214e27fdfd1
4
- data.tar.gz: 0e043561435c85f622bd8a1b1f341a5ad77b1359578fd00923c0ee19c6150b63
3
+ metadata.gz: 2575ff2a640a9ffcddf8a9930a887d536ec9da4b64bc4a2883849ed261f57b43
4
+ data.tar.gz: 70fbfe55f826d940c0f5decad39840990925e061de975e53d2b672fdae9873df
5
5
  SHA512:
6
- metadata.gz: dbedf69794dbd7ee0ae949ef77a2891fe29c5439feb7cb3c6e2e91b87b3fae16f74e6f624357e646cb68c47668120d5be0cc8e8961c198c75106f0636cb4373e
7
- data.tar.gz: 615330821eadb25847032710fff58adab597281783b09767e92da9ecf3523cb511dff516ed5f6640d06b5d8d5cfaaa8c93ffcb45f1be5db520ec7ccdb058a84d
6
+ metadata.gz: 73d5a9fade1cb961ac4be22b8967507fceebde1a9d8edb33d71634b06ef6c06538c8d0ef2b1a32a33e8442c7609b675ae99bd63780c353c6db02485ddbfd3432
7
+ data.tar.gz: 368ffe941852e67432d9574b79220b1807b1529cbdf4289fb2fd2db92299888617bc3779bd6e0c3f03b81d5fbcb9725b8b36364733d262a3c5fa2cb257db91b1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Ruby core extensions and class utilities for Hanami
4
4
 
5
+ ## v2.0.0 - 2022-11-22
6
+
5
7
  ## v2.0.0.rc1 - 2022-11-08
6
8
 
7
9
  ### Fixed
data/hanami-utils.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.metadata["rubygems_mfa_required"] = "true"
21
21
  spec.required_ruby_version = ">= 3.0"
22
22
 
23
- spec.add_dependency "dry-transformer", "~> 0.1"
23
+ spec.add_dependency "dry-transformer", "~> 1.0", "< 2"
24
24
  spec.add_dependency "concurrent-ruby", "~> 1.0"
25
25
 
26
26
  spec.add_development_dependency "bundler", ">= 1.6", "< 3"
@@ -1,11 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hanami
4
+ # Shared Rack middleware for Hanami apps.
5
+ #
6
+ # This module is defined in hanami-utils so that any gem providing middleware can use its
7
+ # resources.
8
+ #
9
+ # @since 2.0.0
4
10
  module Middleware
5
- # Hanami middleware utils
6
-
11
+ # Base class for all errors raised during middleware loading.
12
+ #
7
13
  # @since 2.0.0
8
- class Error < ::StandardError
14
+ # @api public
15
+ class Error < StandardError
9
16
  end
10
17
  end
11
18
  end
@@ -71,33 +71,6 @@ module Hanami
71
71
  def self.load(name, namespace = Object)
72
72
  load!(name, namespace) if namespace.const_defined?(name.to_s, false)
73
73
  end
74
-
75
- def self.tokenize(pattern)
76
- if match = TOKENIZE_REGEXP.match(pattern)
77
- pre = match.pre_match
78
- post = match.post_match
79
- tokens = match[1].split(TOKENIZE_SEPARATOR)
80
- tokens.each do |token|
81
- yield("#{pre}#{token}#{post}")
82
- end
83
- else
84
- yield(pattern)
85
- end
86
-
87
- nil
88
- end
89
-
90
- # Regexp for .tokenize
91
- #
92
- # @since 1.3.0
93
- # @api private
94
- TOKENIZE_REGEXP = /\((.*)\)/
95
-
96
- # Separator for .tokenize
97
- #
98
- # @since 1.3.0
99
- # @api private
100
- TOKENIZE_SEPARATOR = "|"
101
74
  end
102
75
  end
103
76
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry-transformer"
3
+ require "dry/transformer"
4
4
 
5
5
  module Hanami
6
6
  module Utils
@@ -35,10 +35,20 @@ module Hanami
35
35
 
36
36
  # rubocop:disable Style/ClassVars
37
37
  if defined?(MultiJson)
38
+ # @since 0.8.0
39
+ # @api private
38
40
  @@engine = MultiJsonAdapter.new
41
+
42
+ # @since 0.8.0
43
+ # @api private
39
44
  ParserError = MultiJson::ParseError
40
45
  else
46
+ # @since 0.8.0
47
+ # @api private
41
48
  @@engine = ::JSON
49
+
50
+ # @since 0.8.0
51
+ # @api private
42
52
  ParserError = ::JSON::ParserError
43
53
  end
44
54
  # rubocop:enable Style/ClassVars
@@ -5,6 +5,7 @@ require "date"
5
5
  require "time"
6
6
  require "pathname"
7
7
  require "bigdecimal"
8
+ require "bigdecimal/util"
8
9
  require "hanami/utils"
9
10
  require "hanami/utils/string"
10
11
 
@@ -7,12 +7,16 @@ module Hanami
7
7
  # It doesn't check if you're writing to a file or anything, so you have to
8
8
  # check that yourself before using this module.
9
9
  #
10
+ # @api public
10
11
  # @since 1.2.0
11
12
  module ShellColor
12
- # Unknown color code error
13
+ # Error raised for unknown color codes.
13
14
  #
14
15
  # @since 1.2.0
16
+ # @api public
15
17
  class UnknownColorCodeError < ::StandardError
18
+ # @since 1.2.0
19
+ # @api private
16
20
  def initialize(code)
17
21
  super("unknown color code: `#{code.inspect}'")
18
22
  end
@@ -2,7 +2,10 @@
2
2
 
3
3
  module Hanami
4
4
  module Utils
5
+ # The current hanami-utils version.
6
+ #
7
+ # @since 0.1.0
5
8
  # @api public
6
- VERSION = "2.0.0.rc1"
9
+ VERSION = "2.0.0"
7
10
  end
8
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-08 00:00:00.000000000 Z
11
+ date: 2022-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-transformer
@@ -16,14 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.1'
19
+ version: '1.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
- version: '0.1'
29
+ version: '1.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: concurrent-ruby
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -149,11 +155,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
155
  version: '3.0'
150
156
  required_rubygems_version: !ruby/object:Gem::Requirement
151
157
  requirements:
152
- - - ">"
158
+ - - ">="
153
159
  - !ruby/object:Gem::Version
154
- version: 1.3.1
160
+ version: '0'
155
161
  requirements: []
156
- rubygems_version: 3.3.3
162
+ rubygems_version: 3.3.7
157
163
  signing_key:
158
164
  specification_version: 4
159
165
  summary: Ruby core extentions and Hanami utilities