yade-common 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 526eb2936e6f41cd8a7466ce4474c6b59f8ef884cfb5c56ac36aefa1c03377d7
4
- data.tar.gz: e7d4523c64c7404c614e182c118452ae7825c9dc9b5b9da0904c7632f62ff0ac
3
+ metadata.gz: cb5038b4549d2b3b034b9c17e469e00ea5b1634ac64495a898fea160d9a1b837
4
+ data.tar.gz: 3aaff2d9027cdcacfc5808a37cc9b16999e90886295d2b28e3abdbfe91cc77c8
5
5
  SHA512:
6
- metadata.gz: e4a2deb5b2d4e2f26f44644fe327e420d07cf53a987b18d13108d7ddf39c8cfe6a3ac1e67107bb77d36a972748a54a0b9d28bcb70388d30a0aa33198f294e8fa
7
- data.tar.gz: 43f6c45d5e0ac94f6817f689a507f7c623b65bd33dee60423cfa25830bcac3a52f1ec25ca76fc299f790f783dd7041af2942639d8f91b518982ce7ac365005c2
6
+ metadata.gz: 91a5a0d560621be5427041da2b6cedaad6a0b02f0683f888bc108ee39c7ec7273f1f77bc902aa85b254ffc80095964fcfc5d8dd3a5defabe7459f08b552cd933
7
+ data.tar.gz: 8eee5f1501c0ba7dbb12159d709aabaa1be2295f0bf2175137129566a2a4a2026e7e981432437964feab39b57f3eac62b676a62ed6d20b029d3792dac16e6f91
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yade-common (0.1.1)
4
+ yade-common (0.1.2)
5
5
  activemodel (~> 5.2)
6
6
  httparty (~> 0.15)
7
7
  settingslogic (~> 2.0)
@@ -4,6 +4,7 @@ require 'yade/common/version'
4
4
 
5
5
  require 'yade/common/config/app_config'
6
6
  require 'yade/common/config/composer_config'
7
+ require 'yade/common/config/domain_config'
7
8
 
8
9
  require 'yade/common/model/authentication'
9
10
 
@@ -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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Yade
4
4
  module Common
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.2'
6
6
  end
7
7
  end
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.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-09 00:00:00.000000000 Z
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