hanami-utils 1.3.1 → 1.3.2
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/hanami/utils/basic_object.rb +45 -0
- data/lib/hanami/utils/kernel.rb +1 -1
- data/lib/hanami/utils/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab3141a4fd9052c6472d5bfd820eca5be30a9be7e3f8c7a8c5039ca14ff8a44e
|
4
|
+
data.tar.gz: c6b7581c887b4c7dafe0834a5ee045eaef17d1ed9a82aeffd5e6de2c995093d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e05b9c87e1e3206ba379a7f4d09fcae6602049d36548306ccec1abf89f7a2e2271ab995e2afa9702411062f3fd0f2e13e1bcdcd69868a63e05517fc36bf1c020
|
7
|
+
data.tar.gz: 55e117ed1367cdd8791531e42b7da858641a6e36f24cd5d440371e006a704ffa53dd0e01d352e306dd6be1eedb4ba0ffd728228e01dfab0a9de9e6e3814cbd04
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Hanami::Utils
|
2
2
|
Ruby core extentions and class utilities for Hanami
|
3
3
|
|
4
|
+
## v1.3.2 - 2019-06-21
|
5
|
+
### Added
|
6
|
+
- [Vladislav Yashin & Luca Guidi] Added `Utils::BasicObject#instance_of?`, `#is_a?`, and `#kind_of`
|
7
|
+
|
4
8
|
## v1.3.1 - 2019-01-18
|
5
9
|
### Added
|
6
10
|
- [Luca Guidi] Official support for Ruby: MRI 2.6
|
@@ -29,6 +29,51 @@ module Hanami
|
|
29
29
|
# rubocop:enable Style/FormatStringToken
|
30
30
|
# rubocop:enable Style/FormatString
|
31
31
|
|
32
|
+
# @!macro [attach] instance_of?(class)
|
33
|
+
#
|
34
|
+
# Determine if self is an instance of given class or module
|
35
|
+
#
|
36
|
+
# @param class [Class,Module] the class of module to verify
|
37
|
+
#
|
38
|
+
# @return [TrueClass,FalseClass] the result of the check
|
39
|
+
#
|
40
|
+
# @raise [TypeError] if the given argument is not of the expected types
|
41
|
+
#
|
42
|
+
# @since 1.3.2
|
43
|
+
#
|
44
|
+
# @see http://ruby-doc.org/core/Object.html#method-i-instance_of-3F
|
45
|
+
define_method :instance_of?, ::Object.instance_method(:instance_of?)
|
46
|
+
|
47
|
+
# @!macro [attach] is_a?(class)
|
48
|
+
#
|
49
|
+
# Determine if self is of the type of the object class or module
|
50
|
+
#
|
51
|
+
# @param class [Class,Module] the class of module to verify
|
52
|
+
#
|
53
|
+
# @return [TrueClass,FalseClass] the result of the check
|
54
|
+
#
|
55
|
+
# @raise [TypeError] if the given argument is not of the expected types
|
56
|
+
#
|
57
|
+
# @since 1.3.2
|
58
|
+
#
|
59
|
+
# @see http://ruby-doc.org/core/Object.html#method-i-is_a-3F
|
60
|
+
define_method :is_a?, ::Object.instance_method(:is_a?)
|
61
|
+
|
62
|
+
# @!macro [attach] kind_of?(class)
|
63
|
+
#
|
64
|
+
# Determine if self is of the kind of the object class or module
|
65
|
+
#
|
66
|
+
# @param class [Class,Module] the class of module to verify
|
67
|
+
#
|
68
|
+
# @return [TrueClass,FalseClass] the result of the check
|
69
|
+
#
|
70
|
+
# @raise [TypeError] if the given argument is not of the expected types
|
71
|
+
#
|
72
|
+
# @since 1.3.2
|
73
|
+
#
|
74
|
+
# @see http://ruby-doc.org/core/Object.html#method-i-kind_of-3F
|
75
|
+
define_method :kind_of?, ::Object.instance_method(:kind_of?)
|
76
|
+
|
32
77
|
# Alias for __id__
|
33
78
|
#
|
34
79
|
# @return [Fixnum] the object id
|
data/lib/hanami/utils/kernel.rb
CHANGED
@@ -1043,7 +1043,7 @@ module Hanami
|
|
1043
1043
|
# @api private
|
1044
1044
|
def self.inspect_type_error(arg)
|
1045
1045
|
(arg.respond_to?(:inspect) ? arg.inspect : arg.to_s) << ' '
|
1046
|
-
rescue NoMethodError
|
1046
|
+
rescue NoMethodError
|
1047
1047
|
# missing the #respond_to? method, fall back to returning the class' name
|
1048
1048
|
begin
|
1049
1049
|
arg.class.name << ' instance '
|
data/lib/hanami/utils/version.rb
CHANGED
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: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: transproc
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
|
-
rubygems_version: 3.0.
|
147
|
+
rubygems_version: 3.0.3
|
148
148
|
signing_key:
|
149
149
|
specification_version: 4
|
150
150
|
summary: Ruby core extentions and Hanami utilities
|