smart_core 0.5.2 → 0.6.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 +4 -4
- data/.rubocop.yml +4 -0
- data/.travis.yml +3 -3
- data/CHANGELOG.md +5 -1
- data/README.md +2 -1
- data/docs/SmartCore.pdf +0 -0
- data/lib/smart_core/initializer/attribute/value_finalizer/lambda.rb +1 -1
- data/lib/smart_core/operation.rb +1 -0
- data/lib/smart_core/operation/custom.rb +38 -0
- data/lib/smart_core/operation/result.rb +8 -0
- data/lib/smart_core/operation/result_interface.rb +9 -0
- data/lib/smart_core/version.rb +1 -1
- data/smart_core.gemspec +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7867022eeaee9e4538e85a8daa448b0906cae19bf54bdeb1d527699de3934d3
|
4
|
+
data.tar.gz: ba755bf600dfd06a1cf82f318dc48a5e6ed1955e703073757ca35ecba711d803
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 745b23e80f8eaa5799cc538ee470f6fcd8bea122fe421b1baf719655f33c0fba4b838f5a985f5a3180247aa5e1b0f07e7e16266c1b0ac0ac22ce975fc336db06
|
7
|
+
data.tar.gz: 70de948e0cc48516091af87cf194ed2564544c3d2586aaee5d7c97daaee96eee593a1426102461c36d76bd1add72ceb4bd1557b2746084ede695beccefdaef71
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## [0.6.0] - 2019-09-18
|
5
|
+
### Added
|
6
|
+
- New result type: `SmartCore::Operation::Custom` with custom logic provided as a proc;
|
7
|
+
|
4
8
|
## [0.5.2] - 2019-06-05
|
5
9
|
### Added
|
6
10
|
- Common Result Object interface (realized as a mixin (`SmartCore::Operation::ResultInterface`))
|
7
11
|
|
8
12
|
## [0.5.1] - 2019-06-04
|
9
13
|
### Added
|
10
|
-
- Support for `
|
14
|
+
- Support for `Symbol` type definition in `SmartCore::Initializer`
|
11
15
|
|
12
16
|
## [0.5.0] - 2019-06-02
|
13
17
|
### PRE-RELEASE
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# SmartCore · [](https://badge.fury.io/rb/smart_core) [](https://travis-ci.org/0exp/smart_core) [](https://coveralls.io/github/0exp/smart_core?branch=master)
|
2
2
|
|
3
|
-
In active development
|
3
|
+
In active development (**Coming Soon**: Powerful documentaion :))
|
4
|
+
> Meetup Slides: [link](docs/SmartCore.pdf)
|
4
5
|
|
5
6
|
---
|
6
7
|
|
data/docs/SmartCore.pdf
ADDED
Binary file
|
data/lib/smart_core/operation.rb
CHANGED
@@ -11,6 +11,7 @@ class SmartCore::Operation
|
|
11
11
|
require_relative 'operation/success'
|
12
12
|
require_relative 'operation/failure'
|
13
13
|
require_relative 'operation/fatal'
|
14
|
+
require_relative 'operation/custom'
|
14
15
|
require_relative 'operation/result_interface'
|
15
16
|
require_relative 'operation/instance_builder'
|
16
17
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# @api public
|
4
|
+
# @since 0.6.0
|
5
|
+
class SmartCore::Operation::Custom < SmartCore::Operation::Result
|
6
|
+
# @return [Block]
|
7
|
+
#
|
8
|
+
# @api public
|
9
|
+
# @since 0.6.0
|
10
|
+
attr_reader :custom_logic
|
11
|
+
|
12
|
+
# @param custom_logic [Block]
|
13
|
+
# @return [void]
|
14
|
+
#
|
15
|
+
# @api public
|
16
|
+
# @since 0.6.0
|
17
|
+
def initialize(&custom_logic)
|
18
|
+
@custom_logic = custom_logic
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [Boolean]
|
22
|
+
#
|
23
|
+
# @api public
|
24
|
+
# @since 0.6.0
|
25
|
+
def custom?
|
26
|
+
true
|
27
|
+
end
|
28
|
+
|
29
|
+
# @param attributes [Array<Any>]
|
30
|
+
# @param options [Hash<Any,Any>]
|
31
|
+
# @return [Any]
|
32
|
+
#
|
33
|
+
# @api public
|
34
|
+
# @since 0.6.0
|
35
|
+
def call(*attributes, **options)
|
36
|
+
custom_logic.call(*attributes, **options)
|
37
|
+
end
|
38
|
+
end
|
@@ -21,6 +21,15 @@ module SmartCore::Operation::ResultInterface
|
|
21
21
|
SmartCore::Operation::Failure.new(*errors)
|
22
22
|
end
|
23
23
|
|
24
|
+
# @param custom_logic [Block]
|
25
|
+
# @return [SmartCore::Operation::Custom]
|
26
|
+
#
|
27
|
+
# @api public
|
28
|
+
# @since 0.6.0
|
29
|
+
def Custom(&custom_logic) # rubocop:disable Naming/MethodName
|
30
|
+
SmartCore::Operation::Custom.new(&custom_logic)
|
31
|
+
end
|
32
|
+
|
24
33
|
# @param errors [Array<Symbol|Any>]
|
25
34
|
# @return [SmartCore::Operation::Fatal]
|
26
35
|
#
|
data/lib/smart_core/version.rb
CHANGED
data/smart_core.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
|
27
27
|
spec.add_development_dependency 'coveralls', '~> 0.8'
|
28
28
|
spec.add_development_dependency 'simplecov', '~> 0.16'
|
29
|
-
spec.add_development_dependency 'armitage-rubocop', '~> 0.
|
29
|
+
spec.add_development_dependency 'armitage-rubocop', '~> 0.74'
|
30
30
|
spec.add_development_dependency 'rspec', '~> 3.8'
|
31
31
|
|
32
32
|
spec.add_development_dependency 'bundler'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rustam Ibragimov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.74'
|
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: '0.
|
54
|
+
version: '0.74'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,6 +127,7 @@ files:
|
|
127
127
|
- Rakefile
|
128
128
|
- bin/console
|
129
129
|
- bin/setup
|
130
|
+
- docs/SmartCore.pdf
|
130
131
|
- lib/smart_core.rb
|
131
132
|
- lib/smart_core/container.rb
|
132
133
|
- lib/smart_core/container/command_definer.rb
|
@@ -171,6 +172,7 @@ files:
|
|
171
172
|
- lib/smart_core/initializer/type_set.rb
|
172
173
|
- lib/smart_core/injector.rb
|
173
174
|
- lib/smart_core/operation.rb
|
175
|
+
- lib/smart_core/operation/custom.rb
|
174
176
|
- lib/smart_core/operation/exceptions.rb
|
175
177
|
- lib/smart_core/operation/failure.rb
|
176
178
|
- lib/smart_core/operation/fatal.rb
|
@@ -218,8 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
220
|
- !ruby/object:Gem::Version
|
219
221
|
version: '0'
|
220
222
|
requirements: []
|
221
|
-
|
222
|
-
rubygems_version: 2.7.6
|
223
|
+
rubygems_version: 3.0.3
|
223
224
|
signing_key:
|
224
225
|
specification_version: 4
|
225
226
|
summary: "(in active development) A set of common abstractions"
|