smart_value-object 0.1.0 → 0.2.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: 9e0f7838bb5e84699979410861b16817ddbf984aa44323221cd00c29e8217d1a
4
- data.tar.gz: fae20970f3694bde16ecdb6af0ee5015c4f6e95ec8e098d546619f670da62285
3
+ metadata.gz: 9c060fc01a4d946c597ce5074bf7d15867ed4c26f4ecf72bf8ba8bb81db322eb
4
+ data.tar.gz: bf7dac9f80ba8d05b3d351aabef40026663b2b1998c140429047cf25d1c4c043
5
5
  SHA512:
6
- metadata.gz: 8f6e8b6e40389e4b6f7598b5357e4d73f2cc0c44a370212d8207aa54a4c13990c5d828bbe1350d402cf7548254133fcbde09f41a04c540c8c1a2e727597a199f
7
- data.tar.gz: f0c3f4487abe3a58072b157f5deceec5a404c344941f92b66ba5702fec77bf193407e7b63e64dd1abff7005b028c6fc9ea96e79c94fbbf09ef1f2e2e9fdcf971
6
+ metadata.gz: 13d584c3b89dc4275fb3c9bedd3ce19645bbead9be0bd81543488693119b80b6fbe9190fecdb56bcdf1d46ea51b2dbd31adb714cffd5d25f8c2c0d74ff0e6538
7
+ data.tar.gz: 7c9d95b46429ab41c70a00fc9f18f79c24e6f2f2108958d1fda1f895b624199761ce20659412437130f2176f376069b510df99800c8ea0d30a24c9c7ce522dd4
@@ -5,7 +5,8 @@ inherit_gem:
5
5
  - lib/rubocop.rspec.yml
6
6
 
7
7
  AllCops:
8
- TargetRubyVersion: 2.7.1
8
+ TargetRubyVersion: 3.0.0
9
+ NewCops: enable
9
10
  Include:
10
11
  - lib/**/*.rb
11
12
  - spec/**/*.rb
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [0.2.0] - 2021-01-18
5
+ ### Added
6
+ - Support for **Ruby@3**;
7
+
8
+ ### Changed
9
+ - No more `TravisCI` (TODO: migrate to `GitHub Actions`);
10
+ - Updated development dependencies;
11
+ - Updated `smart_initializer` dependency (`~> 0.5`) to guarantee **Ruby3** compatability;
12
+
4
13
  ## [0.1.0] - 2020-07-12
5
14
  - Release :)
@@ -2,107 +2,110 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  smart_value-object (0.1.0)
5
- smart_initializer (~> 0.3)
5
+ smart_initializer (~> 0.5)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (6.0.3.2)
10
+ activesupport (6.1.1)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 0.7, < 2)
13
- minitest (~> 5.1)
14
- tzinfo (~> 1.1)
15
- zeitwerk (~> 2.2, >= 2.2.2)
16
- armitage-rubocop (0.87.1.2)
17
- rubocop (= 0.87.1)
18
- rubocop-performance (= 1.7.0)
19
- rubocop-rails (= 2.6.0)
12
+ i18n (>= 1.6, < 2)
13
+ minitest (>= 5.1)
14
+ tzinfo (~> 2.0)
15
+ zeitwerk (~> 2.3)
16
+ armitage-rubocop (1.7.0.1)
17
+ rubocop (= 1.7.0)
18
+ rubocop-performance (= 1.9.1)
19
+ rubocop-rails (= 2.9.1)
20
20
  rubocop-rake (= 0.5.1)
21
- rubocop-rspec (= 1.42.0)
21
+ rubocop-rspec (= 2.1.0)
22
22
  ast (2.4.1)
23
23
  coderay (1.1.3)
24
- concurrent-ruby (1.1.6)
24
+ concurrent-ruby (1.1.7)
25
25
  diff-lcs (1.4.4)
26
- docile (1.3.2)
27
- i18n (1.8.3)
26
+ docile (1.3.5)
27
+ i18n (1.8.7)
28
28
  concurrent-ruby (~> 1.0)
29
29
  method_source (1.0.0)
30
- minitest (5.14.1)
31
- parallel (1.19.2)
32
- parser (2.7.1.4)
30
+ minitest (5.14.3)
31
+ parallel (1.20.1)
32
+ parser (3.0.0.0)
33
33
  ast (~> 2.4.1)
34
34
  pry (0.13.1)
35
35
  coderay (~> 1.1)
