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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e23965fecffcb108574ea3e42ae2889965914a65ebc80f71fbdb3f40e3b67e34
4
- data.tar.gz: 96efc5116431669ef5ae2d88fa1945ba38d90fb14de3d35e7182154039efbde1
3
+ metadata.gz: cca83eddfe861552adada0fd1f570d4fe8cb4ae9621be1b8ba183f4ce75d2e0a
4
+ data.tar.gz: a4f6192afef7522bc45be5a3b448b1366a1e18cc6318b8dd95e7e88021b12070
5
5
  SHA512:
6
- metadata.gz: b87c39aaa85e776fe0289cf9f97eafc80ce093d44775fb5753d864aa5e1ad1537c93b4f99dadce284ae4071f41ee15a03f873ee6230a3c2a246df5acb1fcd0c8
7
- data.tar.gz: 13ff2f71fc510903f7430e4e37e528cc122a627d8e5228684c922c41b076aaf84a45f6620bcb9755c42a9e66676d117e2b83ef56218980abbe92550f4434f257
6
+ metadata.gz: 64b64ba2e60584ccf94737cae4770f972a45ef72ba3421f7131f1727cff2da7b6b2001537f6d054338a3a3edb9941a0655dff0d00eeaf2c85c0bd64e0ebd7da0
7
+ data.tar.gz: fc7a43a1ff7490622cb87c49805957b6a8b1e0ce488e64bc9cc23f2edb75f135f0d50bc376b128f88a3b01965d3cdc8a84c7b87a8918991eeb6aca9505db1fc4
@@ -21,4 +21,5 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency 'bundler'
22
22
  s.add_development_dependency 'minitest', '~> 5.14'
23
23
  s.add_development_dependency 'rake', '~> 13.0'
24
+ s.add_development_dependency 'rubocop', '1.3.1'
24
25
  end
@@ -52,7 +52,6 @@ module Corindon
52
52
 
53
53
  # @param [String] id
54
54
  def id(id)
55
- @anonymous = false
56
55
  @id = id
57
56
  end
58
57
 
@@ -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?(">= 2.7.0")
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
@@ -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 || "This method is not implemented.")
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 || "Reached unreachable code.")
12
+ raise StandardError.new(message || 'Reached unreachable code.')
13
13
  end
14
14
  end
15
15
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Corindon
4
- VERSION = "0.7.0"
4
+ VERSION = '0.7.1'
5
5
  end
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.0
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-16 00:00:00.000000000 Z
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
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Corindon
4
- module Console
5
- class Application
6
- attr_reader :commands
7
-
8
- def initialize
9
- @commands = {}
10
- end
11
-
12
- def run(argv); end
13
- end
14
- end
15
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Corindon
4
- module Console
5
- class BaseCommand
6
- configure do |c|
7
- c.name 'blabla'
8
- end
9
-
10
- def run(input, output); end
11
- end
12
- end
13
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Corindon
4
- module Console
5
- class Input
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Corindon
4
- module Console
5
- class Output
6
- end
7
- end
8
- end