legion-settings 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +24 -24
- data/CHANGELOG.md +5 -0
- data/README.md +14 -1
- data/legion-settings.gemspec +1 -1
- data/lib/legion/settings.rb +2 -4
- data/lib/legion/settings/loader.rb +12 -8
- data/lib/legion/settings/version.rb +1 -1
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1e632a79686eed42021f36c2d95cafea8c963bd8afac3ca62cc3eb78eb75557a
|
4
|
+
data.tar.gz: 92d444574391b074f13d1bf46f7397fc1db204d98121289dba836a6c3e624a0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30a526f2b17b1411df5bf07c317e78b8951f0c8b687d0eddc139c901b77782163c06859f516780f1d2dde862e1c96846dedbe1c250b895dc4daf413e69f69177
|
7
|
+
data.tar.gz: 8b2675306320ac65631849e9e6ba3a39f3e751c1e110e62bf55b576485dfc1b44d8de5276bbc7caaddd1c5e65ef5c44e9802d66f5e47f751d12029a86dca470a
|
data/.circleci/config.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
version: 2 # use CircleCI 2.0
|
1
|
+
version: 2.1 # use CircleCI 2.0
|
2
2
|
jobs:
|
3
3
|
"rubocop":
|
4
4
|
docker:
|
@@ -11,7 +11,7 @@ jobs:
|
|
11
11
|
command: rubocop
|
12
12
|
- store_test_results:
|
13
13
|
path: test_results
|
14
|
-
"ruby-
|
14
|
+
"ruby-two-zero":
|
15
15
|
docker:
|
16
16
|
- image: circleci/ruby:2.0
|
17
17
|
steps:
|
@@ -25,7 +25,7 @@ jobs:
|
|
25
25
|
when: always
|
26
26
|
- store_test_results:
|
27
27
|
path: test-results
|
28
|
-
"ruby-
|
28
|
+
"ruby-two-one":
|
29
29
|
docker:
|
30
30
|
- image: circleci/ruby:2.1
|
31
31
|
steps:
|
@@ -39,7 +39,7 @@ jobs:
|
|
39
39
|
when: always
|
40
40
|
- store_test_results:
|
41
41
|
path: test-results
|
42
|
-
"ruby-
|
42
|
+
"ruby-two-two":
|
43
43
|
docker:
|
44
44
|
- image: circleci/ruby:2.2
|
45
45
|
steps:
|
@@ -54,7 +54,7 @@ jobs:
|
|
54
54
|
- store_test_results:
|
55
55
|
path: test-results
|
56
56
|
|
57
|
-
"ruby-
|
57
|
+
"ruby-two-three":
|
58
58
|
docker:
|
59
59
|
- image: circleci/ruby:2.3
|
60
60
|
steps:
|
@@ -69,7 +69,7 @@ jobs:
|
|
69
69
|
- store_test_results:
|
70
70
|
path: test-results
|
71
71
|
|
72
|
-
"ruby-
|
72
|
+
"ruby-two-four":
|
73
73
|
docker:
|
74
74
|
- image: circleci/ruby:2.4-node
|
75
75
|
steps:
|
@@ -83,7 +83,7 @@ jobs:
|
|
83
83
|
when: always
|
84
84
|
- store_test_results:
|
85
85
|
path: test-results
|
86
|
-
"ruby-
|
86
|
+
"ruby-two-five":
|
87
87
|
docker:
|
88
88
|
- image: circleci/ruby:2.5-node
|
89
89
|
steps:
|
@@ -97,7 +97,7 @@ jobs:
|
|
97
97
|
when: always
|
98
98
|
- store_test_results:
|
99
99
|
path: test-results
|
100
|
-
"ruby-
|
100
|
+
"ruby-two-six":
|
101
101
|
docker:
|
102
102
|
- image: circleci/ruby:2.6-node
|
103
103
|
steps:
|
@@ -111,7 +111,7 @@ jobs:
|
|
111
111
|
when: always
|
112
112
|
- store_test_results:
|
113
113
|
path: test-results
|
114
|
-
"jruby-
|
114
|
+
"jruby-nine-two":
|
115
115
|
docker:
|
116
116
|
- image: circleci/jruby:9.2
|
117
117
|
steps:
|
@@ -131,37 +131,37 @@ workflows:
|
|
131
131
|
cop_rake_deploy:
|
132
132
|
jobs:
|
133
133
|
- rubocop
|
134
|
-
# - ruby-
|
134
|
+
# - ruby-two-two:
|
135
135
|
# requires:
|
136
|
-
# - ruby-
|
136
|
+
# - ruby-two-four
|
137
137
|
# filters:
|
138
138
|
# branches:
|
139
139
|
# only: /\bdevelop\b|\bmaster\b/
|
140
|
-
- ruby-
|
140
|
+
- ruby-two-three:
|
141
141
|
requires:
|
142
|
-
- ruby-
|
142
|
+
- ruby-two-four
|
143
143
|
filters:
|
144
144
|
branches:
|
145
145
|
only: /\bdevelop\b|\bmaster\b/
|
146
|
-
- ruby-
|
146
|
+
- ruby-two-four:
|
147
147
|
requires:
|
148
148
|
- rubocop
|
149
|
-
- ruby-
|
149
|
+
- ruby-two-five:
|
150
150
|
requires:
|
151
|
-
- ruby-
|
151
|
+
- ruby-two-four
|
152
152
|
filters:
|
153
153
|
branches:
|
154
154
|
only: /\bdevelop\b|\bmaster\b/
|
155
|
-
- ruby-
|
155
|
+
- ruby-two-six:
|
156
156
|
requires:
|
157
|
-
- ruby-
|
157
|
+
- ruby-two-four
|
158
158
|
filters:
|
159
159
|
branches:
|
160
160
|
only: /\bdevelop\b|\bmaster\b/
|
161
|
-
# - jruby-
|
161
|
+
# - jruby-nine-two:
|
162
162
|
# requires:
|
163
|
-
# - ruby-
|
164
|
-
# - ruby-
|
165
|
-
# - ruby-
|
166
|
-
# - ruby-
|
167
|
-
# - ruby-
|
163
|
+
# - ruby-two-two
|
164
|
+
# - ruby-two-three
|
165
|
+
# - ruby-two-four
|
166
|
+
# - ruby-two-five
|
167
|
+
# - ruby-two-six
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -2,7 +2,20 @@
|
|
2
2
|
|
3
3
|
Legion::Settings is part of the Legion Framework
|
4
4
|
|
5
|
-
|
5
|
+
###Badges
|
6
|
+
####CICD
|
7
|
+
| | License | CircleCI | CodeCov | CodeBeat |
|
8
|
+
|---------|---------|----------|---------|----------|
|
9
|
+
| Master |[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)|[![CircleCI](https://circleci.com/bb/legion-io/legion-settings/tree/master.svg?style=svg)](https://circleci.com/bb/legion-io/legion-settings/tree/master)|[![codecov](https://codecov.io/bb/legion-io/legion-settings/branch/master/graph/badge.svg)](https://codecov.io/bb/legion-io/legion-settings)|[![codebeat badge](https://codebeat.co/badges/e86dbe3e-b463-4f3c-91a8-c85492fd3833)](https://codebeat.co/projects/bitbucket-org-legion-io-legion-settings-master)|
|
10
|
+
| Develop |[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)|[![CircleCI](https://circleci.com/bb/legion-io/legion-settings/tree/develop.svg?style=svg)](https://circleci.com/bb/legion-io/legion-settings/tree/develop)|[![codecov](https://codecov.io/bb/legion-io/legion-settings/branch/develop/graph/badge.svg)](https://codecov.io/bb/legion-io/legion-settings)|[![codebeat badge](https://codebeat.co/badges/e86dbe3e-b463-4f3c-91a8-c85492fd3833)](https://codebeat.co/projects/bitbucket-org-legion-io-legion-settings-develop)|
|
11
|
+
|
12
|
+
#####RubyGems
|
13
|
+
![](https://ruby-gem-downloads-badge.herokuapp.com/legion-settings)
|
14
|
+
[![Gem Version](https://badge.fury.io/rb/legion-settings.svg)](https://badge.fury.io/rb/legion-settings)
|
15
|
+
|
16
|
+
#####Bitbucket
|
17
|
+
![](https://img.shields.io/bitbucket/issues-raw/legion-io/legion-settings.svg)
|
18
|
+
![](https://img.shields.io/bitbucket/pr-raw/legion-io/legion-settings.svg)
|
6
19
|
## Installation
|
7
20
|
|
8
21
|
Add this line to your application's Gemfile:
|
data/legion-settings.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
23
|
spec.add_development_dependency 'bundler', '~> 1'
|
24
|
-
spec.add_development_dependency 'codecov', '~> 0'
|
24
|
+
# spec.add_development_dependency 'codecov', '~> 0'
|
25
25
|
spec.add_development_dependency 'rake', '~> 10.0'
|
26
26
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
27
27
|
spec.add_development_dependency 'rspec_junit_formatter', '~> 0'
|
data/lib/legion/settings.rb
CHANGED
@@ -4,9 +4,7 @@ require 'legion/json/parse_error'
|
|
4
4
|
require 'legion/settings/loader'
|
5
5
|
|
6
6
|
module Legion
|
7
|
-
# Base Legion::Settings module
|
8
7
|
module Settings
|
9
|
-
# Base settings, needs to be refactored
|
10
8
|
class << self
|
11
9
|
attr_accessor :loader
|
12
10
|
def load(options = {})
|
@@ -25,13 +23,13 @@ module Legion
|
|
25
23
|
end
|
26
24
|
|
27
25
|
def [](key)
|
28
|
-
Legion::Logging.
|
26
|
+
Legion::Logging.info('Legion::Settings was not loading, auto loading now!') if @loader.nil?
|
29
27
|
@loader = load if @loader.nil?
|
30
28
|
@loader[key]
|
31
29
|
end
|
32
30
|
|
33
31
|
def set_prop(key, value)
|
34
|
-
Legion::Logging.
|
32
|
+
Legion::Logging.info('Legion::Settings was not loading, auto loading now!') if @loader.nil?
|
35
33
|
@loader = load if @loader.nil?
|
36
34
|
@loader[key] = value
|
37
35
|
end
|
@@ -25,13 +25,14 @@ module Legion
|
|
25
25
|
}
|
26
26
|
end
|
27
27
|
|
28
|
-
def default_settings
|
28
|
+
def default_settings # rubocop:disable Metrics/MethodLength
|
29
29
|
default = {
|
30
30
|
client: {},
|
31
31
|
legion: {
|
32
|
-
spawn:
|
32
|
+
spawn: {
|
33
33
|
limit: 12
|
34
|
-
}
|
34
|
+
},
|
35
|
+
extensions: {}
|
35
36
|
},
|
36
37
|
transport: {
|
37
38
|
rabbitmq: {
|
@@ -41,14 +42,17 @@ module Legion
|
|
41
42
|
}
|
42
43
|
},
|
43
44
|
data: {
|
44
|
-
mysql:
|
45
|
+
mysql: {
|
45
46
|
user: 'legion',
|
46
47
|
password: 'legion',
|
47
48
|
max_connections: 20,
|
48
49
|
database: 'legion',
|
49
50
|
host: '127.0.0.1',
|
50
51
|
debug: false
|
51
|
-
}
|
52
|
+
},
|
53
|
+
models: {},
|
54
|
+
connection: {},
|
55
|
+
migrations: { continue_on_fail: false }
|
52
56
|
}
|
53
57
|
}
|
54
58
|
default[:client] = client_defaults if %w[client rspec].include?(legion_service_name)
|
@@ -99,7 +103,7 @@ module Legion
|
|
99
103
|
load_api_env
|
100
104
|
end
|
101
105
|
|
102
|
-
def load_file(file)
|
106
|
+
def load_file(file) # rubocop:disable Metrics/AbcSize
|
103
107
|
Legion::Logging.debug("Trying to load file #{file}")
|
104
108
|
if File.file?(file) && File.readable?(file)
|
105
109
|
begin
|
@@ -110,9 +114,9 @@ module Legion
|
|
110
114
|
@settings = merged
|
111
115
|
# @indifferent_access = false
|
112
116
|
@loaded_files << file
|
113
|
-
rescue Legion::JSON::ParseError =>
|
117
|
+
rescue Legion::JSON::ParseError => e
|
114
118
|
Legion::Logging.error('config file must be valid json')
|
115
|
-
Legion::Logging.debug("file:#{file}, error: #{
|
119
|
+
Legion::Logging.debug("file:#{file}, error: #{e}")
|
116
120
|
end
|
117
121
|
else
|
118
122
|
Legion::Logging.warn("Config file does not exist or is not readable file:#{file}")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: legion-settings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esity
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: codecov
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rake
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,6 +104,7 @@ files:
|
|
118
104
|
- ".circleci/config.yml"
|
119
105
|
- ".gitignore"
|
120
106
|
- ".rubocop.yml"
|
107
|
+
- CHANGELOG.md
|
121
108
|
- Gemfile
|
122
109
|
- LICENSE.txt
|
123
110
|
- README.md
|
@@ -153,8 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
140
|
- !ruby/object:Gem::Version
|
154
141
|
version: '0'
|
155
142
|
requirements: []
|
156
|
-
|
157
|
-
rubygems_version: 2.6.14
|
143
|
+
rubygems_version: 3.0.3
|
158
144
|
signing_key:
|
159
145
|
specification_version: 4
|
160
146
|
summary: Used to load the json settings files
|