sinclair 2.0.1 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/config/check_specs.yml +2 -0
- data/config/yardstick.yml +5 -1
- data/lib/sinclair/chain_settable.rb +83 -0
- data/lib/sinclair/core_ext/object.rb +39 -0
- data/lib/sinclair/env_settable.rb +35 -17
- data/lib/sinclair/settable/builder.rb +140 -0
- data/lib/sinclair/settable/caster.rb +61 -0
- data/lib/sinclair/settable/class_methods.rb +80 -0
- data/lib/sinclair/settable.rb +115 -0
- data/lib/sinclair/version.rb +1 -1
- data/lib/sinclair.rb +2 -0
- data/spec/integration/yard/sinclair/env_settable_spec.rb +6 -25
- data/spec/integration/yard/sinclair/settable/caster_spec.rb +41 -0
- data/spec/integration/yard/sinclair/settable/class_methods_spec.rb +11 -0
- data/spec/integration/yard/sinclair/settable_spec.rb +26 -0
- data/spec/lib/sinclair/chain_settable_spec.rb +109 -0
- data/spec/lib/sinclair/env_settable_spec.rb +4 -2
- data/spec/lib/sinclair/settable/builder_spec.rb +47 -0
- data/spec/lib/sinclair/settable_spec.rb +46 -0
- data/spec/support/files/config.yml +1 -0
- data/spec/support/models/app_client.rb +1 -0
- data/spec/support/models/hash_app_client.rb +14 -0
- data/spec/support/models/hash_settable.rb +10 -0
- data/spec/support/models/json_env_settings.rb +18 -0
- data/spec/support/models/math_env_settings.rb +17 -0
- data/spec/support/models/my_app_client.rb +1 -0
- data/spec/support/models/non_default_app_client.rb +8 -0
- data/spec/support/models/yaml_file_settings.rb +26 -0
- data/spec/support/shared_examples/settable.rb +86 -0
- metadata +21 -5
- data/lib/sinclair/env_settable/builder.rb +0 -61
- data/spec/lib/sinclair/env_settable/builder_spec.rb +0 -35
- data/spec/support/shared_examples/env_settable.rb +0 -43
@@ -4,42 +4,23 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe Sinclair::EnvSettable do
|
6
6
|
describe '#yard' do
|
7
|
-
subject(:settable) {
|
7
|
+
subject(:settable) { MyAppClient }
|
8
8
|
|
9
9
|
before do
|
10
10
|
ENV['MY_APP_USERNAME'] = 'my_login'
|
11
|
+
ENV['MY_APP_PORT'] = '8080'
|
11
12
|
end
|
12
13
|
|
13
14
|
after do
|
14
15
|
ENV.delete('MY_APP_USERNAME')
|
16
|
+
ENV.delete('MY_APP_PORT')
|
15
17
|
end
|
16
18
|
|
17
|
-
it 'retrieves
|
19
|
+
it 'retrieves data from env' do
|
18
20
|
expect(settable.username).to eq('my_login')
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'retrieves password from env' do
|
22
21
|
expect(settable.password).to be_nil
|
23
|
-
|
24
|
-
|
25
|
-
context 'when defining defaults' do
|
26
|
-
it 'returns default value' do
|
27
|
-
expect(settable.host).to eq('my-host.com')
|
28
|
-
end
|
29
|
-
|
30
|
-
context 'when setting the env variable' do
|
31
|
-
before do
|
32
|
-
ENV['MY_APP_HOST'] = 'other-host.com'
|
33
|
-
end
|
34
|
-
|
35
|
-
after do
|
36
|
-
ENV.delete('MY_APP_HOST')
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'retrieves host from env' do
|
40
|
-
expect(settable.host).to eq('other-host.com')
|
41
|
-
end
|
42
|
-
end
|
22
|
+
expect(settable.host).to eq('my-host.com')
|
23
|
+
expect(settable.port).to eq(8080)
|
43
24
|
end
|
44
25
|
end
|
45
26
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Sinclair::Settable::Caster do
|
6
|
+
describe '#yard' do
|
7
|
+
describe 'altering base caster' do
|
8
|
+
subject(:settable) { MathEnvSettings }
|
9
|
+
|
10
|
+
before do
|
11
|
+
ENV['MATH_VALUE'] = '80'
|
12
|
+
end
|
13
|
+
|
14
|
+
after do
|
15
|
+
ENV.delete('MATH_VALUE')
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'retrieves data from env' do
|
19
|
+
expect(settable.value).to eq(6400.0)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe 'creating a new caster' do
|
24
|
+
subject(:settable) { JsonEnvSettings }
|
25
|
+
|
26
|
+
let(:hash) { { key: 'value' } }
|
27
|
+
|
28
|
+
before do
|
29
|
+
ENV['JSON_CONFIG'] = hash.to_json
|
30
|
+
end
|
31
|
+
|
32
|
+
after do
|
33
|
+
ENV.delete('JSON_CONFIG')
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'retrieves data from env' do
|
37
|
+
expect(settable.config).to eq(hash.stringify_keys)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Sinclair::Settable do
|
6
|
+
describe '#yard' do
|
7
|
+
subject(:settable) { HashAppClient }
|
8
|
+
|
9
|
+
before do
|
10
|
+
HashAppClient::HASH[:username] = 'my_login'
|
11
|
+
HashAppClient::HASH[:port] = '8080'
|
12
|
+
end
|
13
|
+
|
14
|
+
after do
|
15
|
+
HashAppClient::HASH.delete(:username)
|
16
|
+
HashAppClient::HASH.delete(:port)
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'retrieves data from env' do
|
20
|
+
expect(settable.username).to eq('my_login')
|
21
|
+
expect(settable.password).to be_nil
|
22
|
+
expect(settable.host).to eq('my-host.com')
|
23
|
+
expect(settable.port).to eq(8080)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Sinclair::ChainSettable do
|
6
|
+
subject(:settable) do
|
7
|
+
options = options_hash
|
8
|
+
env_setting = env_setting_class
|
9
|
+
|
10
|
+
Class.new do
|
11
|
+
extend Sinclair::ChainSettable
|
12
|
+
|
13
|
+
source :app_client, env_setting
|
14
|
+
source :my_app_client, Class.new(MyAppClient)
|
15
|
+
|
16
|
+
setting_with_options :username, :password, :host, :port, **options
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
let(:env_setting_class) { Class.new(NonDefaultAppClient) }
|
21
|
+
let(:options_hash) { {} }
|
22
|
+
let(:username) { 'my_login' }
|
23
|
+
let(:password) { Random.rand(10_000).to_s }
|
24
|
+
|
25
|
+
context 'when the first setting finds the data' do
|
26
|
+
let(:username_key) { 'USERNAME' }
|
27
|
+
let(:password_key) { 'PASSWORD' }
|
28
|
+
let(:host_key) { 'HOST' }
|
29
|
+
let(:port_key) { 'PORT' }
|
30
|
+
|
31
|
+
it_behaves_like 'settings reading'
|
32
|
+
end
|
33
|
+
|
34
|
+
context 'when the second setting finds the data' do
|
35
|
+
let(:username_key) { 'MY_APP_USERNAME' }
|
36
|
+
let(:password_key) { 'MY_APP_PASSWORD' }
|
37
|
+
let(:host_key) { 'MY_APP_HOST' }
|
38
|
+
let(:port_key) { 'MY_APP_PORT' }
|
39
|
+
|
40
|
+
it_behaves_like 'settings reading'
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'when both have a value' do
|
44
|
+
let(:first_username) { 'first_username' }
|
45
|
+
let(:second_username) { 'second_username' }
|
46
|
+
|
47
|
+
before do
|
48
|
+
ENV['USERNAME'] = first_username
|
49
|
+
ENV['MY_APP_USERNAME'] = second_username
|
50
|
+
end
|
51
|
+
|
52
|
+
after do
|
53
|
+
ENV.delete('USERNAME')
|
54
|
+
ENV.delete('MY_APP_USERNAME')
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'returns the first value' do
|
58
|
+
expect(settable.username).to eq(first_username)
|
59
|
+
end
|
60
|
+
|
61
|
+
context 'when passing a different source as options' do
|
62
|
+
let(:options_hash) { { sources: %i[my_app_client app_client] } }
|
63
|
+
|
64
|
+
it 'returns the second value' do
|
65
|
+
expect(settable.username).to eq(second_username)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
context 'when none has value' do
|
71
|
+
let(:default) { 'some_default_username' }
|
72
|
+
let(:options_hash) { { default: default } }
|
73
|
+
|
74
|
+
it 'returns the first value' do
|
75
|
+
expect(settable.username).to eq(default)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
context 'when there is a subclass with diferent sources' do
|
80
|
+
subject(:second_settable) do
|
81
|
+
env_setting = second_env_setting_class
|
82
|
+
|
83
|
+
Class.new(settable) do
|
84
|
+
source :app_client, env_setting
|
85
|
+
source :my_app_client, Class.new(MyAppClient)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
let(:first_username) { 'first_username' }
|
90
|
+
let(:second_username) { 'second_username' }
|
91
|
+
let(:second_env_setting_class) do
|
92
|
+
Class.new(MyAppClient)
|
93
|
+
end
|
94
|
+
|
95
|
+
before do
|
96
|
+
ENV['USERNAME'] = first_username
|
97
|
+
ENV['MY_APP_USERNAME'] = second_username
|
98
|
+
end
|
99
|
+
|
100
|
+
after do
|
101
|
+
ENV.delete('USERNAME')
|
102
|
+
ENV.delete('MY_APP_USERNAME')
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'returns different values' do
|
106
|
+
expect(settable.username).not_to eq(second_settable.username)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -11,8 +11,9 @@ describe Sinclair::EnvSettable do
|
|
11
11
|
let(:username_key) { 'USERNAME' }
|
12
12
|
let(:password_key) { 'PASSWORD' }
|
13
13
|
let(:host_key) { 'HOST' }
|
14
|
+
let(:port_key) { 'PORT' }
|
14
15
|
|
15
|
-
it_behaves_like 'settings reading
|
16
|
+
it_behaves_like 'settings reading'
|
16
17
|
|
17
18
|
context 'when defining a prefix' do
|
18
19
|
subject(:settable) { Class.new(MyAppClient) }
|
@@ -20,7 +21,8 @@ describe Sinclair::EnvSettable do
|
|
20
21
|
let(:username_key) { 'MY_APP_USERNAME' }
|
21
22
|
let(:password_key) { 'MY_APP_PASSWORD' }
|
22
23
|
let(:host_key) { 'MY_APP_HOST' }
|
24
|
+
let(:port_key) { 'MY_APP_PORT' }
|
23
25
|
|
24
|
-
it_behaves_like 'settings reading
|
26
|
+
it_behaves_like 'settings reading'
|
25
27
|
end
|
26
28
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Sinclair::Settable::Builder do
|
6
|
+
subject(:settable) do
|
7
|
+
setting_prefix = prefix
|
8
|
+
|
9
|
+
Class.new do
|
10
|
+
extend Sinclair::EnvSettable
|
11
|
+
|
12
|
+
settings_prefix setting_prefix
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:username) { 'my_login' }
|
17
|
+
let(:password) { Random.rand(10_000).to_s }
|
18
|
+
let(:settings) { %i[username password] }
|
19
|
+
let(:options) { { prefix: prefix } }
|
20
|
+
|
21
|
+
let(:builder) do
|
22
|
+
described_class.new(settable, *settings, **options)
|
23
|
+
end
|
24
|
+
|
25
|
+
before { builder.build }
|
26
|
+
|
27
|
+
context 'when not using prefix' do
|
28
|
+
let(:prefix) { nil }
|
29
|
+
|
30
|
+
let(:username_key) { 'USERNAME' }
|
31
|
+
let(:password_key) { 'PASSWORD' }
|
32
|
+
let(:host_key) { 'HOST' }
|
33
|
+
let(:port_key) { 'PORT' }
|
34
|
+
|
35
|
+
it_behaves_like 'settings reading'
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'when defining a prefix' do
|
39
|
+
let(:prefix) { 'MY_APP' }
|
40
|
+
let(:username_key) { 'MY_APP_USERNAME' }
|
41
|
+
let(:password_key) { 'MY_APP_PASSWORD' }
|
42
|
+
let(:host_key) { 'MY_APP_HOST' }
|
43
|
+
let(:port_key) { 'MY_APP_PORT' }
|
44
|
+
|
45
|
+
it_behaves_like 'settings reading'
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Sinclair::Settable do
|
6
|
+
context 'when reading from env' do
|
7
|
+
subject(:settable) { Class.new(AppClient) }
|
8
|
+
|
9
|
+
let(:username) { 'my_login' }
|
10
|
+
let(:password) { Random.rand(10_000).to_s }
|
11
|
+
|
12
|
+
let(:username_key) { 'USERNAME' }
|
13
|
+
let(:password_key) { 'PASSWORD' }
|
14
|
+
let(:host_key) { 'HOST' }
|
15
|
+
let(:port_key) { 'PORT' }
|
16
|
+
|
17
|
+
it_behaves_like 'settings reading'
|
18
|
+
|
19
|
+
context 'when defining a prefix' do
|
20
|
+
subject(:settable) { Class.new(MyAppClient) }
|
21
|
+
|
22
|
+
let(:username_key) { 'MY_APP_USERNAME' }
|
23
|
+
let(:password_key) { 'MY_APP_PASSWORD' }
|
24
|
+
let(:host_key) { 'MY_APP_HOST' }
|
25
|
+
let(:port_key) { 'MY_APP_PORT' }
|
26
|
+
|
27
|
+
it_behaves_like 'settings reading'
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'when reading from a hash constant' do
|
32
|
+
subject(:settable) { Class.new(HashAppClient) }
|
33
|
+
|
34
|
+
let(:username) { 'my_login' }
|
35
|
+
let(:password) { Random.rand(10_000).to_s }
|
36
|
+
|
37
|
+
let(:username_key) { :username }
|
38
|
+
let(:password_key) { :password }
|
39
|
+
let(:host_key) { :host }
|
40
|
+
let(:port_key) { :port }
|
41
|
+
|
42
|
+
it_behaves_like 'settings reading' do
|
43
|
+
let(:env_hash) { HashAppClient::HASH }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
timeout: 10
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require './spec/support/models/hash_settable'
|
4
|
+
|
5
|
+
class HashAppClient
|
6
|
+
extend HashSettable
|
7
|
+
|
8
|
+
# rubocop:disable Style/MutableConstant
|
9
|
+
HASH = {}
|
10
|
+
# rubocop:enable Style/MutableConstant
|
11
|
+
|
12
|
+
with_settings :username, :password, host: 'my-host.com'
|
13
|
+
setting_with_options :port, type: :integer
|
14
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module JsonEnvSettable
|
4
|
+
include Sinclair::EnvSettable
|
5
|
+
extend Sinclair::Settable::ClassMethods
|
6
|
+
|
7
|
+
class Caster < Sinclair::Settable::Caster
|
8
|
+
cast_with(:json) { |value| JSON.parse(value) }
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class JsonEnvSettings
|
13
|
+
extend JsonEnvSettable
|
14
|
+
|
15
|
+
settings_prefix 'JSON'
|
16
|
+
|
17
|
+
setting_with_options :config, type: :json
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Sinclair
|
4
|
+
module Settable
|
5
|
+
class Caster
|
6
|
+
cast_with(:squared) { |value| value.to_f**2 }
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class MathEnvSettings
|
12
|
+
extend Sinclair::EnvSettable
|
13
|
+
|
14
|
+
settings_prefix 'MATH'
|
15
|
+
|
16
|
+
setting_with_options :value, type: :squared
|
17
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module YamlFileSettable
|
4
|
+
include Sinclair::Settable
|
5
|
+
extend Sinclair::Settable::ClassMethods
|
6
|
+
|
7
|
+
read_with do |key|
|
8
|
+
loaded_yaml[key.to_s]
|
9
|
+
end
|
10
|
+
|
11
|
+
def loaded_yaml
|
12
|
+
YAML.load_file(setting_file)
|
13
|
+
end
|
14
|
+
|
15
|
+
def setting_file(file_path = @setting_file)
|
16
|
+
@setting_file = file_path
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class YamlFileSettings
|
21
|
+
extend YamlFileSettable
|
22
|
+
|
23
|
+
setting_file './spec/support/files/config.yml'
|
24
|
+
|
25
|
+
setting_with_options :timeout, default: 30
|
26
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
shared_examples 'settings reading' do
|
4
|
+
let(:env_hash) { ENV }
|
5
|
+
|
6
|
+
context 'when the key is not set' do
|
7
|
+
it 'retrieves username from env' do
|
8
|
+
expect(settable.username).to be_nil
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'retrieves password from env' do
|
12
|
+
expect(settable.password).to be_nil
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'when the key is set' do
|
17
|
+
before do
|
18
|
+
env_hash[username_key] = username
|
19
|
+
env_hash[password_key] = password
|
20
|
+
end
|
21
|
+
|
22
|
+
after do
|
23
|
+
env_hash.delete(username_key)
|
24
|
+
env_hash.delete(password_key)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'retrieves username from env' do
|
28
|
+
expect(settable.username).to eq(username)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'retrieves password from env' do
|
32
|
+
expect(settable.password).to eq(password)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context 'when defining defaults' do
|
37
|
+
let(:settings) { %i[host] }
|
38
|
+
let(:options) { { prefix: prefix, default: 'my-host.com' } }
|
39
|
+
|
40
|
+
it 'returns default value' do
|
41
|
+
expect(settable.host).to eq('my-host.com')
|
42
|
+
end
|
43
|
+
|
44
|
+
context 'when setting the env variable' do
|
45
|
+
let(:other_host) { 'other-host.com' }
|
46
|
+
|
47
|
+
before do
|
48
|
+
env_hash[host_key] = other_host
|
49
|
+
end
|
50
|
+
|
51
|
+
after do
|
52
|
+
env_hash.delete(host_key)
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'retrieves host from env' do
|
56
|
+
expect(settable.host).to eq(other_host)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
context 'when defining a type' do
|
62
|
+
let(:settings) { %i[port] }
|
63
|
+
let(:options) { { prefix: prefix, type: :integer } }
|
64
|
+
let(:port) { Random.rand(10..100) }
|
65
|
+
|
66
|
+
context 'when the key is not set' do
|
67
|
+
it 'retrieves port and cast to string' do
|
68
|
+
expect(settable.port).to be_nil
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
context 'when the key is set' do
|
73
|
+
before do
|
74
|
+
env_hash[port_key] = port.to_s
|
75
|
+
end
|
76
|
+
|
77
|
+
after do
|
78
|
+
env_hash.delete(port_key)
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'retrieves port and cast to string' do
|
82
|
+
expect(settable.port).to eq(port)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinclair
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DarthJee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -275,6 +275,7 @@ files:
|
|
275
275
|
- lib/sinclair.rb
|
276
276
|
- lib/sinclair/caster.rb
|
277
277
|
- lib/sinclair/caster/class_methods.rb
|
278
|
+
- lib/sinclair/chain_settable.rb
|
278
279
|
- lib/sinclair/class_methods.rb
|
279
280
|
- lib/sinclair/comparable.rb
|
280
281
|
- lib/sinclair/comparable/class_methods.rb
|
@@ -286,7 +287,6 @@ files:
|
|
286
287
|
- lib/sinclair/configurable.rb
|
287
288
|
- lib/sinclair/core_ext/object.rb
|
288
289
|
- lib/sinclair/env_settable.rb
|
289
|
-
- lib/sinclair/env_settable/builder.rb
|
290
290
|
- lib/sinclair/equals_checker.rb
|
291
291
|
- lib/sinclair/equals_checker/reader.rb
|
292
292
|
- lib/sinclair/exception.rb
|
@@ -326,6 +326,10 @@ files:
|
|
326
326
|
- lib/sinclair/options/builder.rb
|
327
327
|
- lib/sinclair/options/class_methods.rb
|
328
328
|
- lib/sinclair/options_parser.rb
|
329
|
+
- lib/sinclair/settable.rb
|
330
|
+
- lib/sinclair/settable/builder.rb
|
331
|
+
- lib/sinclair/settable/caster.rb
|
332
|
+
- lib/sinclair/settable/class_methods.rb
|
329
333
|
- lib/sinclair/version.rb
|
330
334
|
- sinclair.gemspec
|
331
335
|
- sinclair.jpg
|
@@ -367,9 +371,13 @@ files:
|
|
367
371
|
- spec/integration/yard/sinclair/model_spec.rb
|
368
372
|
- spec/integration/yard/sinclair/options_parser_spec.rb
|
369
373
|
- spec/integration/yard/sinclair/options_spec.rb
|
374
|
+
- spec/integration/yard/sinclair/settable/caster_spec.rb
|
375
|
+
- spec/integration/yard/sinclair/settable/class_methods_spec.rb
|
376
|
+
- spec/integration/yard/sinclair/settable_spec.rb
|
370
377
|
- spec/integration/yard/sinclair_spec.rb
|
371
378
|
- spec/lib/sinclair/caster/class_methods_spec.rb
|
372
379
|
- spec/lib/sinclair/caster_spec.rb
|
380
|
+
- spec/lib/sinclair/chain_settable_spec.rb
|
373
381
|
- spec/lib/sinclair/class_methods_spec.rb
|
374
382
|
- spec/lib/sinclair/comparable_spec.rb
|
375
383
|
- spec/lib/sinclair/config/methods_builder_spec.rb
|
@@ -379,7 +387,6 @@ files:
|
|
379
387
|
- spec/lib/sinclair/config_spec.rb
|
380
388
|
- spec/lib/sinclair/configurable_spec.rb
|
381
389
|
- spec/lib/sinclair/core_ext/object_spec.rb
|
382
|
-
- spec/lib/sinclair/env_settable/builder_spec.rb
|
383
390
|
- spec/lib/sinclair/env_settable_spec.rb
|
384
391
|
- spec/lib/sinclair/equals_checker/reader_spec.rb
|
385
392
|
- spec/lib/sinclair/equals_checker_spec.rb
|
@@ -413,8 +420,11 @@ files:
|
|
413
420
|
- spec/lib/sinclair/options/class_methods_spec.rb
|
414
421
|
- spec/lib/sinclair/options_parser_spec.rb
|
415
422
|
- spec/lib/sinclair/options_spec.rb
|
423
|
+
- spec/lib/sinclair/settable/builder_spec.rb
|
424
|
+
- spec/lib/sinclair/settable_spec.rb
|
416
425
|
- spec/lib/sinclair_spec.rb
|
417
426
|
- spec/spec_helper.rb
|
427
|
+
- spec/support/files/config.yml
|
418
428
|
- spec/support/fixture_helpers.rb
|
419
429
|
- spec/support/models/app_client.rb
|
420
430
|
- spec/support/models/app_config.rb
|
@@ -434,17 +444,21 @@ files:
|
|
434
444
|
- spec/support/models/enum_caster.rb
|
435
445
|
- spec/support/models/enum_converter.rb
|
436
446
|
- spec/support/models/env_settings.rb
|
447
|
+
- spec/support/models/hash_app_client.rb
|
437
448
|
- spec/support/models/hash_model.rb
|
438
449
|
- spec/support/models/hash_person.rb
|
450
|
+
- spec/support/models/hash_settable.rb
|
439
451
|
- spec/support/models/host_config.rb
|
440
452
|
- spec/support/models/http_json_model.rb
|
441
453
|
- spec/support/models/http_person.rb
|
442
454
|
- spec/support/models/human.rb
|
443
455
|
- spec/support/models/initial_valuer.rb
|
444
456
|
- spec/support/models/job.rb
|
457
|
+
- spec/support/models/json_env_settings.rb
|
445
458
|
- spec/support/models/login_config.rb
|
446
459
|
- spec/support/models/login_configurable.rb
|
447
460
|
- spec/support/models/math_caster.rb
|
461
|
+
- spec/support/models/math_env_settings.rb
|
448
462
|
- spec/support/models/my_app_client.rb
|
449
463
|
- spec/support/models/my_builder.rb
|
450
464
|
- spec/support/models/my_class.rb
|
@@ -453,6 +467,7 @@ files:
|
|
453
467
|
- spec/support/models/my_configurable.rb
|
454
468
|
- spec/support/models/my_model.rb
|
455
469
|
- spec/support/models/my_server_config.rb
|
470
|
+
- spec/support/models/non_default_app_client.rb
|
456
471
|
- spec/support/models/open_options.rb
|
457
472
|
- spec/support/models/person.rb
|
458
473
|
- spec/support/models/purchase.rb
|
@@ -465,13 +480,14 @@ files:
|
|
465
480
|
- spec/support/models/string_parser.rb
|
466
481
|
- spec/support/models/tv.rb
|
467
482
|
- spec/support/models/validator_builder.rb
|
483
|
+
- spec/support/models/yaml_file_settings.rb
|
468
484
|
- spec/support/shared_examples/attribute_accessor.rb
|
469
485
|
- spec/support/shared_examples/class_method_definition.rb
|
470
486
|
- spec/support/shared_examples/config.rb
|
471
487
|
- spec/support/shared_examples/config_factory.rb
|
472
|
-
- spec/support/shared_examples/env_settable.rb
|
473
488
|
- spec/support/shared_examples/instance_method_definition.rb
|
474
489
|
- spec/support/shared_examples/model.rb
|
490
|
+
- spec/support/shared_examples/settable.rb
|
475
491
|
- spec/support/shared_examples/sinclair.rb
|
476
492
|
homepage: https://github.com/darthjee/sinclair
|
477
493
|
licenses: []
|