class Yade::Common::Config::DomainConfig

Attributes

config_path[RW]
yade_home[RW]

Public Class Methods

[](key) click to toggle source
Calls superclass method
# File lib/yade/common/config/domain_config.rb, line 45
def self.[](key)
  return @@yade_home if key == :yade_home
  return @@config_path if key == :config_path

  super
end
load!() click to toggle source
Calls superclass method
# File lib/yade/common/config/domain_config.rb, line 18
        def self.load!
          if no_config_file?
            $stderr.puts <<-HELP
******** You haven't set up your Yade settings file. **********
Please do the following:
1. Create the yade base directory and download the yade-domain-config.yml example:
mkdir -p ~/.yade
cd ~/.yade
curl --header 'PRIVATE-TOKEN: <your token>' \
   'http://gitlab.dzbw.de/client/v4/projects/366/repository/files/yade-domain-config%2Eyml%2Eexample/raw?ref=master' \
   -o yade-domain-config.yml
2. Have a look at the settings in that file and change it according to your needs.
            HELP
            Process.exit(1)
          end

          super

        end
no_config_file?() click to toggle source

no config

# File lib/yade/common/config/domain_config.rb, line 39
def self.no_config_file?
  !File.exists?(@source)
end
write!() click to toggle source
# File lib/yade/common/config/domain_config.rb, line 52
def self.write!
  d = YAML.load_file(@@config_path)

  d['yade_bootstrap_repo_url'] = self.yade_bootstrap_repo_url
  d['yade_bootstrap_repo_branch'] = self.yade_bootstrap_repo_branch
  d['yade_bootstrap_puppet_modules'] = self.yade_bootstrap_puppet_modules

  File.open(@@config_path, 'w') { |f| f.write d.to_yaml }
end