class Yade::Common::Config::AppConfig

Attributes

config_path[RW]
project_home[RW]
yade_home[RW]

Public Class Methods

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

  super
end
load!() click to toggle source
Calls superclass method
# File lib/yade/common/config/app_config.rb, line 20
        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-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-config%2Eyml%2Eexample/raw?ref=master' \
   -o yade-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/app_config.rb, line 41
def self.no_config_file?
  !File.exists?(@source)
end
write!() click to toggle source
# File lib/yade/common/config/app_config.rb, line 55
def self.write!
  d = YAML.load_file(@@config_path)

  d['yade_url'] = self.yade_url

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