eac_ruby_utils 0.106.0 → 0.107.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 327886d15b376e910d0dd5fec9233893209abdeb2e28f3ac6c37c21c09af8b67
|
4
|
+
data.tar.gz: 1cec2ad79b9d74a99685b5722e8a3b4ee38118088443601b0cb3ad87bdae65c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eee2f09ecad4676780dc461ced9bfd31a03363b0187bc53e59463afa6bbc35a062d58eb333ec38c0e76abc5ba6df13bf114393e4c67862a3b4300935e6c11056
|
7
|
+
data.tar.gz: 2a85091e0d59670188c5dc87d07328aee35ce6d4483c15c73159a28b8c292a3ad534f316d76cbb82128da8f102882d164179b627b9d843e3219484ba0001266d
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_ruby_utils/rspec/stub_speaker'
|
5
|
+
require 'eac_ruby_utils/speaker'
|
4
6
|
|
5
7
|
module EacRubyUtils
|
6
8
|
module Rspec
|
@@ -13,6 +15,13 @@ module EacRubyUtils
|
|
13
15
|
obj.rspec_config.setup_manager = obj
|
14
16
|
obj.rspec_config.include(::EacRubyUtils::Rspec::Setup::SetupManager)
|
15
17
|
end
|
18
|
+
|
19
|
+
# @return [self]
|
20
|
+
def stub_eac_speaker
|
21
|
+
::EacRubyUtils::Speaker.context.push(::EacRubyUtils::Rspec::StubSpeaker.new)
|
22
|
+
|
23
|
+
self
|
24
|
+
end
|
16
25
|
end
|
17
26
|
end
|
18
27
|
end
|
@@ -28,8 +28,7 @@ module EacRubyUtils
|
|
28
28
|
|
29
29
|
def value
|
30
30
|
parsed_options.order.each do |method|
|
31
|
-
|
32
|
-
return value if value
|
31
|
+
return send("value_by_#{method}") if send("value_by_#{method}?")
|
33
32
|
end
|
34
33
|
return parsed_options.default if parsed_options.respond_to?(OPTION_DEFAULT)
|
35
34
|
return nil unless parsed_options.required
|
@@ -39,16 +38,26 @@ module EacRubyUtils
|
|
39
38
|
|
40
39
|
def value_by_constant
|
41
40
|
source.class.const_get(constant_name)
|
42
|
-
|
43
|
-
|
41
|
+
end
|
42
|
+
|
43
|
+
def value_by_constant?
|
44
|
+
source.class.const_defined?(constant_name)
|
44
45
|
end
|
45
46
|
|
46
47
|
def value_by_method
|
47
|
-
source.
|
48
|
+
source.send(key)
|
49
|
+
end
|
50
|
+
|
51
|
+
def value_by_method?
|
52
|
+
source.respond_to?(key, true)
|
48
53
|
end
|
49
54
|
|
50
55
|
def value_by_settings_object
|
51
|
-
source.settings_object
|
56
|
+
source.settings_object.fetch(key)
|
57
|
+
end
|
58
|
+
|
59
|
+
def value_by_settings_object?
|
60
|
+
source.settings_object.key?(key)
|
52
61
|
end
|
53
62
|
|
54
63
|
private
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'active_support/hash_with_indifferent_access'
|
3
4
|
require 'eac_ruby_utils/require_sub'
|
4
5
|
|
5
6
|
module EacRubyUtils
|
@@ -15,8 +16,11 @@ module EacRubyUtils
|
|
15
16
|
%w[settings_object method constant]
|
16
17
|
end
|
17
18
|
|
19
|
+
# return [ActiveSupport::HashWithIndifferentAccess]
|
18
20
|
def settings_object
|
19
|
-
|
21
|
+
ActiveSupport::HashWithIndifferentAccess.new(
|
22
|
+
respond_to?(settings_object_name) ? send(settings_object_name) : {}
|
23
|
+
)
|
20
24
|
end
|
21
25
|
|
22
26
|
def settings_object_name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_ruby_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.107.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|