smart_core 0.5.2 → 0.6.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: c08a93088fea508e62a40c0f7cd403b5f4b660372a3254453cd61be4a05a6635
4
- data.tar.gz: ba732416c5af24d0aed8d685abb5b21fc76798a56af92aa1ad12d5d4d6da6a31
3
+ metadata.gz: b7867022eeaee9e4538e85a8daa448b0906cae19bf54bdeb1d527699de3934d3
4
+ data.tar.gz: ba755bf600dfd06a1cf82f318dc48a5e6ed1955e703073757ca35ecba711d803
5
5
  SHA512:
6
- metadata.gz: 45bbc699159a5f9b45e84f7e4c7389bf0c64a727826156f2061bfc5b8aca514832ef8af02dbdd3623dd35da52c7395155f48ae013cef2771535b088880113de1
7
- data.tar.gz: 824492f55c4329b76bae550a8e280e235d78d79661ecab2c8cba362d80ed4d58adab77fbd7ff84c30a44ccfe0642285e65eaaa17332e92b5c543376eeffb9dd0
6
+ metadata.gz: 745b23e80f8eaa5799cc538ee470f6fcd8bea122fe421b1baf719655f33c0fba4b838f5a985f5a3180247aa5e1b0f07e7e16266c1b0ac0ac22ce975fc336db06
7
+ data.tar.gz: 70de948e0cc48516091af87cf194ed2564544c3d2586aaee5d7c97daaee96eee593a1426102461c36d76bd1add72ceb4bd1557b2746084ede695beccefdaef71
@@ -17,3 +17,7 @@ AllCops:
17
17
  # NOTE: support for old ruby versions
18
18
  Style/RedundantBegin:
19
19
  Enabled: false
20
+
21
+ # NOTE: temporary disabled
22
+ RSpec/LeakyConstantDeclaration:
23
+ Enabled: false
@@ -6,9 +6,9 @@ matrix:
6
6
  fast_finish: true
7
7
  include:
8
8
  - rvm: 2.3.8
9
- - rvm: 2.4.6
10
- - rvm: 2.5.5
11
- - rvm: 2.6.3
9
+ - rvm: 2.4.7
10
+ - rvm: 2.5.6
11
+ - rvm: 2.6.4
12
12
  - rvm: ruby-head
13
13
  - rvm: jruby-head
14
14
  allow_failures:
@@ -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 `Symobl` type definition in `SmartCore::Initializer`
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 · [![Gem Version](https://badge.fury.io/rb/smart_core.svg)](https://badge.fury.io/rb/smart_core) [![Build Status](https://travis-ci.org/0exp/smart_core.svg?branch=master)](https://travis-ci.org/0exp/smart_core) [![Coverage Status](https://coveralls.io/repos/github/0exp/smart_core/badge.svg?branch=master)](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
 
Binary file
@@ -19,7 +19,7 @@ class SmartCore::Initializer::Attribute::ValueFinalizer::Lambda
19
19
  # @api private
20
20
  # @since 0.5.0
21
21
  def finalize(value, instance)
22
- finalizer.call(value)
22
+ instance.instance_exec(value, &finalizer)
23
23
  end
24
24
 
25
25
  private
@@ -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
@@ -41,4 +41,12 @@ class SmartCore::Operation::Result
41
41
  def failure?
42
42
  false
43
43
  end
44
+
45
+ # @return [Boolean]
46
+ #
47
+ # @api public
48
+ # @since 0.6.0
49
+ def custom?
50
+ false
51
+ end
44
52
  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
  #
@@ -5,5 +5,5 @@ module SmartCore
5
5
  #
6
6
  # @api public
7
7
  # @since 0.1.0
8
- VERSION = '0.5.2'
8
+ VERSION = '0.6.0'
9
9
  end
@@ -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.70'
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.5.2
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-06-05 00:00:00.000000000 Z
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.70'
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.70'
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
- rubyforge_project:
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"