36
36
  method_source (~> 1.0)
37
- qonfig (0.24.1)
37
+ qonfig (0.25.0)
38
38
  rack (2.2.3)
39
39
  rainbow (3.0.0)
40
- rake (13.0.1)
41
- regexp_parser (1.7.1)
40
+ rake (13.0.3)
41
+ regexp_parser (2.0.3)
42
42
  rexml (3.2.4)
43
- rspec (3.9.0)
44
- rspec-core (~> 3.9.0)
45
- rspec-expectations (~> 3.9.0)
46
- rspec-mocks (~> 3.9.0)
47
- rspec-core (3.9.2)
48
- rspec-support (~> 3.9.3)
49
- rspec-expectations (3.9.2)
43
+ rspec (3.10.0)
44
+ rspec-core (~> 3.10.0)
45
+ rspec-expectations (~> 3.10.0)
46
+ rspec-mocks (~> 3.10.0)
47
+ rspec-core (3.10.1)
48
+ rspec-support (~> 3.10.0)
49
+ rspec-expectations (3.10.1)
50
50
  diff-lcs (>= 1.2.0, < 2.0)
51
- rspec-support (~> 3.9.0)
52
- rspec-mocks (3.9.1)
51
+ rspec-support (~> 3.10.0)
52
+ rspec-mocks (3.10.1)
53
53
  diff-lcs (>= 1.2.0, < 2.0)
54
- rspec-support (~> 3.9.0)
55
- rspec-support (3.9.3)
56
- rubocop (0.87.1)
54
+ rspec-support (~> 3.10.0)
55
+ rspec-support (3.10.1)
56
+ rubocop (1.7.0)
57
57
  parallel (~> 1.10)
58
- parser (>= 2.7.1.1)
58
+ parser (>= 2.7.1.5)
59
59
  rainbow (>= 2.2.2, < 4.0)
60
- regexp_parser (>= 1.7)
60
+ regexp_parser (>= 1.8, < 3.0)
61
61
  rexml
62
- rubocop-ast (>= 0.1.0, < 1.0)
62
+ rubocop-ast (>= 1.2.0, < 2.0)
63
63
  ruby-progressbar (~> 1.7)
64
64
  unicode-display_width (>= 1.4.0, < 2.0)
65
- rubocop-ast (0.1.0)
66
- parser (>= 2.7.0.1)
67
- rubocop-performance (1.7.0)
68
- rubocop (>= 0.82.0)
69
- rubocop-rails (2.6.0)
65
+ rubocop-ast (1.4.0)
66
+ parser (>= 2.7.1.5)
67
+ rubocop-performance (1.9.1)
68
+ rubocop (>= 0.90.0, < 2.0)
69
+ rubocop-ast (>= 0.4.0)
70
+ rubocop-rails (2.9.1)
70
71
  activesupport (>= 4.2.0)
71
72
  rack (>= 1.1)
72
- rubocop (>= 0.82.0)
73
+ rubocop (>= 0.90.0, < 2.0)
73
74
  rubocop-rake (0.5.1)
74
75
  rubocop
75
- rubocop-rspec (1.42.0)
76
- rubocop (>= 0.87.0)
77
- ruby-progressbar (1.10.1)
78
- simplecov (0.18.5)
76
+ rubocop-rspec (2.1.0)
77
+ rubocop (~> 1.0)
78
+ rubocop-ast (>= 1.1.0)
79
+ ruby-progressbar (1.11.0)
80
+ simplecov (0.21.2)
79
81
  docile (~> 1.1)
80
82
  simplecov-html (~> 0.11)
81
- simplecov-html (0.12.2)
82
- smart_engine (0.7.0)
83
- smart_initializer (0.3.2)
83
+ simplecov_json_formatter (~> 0.1)
84
+ simplecov-html (0.12.3)
85
+ simplecov_json_formatter (0.1.2)
86
+ smart_engine (0.11.0)
87
+ smart_initializer (0.5.0)
84
88
  qonfig (~> 0.24)
85
- smart_engine (~> 0.7)
86
- smart_types (~> 0.1.0)
87
- smart_types (0.1.0)
88
- smart_engine (~> 0.6)
89
- thread_safe (0.3.6)
90
- tzinfo (1.2.7)
91
- thread_safe (~> 0.1)
89
+ smart_engine (~> 0.11)
90
+ smart_types (~> 0.4)
91
+ smart_types (0.4.0)
92
+ smart_engine (~> 0.11)
93
+ tzinfo (2.0.4)
94
+ concurrent-ruby (~> 1.0)
92
95
  unicode-display_width (1.7.0)
