Sha256: 17595a63504858217bf639b1af63da4929d47d9b0c5f59f46c1cd5f62c5a1edd

Contents?: true

Size: 420 Bytes

Versions: 7

Compression:

Stored size: 420 Bytes

Contents

module Understudy
  module Stage
    DEFAULT_DIRECTORY = '/etc/understudy/'

    class << self
      def setup(directory = nil)
        config_dir = directory ||= DEFAULT_DIRECTORY

        hostname = `hostname`
        config_file = File.join(config_dir, "#{hostname.chomp}.config")

        FileUtils.mkdir_p(config_dir) unless File.exists?(config_dir)
        FileUtils.touch(config_file)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
understudy-0.0.9 lib/understudy/stage.rb
understudy-0.0.8 lib/understudy/stage.rb
understudy-0.0.7 lib/understudy/stage.rb
understudy-0.0.6 lib/understudy/stage.rb
understudy-0.0.5 lib/understudy/stage.rb
understudy-0.0.4 lib/understudy/stage.rb
understudy-0.0.3 lib/understudy/stage.rb