qonfig 0.25.0 → 0.26.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -2
- data/.rubocop.yml +19 -1
- data/.travis.yml +7 -2
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +102 -0
- data/README.md +2 -0
- data/gemfiles/with_external_deps.gemfile.lock +112 -0
- data/gemfiles/without_external_deps.gemfile.lock +102 -0
- data/lib/qonfig.rb +1 -1
- data/lib/qonfig/commands/definition/load_from_env.rb +2 -0
- data/lib/qonfig/commands/definition/load_from_env/value_converter.rb +2 -0
- data/lib/qonfig/imports/direct_key.rb +8 -2
- data/lib/qonfig/imports/mappings.rb +8 -2
- data/lib/qonfig/loaders/basic.rb +2 -0
- data/lib/qonfig/loaders/json.rb +2 -1
- data/lib/qonfig/settings.rb +5 -1
- data/lib/qonfig/settings/key_matcher.rb +1 -1
- data/lib/qonfig/uploaders/base.rb +2 -0
- data/lib/qonfig/uploaders/yaml.rb +2 -0
- data/lib/qonfig/version.rb +1 -1
- data/qonfig.gemspec +4 -6
- data/sig/.keep +0 -0
- data/spec/features/clear_options_spec.rb +92 -0
- data/spec/features/compacted_config_spec.rb +308 -0
- data/spec/features/composition_spec.rb +207 -0
- data/spec/features/config_definition_and_representation_spec.rb +535 -0
- data/spec/features/definition_order_spec.rb +69 -0
- data/spec/features/dig_functionality_spec.rb +47 -0
- data/spec/features/dot_notation_spec.rb +159 -0
- data/spec/features/export_settings_spec.rb +138 -0
- data/spec/features/expose_json_spec.rb +281 -0
- data/spec/features/expose_self/format_option_dynamic_spec.rb +69 -0
- data/spec/features/expose_self/format_option_json_spec.rb +74 -0
- data/spec/features/expose_self/format_option_unsupported_spec.rb +27 -0
- data/spec/features/expose_self/format_option_yaml_spec.rb +77 -0
- data/spec/features/expose_self_spec.rb +97 -0
- data/spec/features/expose_yaml_spec.rb +263 -0
- data/spec/features/freeze_state_spec.rb +122 -0
- data/spec/features/get_config_keys_spec.rb +62 -0
- data/spec/features/get_config_values_spec.rb +41 -0
- data/spec/features/has_a_key_spec.rb +48 -0
- data/spec/features/import_settings_spec.rb +323 -0
- data/spec/features/indifferent_access_spec.rb +57 -0
- data/spec/features/inheritance_spec.rb +110 -0
- data/spec/features/instantiation_without_class_definition_spec.rb +59 -0
- data/spec/features/iteration_over_setting_keys_spec.rb +48 -0
- data/spec/features/load_from_env_spec.rb +240 -0
- data/spec/features/load_from_json_spec.rb +97 -0
- data/spec/features/load_from_self/format_option_json_spec.rb +31 -0
- data/spec/features/load_from_self/format_option_unsupported_spec.rb +27 -0
- data/spec/features/load_from_self/format_option_yaml_spec.rb +49 -0
- data/spec/features/load_from_self/with_erb_instructions_spec.rb +33 -0
- data/spec/features/load_from_self/with_hash_like_data_representation_spec.rb +66 -0
- data/spec/features/load_from_self/with_non_hash_like_data_representation_spec.rb +19 -0
- data/spec/features/load_from_self/without_end_data_spec.rb +11 -0
- data/spec/features/load_from_yaml_spec.rb +110 -0
- data/spec/features/load_setting_values_from_file/by_instance_method_examples.rb +171 -0
- data/spec/features/load_setting_values_from_file/by_macros_examples.rb +165 -0
- data/spec/features/load_setting_values_from_file/load_from_json_spec.rb +21 -0
- data/spec/features/load_setting_values_from_file/load_from_self/json_format/end_data_with_env_spec.rb +100 -0
- data/spec/features/load_setting_values_from_file/load_from_self/json_format/with_end_data_spec.rb +129 -0
- data/spec/features/load_setting_values_from_file/load_from_self/json_format/with_incorrect_end_data_spec.rb +34 -0
- data/spec/features/load_setting_values_from_file/load_from_self/json_format/without_end_data_spec.rb +65 -0
- data/spec/features/load_setting_values_from_file/load_from_self/yaml_format/end_data_with_env_spec.rb +94 -0
- data/spec/features/load_setting_values_from_file/load_from_self/yaml_format/with_end_data_spec.rb +126 -0
- data/spec/features/load_setting_values_from_file/load_from_self/yaml_format/with_incorrect_end_data_spec.rb +32 -0
- data/spec/features/load_setting_values_from_file/load_from_self/yaml_format/without_end_data_spec.rb +65 -0
- data/spec/features/load_setting_values_from_file/load_from_yaml_spec.rb +21 -0
- data/spec/features/load_setting_values_from_file/shared_behavior_spec.rb +33 -0
- data/spec/features/mixin_spec.rb +387 -0
- data/spec/features/non_redefineable_core_methods_spec.rb +29 -0
- data/spec/features/plugins/pretty_print_spec.rb +86 -0
- data/spec/features/plugins/toml/expose_self/format_option_toml_spec.rb +71 -0
- data/spec/features/plugins/toml/expose_toml_spec.rb +221 -0
- data/spec/features/plugins/toml/load_from_self/format_option_toml_spec.rb +27 -0
- data/spec/features/plugins/toml/load_from_toml_spec.rb +109 -0
- data/spec/features/plugins/toml/load_setting_values_from_file/load_from_toml_spec.rb +27 -0
- data/spec/features/plugins/toml/load_setting_values_from_file/load_toml_from_self/end_data_with_env_spec.rb +95 -0
- data/spec/features/plugins/toml/load_setting_values_from_file/load_toml_from_self/with_end_data_spec.rb +125 -0
- data/spec/features/plugins/toml/load_setting_values_from_file/load_toml_from_self/with_incorrect_end_data_spec.rb +34 -0
- data/spec/features/plugins/toml/load_setting_values_from_file/load_toml_from_self/without_end_data_spec.rb +65 -0
- data/spec/features/plugins/toml/load_setting_values_from_file/shared_behavior_spec.rb +34 -0
- data/spec/features/plugins/toml/save_to_toml_spec.rb +149 -0
- data/spec/features/plugins/vault/expose_vault_spec.rb +117 -0
- data/spec/features/plugins/vault/load_from_vault_spec.rb +80 -0
- data/spec/features/plugins_spec.rb +89 -0
- data/spec/features/reload_spec.rb +75 -0
- data/spec/features/run_code_with_temporary_settings_spec.rb +104 -0
- data/spec/features/save_to_file/save_to_json_spec.rb +157 -0
- data/spec/features/save_to_file/save_to_yaml_spec.rb +189 -0
- data/spec/features/settings_as_predicates_spec.rb +47 -0
- data/spec/features/settings_redefinition_spec.rb +30 -0
- data/spec/features/slice_functionality_spec.rb +69 -0
- data/spec/features/subset_functionality_spec.rb +49 -0
- data/spec/features/validation_spec.rb +916 -0
- data/spec/fixtures/array_settings.yml +3 -0
- data/spec/fixtures/expose_json/incompatible_root_structure.json +6 -0
- data/spec/fixtures/expose_json/incompatible_structure.json +4 -0
- data/spec/fixtures/expose_json/project.development.json +7 -0
- data/spec/fixtures/expose_json/project.json +30 -0
- data/spec/fixtures/expose_json/project.production.json +7 -0
- data/spec/fixtures/expose_json/project.staging.json +7 -0
- data/spec/fixtures/expose_json/project.test.json +7 -0
- data/spec/fixtures/expose_yaml/incompatible_structure.yml +2 -0
- data/spec/fixtures/expose_yaml/project.development.yml +4 -0
- data/spec/fixtures/expose_yaml/project.production.yml +4 -0
- data/spec/fixtures/expose_yaml/project.staging.yml +4 -0
- data/spec/fixtures/expose_yaml/project.test.yml +4 -0
- data/spec/fixtures/expose_yaml/project.yml +25 -0
- data/spec/fixtures/json_array_sample.json +14 -0
- data/spec/fixtures/json_object_sample.json +9 -0
- data/spec/fixtures/json_with_empty_object.json +6 -0
- data/spec/fixtures/json_with_erb.json +6 -0
- data/spec/fixtures/plugins/toml/expose_toml/project.development.toml +4 -0
- data/spec/fixtures/plugins/toml/expose_toml/project.production.toml +4 -0
- data/spec/fixtures/plugins/toml/expose_toml/project.staging.toml +4 -0
- data/spec/fixtures/plugins/toml/expose_toml/project.test.toml +4 -0
- data/spec/fixtures/plugins/toml/expose_toml/project.toml +27 -0
- data/spec/fixtures/plugins/toml/mini_file.toml +6 -0
- data/spec/fixtures/plugins/toml/toml_sample_with_all_types.toml +72 -0
- data/spec/fixtures/plugins/toml/values_file/with_env.toml +13 -0
- data/spec/fixtures/plugins/toml/values_file/without_env.toml +6 -0
- data/spec/fixtures/rubocop_settings.yml +12 -0
- data/spec/fixtures/shared_settings_with_aliases.yml +10 -0
- data/spec/fixtures/travis_settings.yml +6 -0
- data/spec/fixtures/values_file/with_env.json +19 -0
- data/spec/fixtures/values_file/with_env.yml +17 -0
- data/spec/fixtures/values_file/without_env.json +8 -0
- data/spec/fixtures/values_file/without_env.yml +5 -0
- data/spec/fixtures/with_empty_hash.yml +4 -0
- data/spec/fixtures/with_erb_instructions.yml +3 -0
- data/spec/spec_helper.rb +27 -0
- data/spec/support/meta_scopes.rb +20 -0
- data/spec/support/spec_support.rb +42 -0
- metadata +128 -11
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"development": {
|
3
|
+
"api_mode_enabled": true,
|
4
|
+
"logging": false,
|
5
|
+
"db_driver": "sequel",
|
6
|
+
"throttle_requests": false,
|
7
|
+
"credentials": {}
|
8
|
+
},
|
9
|
+
"test": {
|
10
|
+
"api_mode_enabled": true,
|
11
|
+
"logging": false,
|
12
|
+
"db_driver": "in_memory",
|
13
|
+
"throttle_requests": false,
|
14
|
+
"credentials": {}
|
15
|
+
},
|
16
|
+
"staging": {
|
17
|
+
"api_mode_enabled": true,
|
18
|
+
"logging": true,
|
19
|
+
"db_driver": "active_record",
|
20
|
+
"throttle_requests": true,
|
21
|
+
"credentials": {}
|
22
|
+
},
|
23
|
+
"production": {
|
24
|
+
"api_mode_enabled": true,
|
25
|
+
"logging": true,
|
26
|
+
"db_driver": "rom",
|
27
|
+
"throttle_requests": true,
|
28
|
+
"credentials": {}
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
default: &default
|
2
|
+
api_mode_enabled: true
|
3
|
+
logging: true
|
4
|
+
db_driver: in_memory
|
5
|
+
throttle_requests: false
|
6
|
+
credentials: {}
|
7
|
+
|
8
|
+
development:
|
9
|
+
<<: *default
|
10
|
+
db_driver: sequel
|
11
|
+
logging: false
|
12
|
+
|
13
|
+
test:
|
14
|
+
<<: *default
|
15
|
+
logging: false
|
16
|
+
|
17
|
+
staging:
|
18
|
+
<<: *default
|
19
|
+
db_driver: active_record
|
20
|
+
throttle_requests: true
|
21
|
+
|
22
|
+
production:
|
23
|
+
<<: *default
|
24
|
+
db_driver: rom
|
25
|
+
throttle_requests: true
|
@@ -0,0 +1,27 @@
|
|
1
|
+
[development]
|
2
|
+
api_mode_enabled = true
|
3
|
+
logging = false
|
4
|
+
db_driver = 'sequel'
|
5
|
+
throttle_requests = false
|
6
|
+
[development.credentials]
|
7
|
+
|
8
|
+
[test]
|
9
|
+
api_mode_enabled = true
|
10
|
+
logging = false
|
11
|
+
db_driver = 'in_memory'
|
12
|
+
throttle_requests = false
|
13
|
+
[test.credentials]
|
14
|
+
|
15
|
+
[staging]
|
16
|
+
api_mode_enabled = true
|
17
|
+
logging = true
|
18
|
+
db_driver = 'active_record'
|
19
|
+
throttle_requests = true
|
20
|
+
[staging.credentials]
|
21
|
+
|
22
|
+
[production]
|
23
|
+
api_mode_enabled = true
|
24
|
+
logging = true
|
25
|
+
db_driver = 'rom'
|
26
|
+
throttle_requests = true
|
27
|
+
[production.credentials]
|
@@ -0,0 +1,72 @@
|
|
1
|
+
key_in_air = "TOML Example"
|
2
|
+
|
3
|
+
inline_table_of_tables = [
|
4
|
+
{ x = 1, y = 2, z = 3 },
|
5
|
+
{ x = 7, y = 8, z = 9 },
|
6
|
+
{ x = 2, y = 4, z = 8 }
|
7
|
+
]
|
8
|
+
|
9
|
+
[strings]
|
10
|
+
simple_string = "Simple String"
|
11
|
+
first_multi_line_string = """
|
12
|
+
first multiline
|
13
|
+
string defined"""
|
14
|
+
second_multiline_string = '''
|
15
|
+
second multiline
|
16
|
+
string defined
|
17
|
+
'''
|
18
|
+
|
19
|
+
[times]
|
20
|
+
first_format = 1979-05-27T07:32:00Z
|
21
|
+
second_format = 1979-05-27T00:32:00-07:00
|
22
|
+
third_format = 1979-05-27T00:32:00.999999-07:00
|
23
|
+
|
24
|
+
[arrays]
|
25
|
+
array_of_integers = [ 1, 2, 3 ]
|
26
|
+
array_of_strings = [ "a", "b", "c" ]
|
27
|
+
array_of_integer_arrays = [ [ 1, 2 ], [3, 4, 5] ]
|
28
|
+
array_of_different_string_literals = [ "azaza", 'trazaza', """kek""", '''pek''']
|
29
|
+
array_of_multityped_arrays = [ [ 1, 2 ], ["a", "b", "c"] ]
|
30
|
+
multyline_array = [
|
31
|
+
"super",
|
32
|
+
"puper"
|
33
|
+
]
|
34
|
+
|
35
|
+
[number_definitions]
|
36
|
+
number_with_parts = [ 8_001, 8_001, 8_002 ]
|
37
|
+
number_with_idiot_parts = 5_0_0_0
|
38
|
+
simple_float = 3.12138
|
39
|
+
epic_float = 5e+22
|
40
|
+
haha_float = 1e6
|
41
|
+
wow_float = -2E-2
|
42
|
+
|
43
|
+
[booleans]
|
44
|
+
boolean_true = true
|
45
|
+
boolean_false = false
|
46
|
+
|
47
|
+
[nesteds]
|
48
|
+
[nesteds.first]
|
49
|
+
ip = "10.0.0.1"
|
50
|
+
host = "google.sru"
|
51
|
+
[nesteds.second]
|
52
|
+
ip = "10.0.0.2"
|
53
|
+
host = "poogle.fru"
|
54
|
+
|
55
|
+
[[deep_nesteds]]
|
56
|
+
name = "apple"
|
57
|
+
|
58
|
+
[deep_nesteds.first]
|
59
|
+
model = "iphone xs"
|
60
|
+
color = "white"
|
61
|
+
|
62
|
+
[[deep_nesteds.second]]
|
63
|
+
model = "iphone x"
|
64
|
+
|
65
|
+
[[deep_nesteds.third]]
|
66
|
+
model = "iphone se"
|
67
|
+
|
68
|
+
[[deep_nesteds]]
|
69
|
+
name = "xiaomi"
|
70
|
+
|
71
|
+
[[deep_nesteds.fourth]]
|
72
|
+
model = "mi8 explorer edition"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"test": {
|
3
|
+
"enabled": false,
|
4
|
+
"adapter": "sidekiq",
|
5
|
+
"credentials": {
|
6
|
+
"user": "D@iVeR",
|
7
|
+
"timeout": 321
|
8
|
+
}
|
9
|
+
},
|
10
|
+
|
11
|
+
"production": {
|
12
|
+
"enabled": true,
|
13
|
+
"adapter": "que",
|
14
|
+
"credentials": {
|
15
|
+
"user": "0exp",
|
16
|
+
"timeout": 123
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|