93
- zeitwerk (2.3.1)
96
+ zeitwerk (2.4.2)
94
97
 
95
98
  PLATFORMS
96
- ruby
99
+ x86_64-darwin-20
97
100
 
98
101
  DEPENDENCIES
99
- armitage-rubocop (~> 0.87)
100
- bundler (~> 2.1)
102
+ armitage-rubocop (~> 1.7)
103
+ bundler (~> 2.2)
101
104
  pry (~> 0.13)
102
105
  rake (~> 13.0)
103
- rspec (~> 3.9)
104
- simplecov (~> 0.18)
106
+ rspec (~> 3.10)
107
+ simplecov (~> 0.21)
105
108
  smart_value-object!
106
109
 
107
110
  BUNDLED WITH
108
- 2.1.4
111
+ 2.2.3
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # SmartCore::ValueObject &middot; [![Gem Version](https://badge.fury.io/rb/smart_value-object.svg)](https://badge.fury.io/rb/smart_value-object) [![Build Status](https://travis-ci.org/smart-rb/smart_value-object.svg?branch=master)](https://travis-ci.org/smart-rb/smart_value-object)
1
+ # SmartCore::ValueObject &middot; [![Gem Version](https://badge.fury.io/rb/smart_value-object.svg)](https://badge.fury.io/rb/smart_value-object)
2
2
 
3
3
  Value Object pattern realized in scope of Ruby.
4
4
 
@@ -39,10 +39,10 @@ require 'smart_core/value-object'
39
39
 
40
40
  ```ruby
41
41
  class Address < SmartCore::ValueObject
42
- attribute :country, 'string'
43
- attribute :city, 'string'
44
- property :location, 'string'
45
- property :capital, 'boolean'
42
+ attribute :country, 'value.string' # an alias of SmartCore::Types::Value::String (see smart_initializer gem)
43
+ attribute :city, 'value.string'
44
+ property :location, 'value.string'
45
+ property :capital, SmartCore::Types::Value::Boolean
46
46
  end
47
47
 
48
48
  khabarovsk = Address.new('Russia', 'Khabaovsk', location: '48.4814/135.0721', capital: false)
@@ -70,7 +70,7 @@ khabarovsk.to_h # or #as_hash or #to_hash
70
70
  ```ruby
71
71
  # comparability:
72
72
  khabarovsk == same_city # => true
73
- khabarovsk == another_city # false
73
+ khabarovsk == another_city # => false
74
74
  ```
75
75
 
76
76
  ```ruby
@@ -79,6 +79,35 @@ khabarovsk.to_a # => [khabarovsk]
79
79
  khabarovsk.each { |entity| puts entity } # => outputs itself
