corindon 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/corindon.gemspec +1 -0
- data/lib/corindon/dependency_injection/dsl.rb +0 -1
- data/lib/corindon/dependency_injection/ruby_compat.rb +1 -1
- data/lib/corindon/dependency_injection/testing/mock_utils.rb +21 -0
- data/lib/corindon/guards/ext.rb +2 -2
- data/lib/corindon/version.rb +1 -1
- metadata +17 -6
- data/lib/corindon/console/application.rb +0 -15
- data/lib/corindon/console/base_command.rb +0 -13
- data/lib/corindon/console/input.rb +0 -8
- data/lib/corindon/console/output.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cca83eddfe861552adada0fd1f570d4fe8cb4ae9621be1b8ba183f4ce75d2e0a
|
4
|
+
data.tar.gz: a4f6192afef7522bc45be5a3b448b1366a1e18cc6318b8dd95e7e88021b12070
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64b64ba2e60584ccf94737cae4770f972a45ef72ba3421f7131f1727cff2da7b6b2001537f6d054338a3a3edb9941a0655dff0d00eeaf2c85c0bd64e0ebd7da0
|
7
|
+
data.tar.gz: fc7a43a1ff7490622cb87c49805957b6a8b1e0ce488e64bc9cc23f2edb75f135f0d50bc376b128f88a3b01965d3cdc8a84c7b87a8918991eeb6aca9505db1fc4
|
data/corindon.gemspec
CHANGED
@@ -4,7 +4,7 @@ module Corindon
|
|
4
4
|
module DependencyInjection
|
5
5
|
class RubyCompat
|
6
6
|
class << self
|
7
|
-
if ::Semantic::Version.new(RUBY_VERSION).satisfies?(
|
7
|
+
if ::Semantic::Version.new(RUBY_VERSION).satisfies?('>= 2.7.0')
|
8
8
|
def do_call(obj, method, args, kwargs)
|
9
9
|
obj.send(method, *args, **kwargs)
|
10
10
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Corindon
|
4
|
+
module DependencyInjection
|
5
|
+
module Testing
|
6
|
+
# Defines the `mock_definition` on Container allowing to mock services returned by the container for a given Definition
|
7
|
+
module MockUtils
|
8
|
+
refine Container do
|
9
|
+
# Allow to provide a specific value that the definition will resolve to
|
10
|
+
# @param [Definition] definition
|
11
|
+
# @param [Object] value
|
12
|
+
def mock_definition(definition, value)
|
13
|
+
add_definition(definition) if !has?(definition)
|
14
|
+
|
15
|
+
services[to_id(definition)] = value
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/corindon/guards/ext.rb
CHANGED
@@ -5,11 +5,11 @@ module Corindon
|
|
5
5
|
module Ext
|
6
6
|
refine Object do
|
7
7
|
def unimplemented!(message = nil)
|
8
|
-
raise NotImplementedError.new(message ||
|
8
|
+
raise NotImplementedError.new(message || 'This method is not implemented.')
|
9
9
|
end
|
10
10
|
|
11
11
|
def unreachable!(message = nil)
|
12
|
-
raise StandardError.new(message ||
|
12
|
+
raise StandardError.new(message || 'Reached unreachable code.')
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
data/lib/corindon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: corindon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rémi Piotaix
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semantic
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '13.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.3.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.3.1
|
83
97
|
description:
|
84
98
|
email: remi@piotaix.fr
|
85
99
|
executables: []
|
@@ -88,16 +102,13 @@ extra_rdoc_files: []
|
|
88
102
|
files:
|
89
103
|
- corindon.gemspec
|
90
104
|
- lib/corindon.rb
|
91
|
-
- lib/corindon/console/application.rb
|
92
|
-
- lib/corindon/console/base_command.rb
|
93
|
-
- lib/corindon/console/input.rb
|
94
|
-
- lib/corindon/console/output.rb
|
95
105
|
- lib/corindon/dependency_injection/container.rb
|
96
106
|
- lib/corindon/dependency_injection/definition.rb
|
97
107
|
- lib/corindon/dependency_injection/dsl.rb
|
98
108
|
- lib/corindon/dependency_injection/injectable.rb
|
99
109
|
- lib/corindon/dependency_injection/injector.rb
|
100
110
|
- lib/corindon/dependency_injection/ruby_compat.rb
|
111
|
+
- lib/corindon/dependency_injection/testing/mock_utils.rb
|
101
112
|
- lib/corindon/dependency_injection/token/injection_token.rb
|
102
113
|
- lib/corindon/dependency_injection/token/parameter_token.rb
|
103
114
|
- lib/corindon/dependency_injection/token/service_call_token.rb
|