yade-common 0.1.1 → 0.1.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/yade/common/common.rb +1 -0
- data/lib/yade/common/config/domain_config.rb +65 -0
- data/lib/yade/common/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb5038b4549d2b3b034b9c17e469e00ea5b1634ac64495a898fea160d9a1b837
|
4
|
+
data.tar.gz: 3aaff2d9027cdcacfc5808a37cc9b16999e90886295d2b28e3abdbfe91cc77c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91a5a0d560621be5427041da2b6cedaad6a0b02f0683f888bc108ee39c7ec7273f1f77bc902aa85b254ffc80095964fcfc5d8dd3a5defabe7459f08b552cd933
|
7
|
+
data.tar.gz: 8eee5f1501c0ba7dbb12159d709aabaa1be2295f0bf2175137129566a2a4a2026e7e981432437964feab39b57f3eac62b676a62ed6d20b029d3792dac16e6f91
|
data/Gemfile.lock
CHANGED
data/lib/yade/common/common.rb
CHANGED
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'settingslogic'
|
4
|
+
|
5
|
+
module Yade
|
6
|
+
module Common
|
7
|
+
module Config
|
8
|
+
class DomainConfig < Settingslogic
|
9
|
+
@@yade_home = File.join(File.expand_path('~'), '.yade')
|
10
|
+
@@config_path = File.join(@@yade_home, 'yade-domain-config.yml')
|
11
|
+
|
12
|
+
source File.join(@@config_path)
|
13
|
+
|
14
|
+
class << self
|
15
|
+
attr_accessor :yade_home, :config_path
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.load!
|
19
|
+
if no_config_file?
|
20
|
+
$stderr.puts <<-HELP
|
21
|
+
******** You haven't set up your Yade settings file. **********
|
22
|
+
Please do the following:
|
23
|
+
1. Create the yade base directory and download the yade-domain-config.yml example:
|
24
|
+
mkdir -p ~/.yade
|
25
|
+
cd ~/.yade
|
26
|
+
curl --header 'PRIVATE-TOKEN: <your token>' \
|
27
|
+
'http://gitlab.dzbw.de/client/v4/projects/366/repository/files/yade-domain-config%2Eyml%2Eexample/raw?ref=master' \
|
28
|
+
-o yade-domain-config.yml
|
29
|
+
2. Have a look at the settings in that file and change it according to your needs.
|
30
|
+
HELP
|
31
|
+
Process.exit(1)
|
32
|
+
end
|
33
|
+
|
34
|
+
super
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
# no config
|
39
|
+
def self.no_config_file?
|
40
|
+
!File.exists?(@source)
|
41
|
+
end
|
42
|
+
|
43
|
+
load!
|
44
|
+
|
45
|
+
def self.[](key)
|
46
|
+
return @@yade_home if key == :yade_home
|
47
|
+
return @@config_path if key == :config_path
|
48
|
+
|
49
|
+
super
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.write!
|
53
|
+
d = YAML.load_file(@@config_path)
|
54
|
+
|
55
|
+
d['yade_bootstrap_repo_url'] = self.yade_bootstrap_repo_url
|
56
|
+
d['yade_bootstrap_repo_branch'] = self.yade_bootstrap_repo_branch
|
57
|
+
d['yade_bootstrap_puppet_modules'] = self.yade_bootstrap_puppet_modules
|
58
|
+
|
59
|
+
File.open(@@config_path, 'w') { |f| f.write d.to_yaml }
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
data/lib/yade/common/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yade-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Freund
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: settingslogic
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- lib/yade/common/common.rb
|
146
146
|
- lib/yade/common/config/app_config.rb
|
147
147
|
- lib/yade/common/config/composer_config.rb
|
148
|
+
- lib/yade/common/config/domain_config.rb
|
148
149
|
- lib/yade/common/model/authentication.rb
|
149
150
|
- lib/yade/common/service/base_service.rb
|
150
151
|
- lib/yade/common/version.rb
|