Sha256: 2e3d3c05d2fb9918025f459eb33eaa773842819f883f8f9eff9c89443aa436be

Contents?: true

Size: 1.1 KB

Versions: 6

Compression:

Stored size: 1.1 KB

Contents

module ConfigmonkeyCli
  class Application
    class Configuration
      module AppHelper
        def cm_cfg_path
          ENV["CM_CFGDIR"].presence || File.expand_path("~/.configmonkey")
        end

        def cm_cfg_configfile
          "#{cm_cfg_path}/config.rb"
        end

        def load_appconfig
          return unless File.exist?(cm_cfg_configfile)
          eval File.read(cm_cfg_configfile, encoding: "utf-8"), binding, cm_cfg_configfile
        end

        def generate_manifest directory
          #FileUtils.mkdir_p(config_directory)
          #File.open(config_filename(name), "w", encoding: "utf-8") do |f|
          #  f << File.read("#{File.dirname(__FILE__)}/configuration.tpl", encoding: "utf-8")
          #end
        end

        def load_and_execute_manifest
          manifest = Manifest.new(self, File.realpath(File.expand_path(opts[:working_directory])), @argv[0])
          if opts[:dev_dump_actions]
            manifest._dump!
          elsif opts[:simulation]
            manifest._simulate!
          else
            manifest._execute!
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
configmonkey_cli-1.0.5 lib/configmonkey_cli/application/configuration.rb
configmonkey_cli-1.0.4 lib/configmonkey_cli/application/configuration.rb
configmonkey_cli-1.0.3 lib/configmonkey_cli/application/configuration.rb
configmonkey_cli-1.0.2 lib/configmonkey_cli/application/configuration.rb
configmonkey_cli-1.0.1 lib/configmonkey_cli/application/configuration.rb
configmonkey_cli-1.0.0 lib/configmonkey_cli/application/configuration.rb