80
80
  ```
81
81
 
82
+ ---
83
+
84
+ ## Roadmap
85
+
86
+ - Migrate to `GitHub Actions`;
87
+
88
+ ---
89
+
90
+ ## Build
91
+
92
+ - run tests:
93
+
94
+ ```shell
95
+ bundle exec rspec
96
+ ```
97
+
98
+ - run code style checks:
99
+
100
+ ```shell
101
+ bundle exec rubocop
102
+ ```
103
+
104
+ - run code style checks with auto-correction:
105
+
106
+ ```shell
107
+ bundle exec rubocop -A
108
+ ```
109
+
110
+
82
111
  ---
83
112
 
84
113
  ## Contributing
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'bundler/setup'
5
- require 'smart_core/value-object'
5
+ require 'smart_core'
6
6
 
7
- require 'irb'
8
- IRB.start(__FILE__)
7
+ require 'pry'
8
+ Pry.start
@@ -59,6 +59,7 @@ module SmartCore::ValueObject::Interface::Comparable
59
59
  #
60
60
  # @api public
61
61
  # @since 0.1.0
62
+ # rubocop:disable Style/RedundantSelf
62
63
  def eql?(another_object)
63
64
  self.class <= another_object.class && (
64
65
  self.class.__params__.all? do |attribute|
@@ -71,5 +72,6 @@ module SmartCore::ValueObject::Interface::Comparable
71
72
  )
72
73
  end
73
74
  alias_method :==, :eql?
75
+ # rubocop:enable Style/RedundantSelf
74
76
  end
75
77
  end
@@ -23,8 +23,10 @@ module SmartCore::ValueObject::Interface::Enumerable
23
23
  #
24
24
  # @api public
25
25
  # @since 0.1.0
26
+ # rubocop:disable Style/RedundantParentheses
26
27
  def each(&block)
27
28
  block_given? ? yield(self) : (Enumerator.new { |yielder| yielder.yield(self) }.each)
28
29
  end
30
+ # rubocop:enable Style/RedundantParentheses
29
31
  end
30
32
  end
@@ -1,11 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SmartCore
4
+ # rubocop:disable Style/StaticClass
4
5
  class ValueObject
5
6
  # @return [String]
6
7
  #
7
8
  # @api public
8
9
  # @since 0.1.0
9
- VERSION = '0.1.0'
10
+ VERSION = '0.2.0'
10
11
  end
12
+ # rubocop:enable Style/StaticClass
11
13
  end
@@ -30,12 +30,12 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ['lib']
32
32
 
33
- spec.add_runtime_dependency 'smart_initializer', '~> 0.3'
33
+ spec.add_runtime_dependency 'smart_initializer', '~> 0.5'
34
34
 
35
- spec.add_development_dependency 'armitage-rubocop', '~> 0.87'
36
- spec.add_development_dependency 'bundler', '~> 2.1'
35
+ spec.add_development_dependency 'armitage-rubocop', '~> 1.7'
36
+ spec.add_development_dependency 'bundler', '~> 2.2'
37
37
  spec.add_development_dependency 'pry', '~> 0.13'
38
38
  spec.add_development_dependency 'rake', '~> 13.0'
39
- spec.add_development_dependency 'rspec', '~> 3.9'
40
- spec.add_development_dependency 'simplecov', '~> 0.18'
39
+ spec.add_development_dependency 'rspec', '~> 3.10'
40
+ spec.add_development_dependency 'simplecov', '~> 0.21'
41
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_value-object
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Ibragimov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-12 00:00:00.000000000 Z
11
+ date: 2021-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: smart_initializer
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.3'
19
+ version: '0.5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.3'
26
+ version: '0.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: armitage-rubocop
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.87'
33
+ version: '1.7'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.87'
40
+ version: '1.7'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.1'
47
+ version: '2.2'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.1'
54
+ version: '2.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -86,28 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.9'
89
+ version: '3.10'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.9'
96
+ version: '3.10'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0.18'
103
+ version: '0.21'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0.18'
110
+ version: '0.21'
111
111
  description: ValueObject pattern realized in scope of Ruby.
112
112
  email:
113
113
  - iamdaiver@gmail.com
@@ -118,7 +118,6 @@ files:
118
118
  - ".gitignore"
119
119
  - ".rspec"
120
120
  - ".rubocop.yml"
121
- - ".travis.yml"
122
121
  - CHANGELOG.md
123
122
  - CODE_OF_CONDUCT.md
124
123
  - Gemfile
@@ -144,7 +143,7 @@ metadata:
144
143
  homepage_uri: https://github.com/smart-rb/smart_value-object
145
144
  source_code_uri: https://github.com/smart-rb/smart_value-object
146
145
  changelog_uri: https://github.com/smart-rb/smart_value-object/blob/master/CHANGELOG.md
147
- post_install_message:
146
+ post_install_message:
148
147
  rdoc_options: []
149
148
  require_paths:
150
149
  - lib
@@ -159,8 +158,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
158
  - !ruby/object:Gem::Version
160
159
  version: '0'
161
160
  requirements: []
162
- rubygems_version: 3.1.2
163
- signing_key:
161
+ rubygems_version: 3.2.3
162
+ signing_key:
164
163
  specification_version: 4
165
164
  summary: ValueObject pattern realized in scope of Ruby.
166
165
  test_files: []
@@ -1,23 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- os: linux
5
- dist: xenial
6
- jobs:
7
- fast_finish: true
8
- include:
9
- - rvm: 2.4.10
10
- - rvm: 2.5.8
11
- - rvm: 2.6.6
12
- - rvm: 2.7.1
13
- - rvm: jruby-head
14
- - rvm: ruby-head
15
- - rvm: truffleruby
16
- allow_failures:
17
- - rvm: ruby-head
18
- - rvm: jruby-head
19
- - rvm: truffleruby
20
- before_install: gem install bundler
21
- script:
22
- - bundle exec rake rubocop
23
- - bundle exec rake rspec