smart_types 0.7.0 → 0.7.1

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: b5af5b9faba15b86a36c7020e9c4c669973f2e443e0e490cfbfee7805f6b6ce7
4
- data.tar.gz: 709095db933eaf28c51c28872ad8cc24bf97636099c36a6d9d40378d22fecf94
3
+ metadata.gz: 272f5a15bb76008e456d87ad711a534518fa746369c3c64b8915f09265f75fea
4
+ data.tar.gz: 53ccc4912ec1577133ccfbe678dba4741a85c5a8521b72f2fca396823c31797d
5
5
  SHA512:
6
- metadata.gz: '092648864bbbd340c93b146eed7c59044d85065ac4220626130d576a3a8846f9039f88e0c20ce6f1e40811f1d788c42ea5703e81fd635026ebd3ab30606ecf52'
7
- data.tar.gz: baa24e784f8e6e7745f9ff9662fed3e905bcaf6842ce4ef02464fd7a82a6768cd6641d425cbf531683a981006b452b8811331633de5a8cf613891c97a25a1b28
6
+ metadata.gz: 1bb710c2e0f11a8a267a2663fcb9ad75b60352d306b17a8bebad812013531ea1ee7fac4996bc342be245ac09939d862ca0f2dc2a4c26dfd5c9aa064ea41b270f
7
+ data.tar.gz: a2d03bcc580625b3af5ffe9535cd5b26e972b4d4b6189d71aceaa09c48f527cb2310c8aa68238803093357dee4f8b43817d3b95ddd5c912bd11dc9a6da2bbdf8
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ # [0.7.1] - 2022-08-31
5
+ ### Fixed
6
+ - (**TruffelRuby** fix) Fixed `NoMethodError: private method 'initialize_clone'` failing on type object duplication and cloning (`#dup` and `#clone`).
7
+ `TruffleRuby` implementation makes `initialize_clone` method private by default even if your manually defined method is implicitly public.
8
+ To fix this we should explicitly define our method as a public method (`public def initialize_clone`).
9
+ ```
10
+ NoMethodError: private method `initialize_clone' called for SmartCore::Types::Primitive::Factory::RuntimeTypeBuilder:Module
11
+ ```
12
+
4
13
  # [0.7.0] - 2021-11-22
5
14
  ### Added
6
15
  - Added Github Actions CI;
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smart_types (0.7.0)
4
+ smart_types (0.7.1)
5
5
  smart_engine (~> 0.11)
6
6
 
7
7
  GEM
@@ -83,13 +83,14 @@ GEM
83
83
  simplecov-html (0.12.3)
84
84
  simplecov-lcov (0.8.0)
85
85
  simplecov_json_formatter (0.1.2)
86
- smart_engine (0.11.0)
86
+ smart_engine (0.12.0)
87
87
  tzinfo (2.0.4)
88
88
  concurrent-ruby (~> 1.0)
89
89
  unicode-display_width (1.7.0)
90
90
  zeitwerk (2.4.2)
91
91
 
92
92
  PLATFORMS
93
+ arm64-darwin-21
93
94
  x86_64-darwin-19
94
95
  x86_64-darwin-20
95
96
  x86_64-darwin-21
data/README.md CHANGED
@@ -443,6 +443,22 @@ SmartCore::Types::Value::Class.cast(123)
443
443
 
444
444
  - type refinements:
445
445
 
446
+ ```ruby
447
+ SmartCore::Types.configure do |config|
448
+ config.warn_on_type_refinements = true # false by default
449
+ end
450
+ ```
451
+
452
+ ```ruby
453
+ SmartCore::Types::Value.refine(:Time) do |type|
454
+ # new type definition
455
+ end
456
+
457
+ SmartCore::Types::Value::Time.refine do |type|
458
+ # new type definition
459
+ end
460
+ ```
461
+
446
462
  ```ruby
447
463
  SmartCore::Types::Value::Time.refine_checker do |value, original_checker|
448
464
  # new type checker
@@ -505,6 +521,8 @@ SmartCore::Types::Protocol::Enumerable
505
521
  SmartCore::Types::Protocol::Comparable
506
522
  SmartCore::Types::Protocol::Forwardable
507
523
  SmartCore::Types::Protocol::Callable
524
+ SmartCore::Types::Behavior::Truthy
525
+ SmartCore::Types::Behavior::Falsy
508
526
  ```
509
527
 
510
528
  - `#sum` alias for `|` and `#mult` alias for `&` (with a support for type name definition and other API);
@@ -28,8 +28,9 @@ module SmartCore::Types::Primitive::Factory::RuntimeTypeBuilder
28
28
  #
29
29
  # @api private
30
30
  # @since 0.3.0
31
+ # @version 0.7.1
31
32
  # rubocop:disable Metrics/AbcSize, Layout/LineLength
32
- def initialize_clone(new_instance, cloneable_instance)
33
+ public def initialize_clone(new_instance, cloneable_instance)
33
34
  name_clone = cloneable_instance.instance_variable_get(:@name)
34
35
  category_clone = cloneable_instance.instance_variable_get(:@category)
35
36
  validator_clone = cloneable_instance.instance_variable_get(:@validator).___copy_for___(new_instance)
@@ -6,7 +6,7 @@ module SmartCore
6
6
  #
7
7
  # @api public
8
8
  # @since 0.1.0
9
- # @version 0.7.0
10
- VERSION = '0.7.0'
9
+ # @version 0.7.1
10
+ VERSION = '0.7.1'
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Ibragimov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-24 00:00:00.000000000 Z
11
+ date: 2022-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: smart_engine
@@ -239,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
239
239
  - !ruby/object:Gem::Version
240
240
  version: '0'
241
241
  requirements: []
242
- rubygems_version: 3.2.22
242
+ rubygems_version: 3.3.11
243
243
  signing_key:
244
244
  specification_version: 4
245
245
  summary: Full-featured type system for any ruby project.