Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ysbaddaden committed Mar 1, 2015
1 parent b01ae74 commit ada4e55
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 84 deletions.
39 changes: 0 additions & 39 deletions libexec/prax-install

This file was deleted.

33 changes: 0 additions & 33 deletions libexec/prax-uninstall

This file was deleted.

4 changes: 0 additions & 4 deletions src/prax.cr
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ module Prax
BUILD_DATE = {{ `date --utc +'%Y-%m-%d'`.stringify.chomp }}
#BUILD_REVISION = {{ `git rev-parse --short HEAD` }}

#HOSTS = ENV.fetch("PRAX_HOSTS", File.join(ENV["HOME"], ".prax"))
#LOGS = ENV.fetch("PRAX_LOGS", File.join(HOSTS, "_logs"))
#HTTP_PORT = ENV.fetch("PRAX_HTTP_PORT", 20559).to_i

class Error < Exception; end
class BadRequest < Error; end

Expand Down
18 changes: 10 additions & 8 deletions src/prax/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,33 @@ module Prax
@@logger_level ||= ENV.has_key?("PRAX_DEBUG") ? Logger::DEBUG : Logger::INFO
end

def self.logger_level=(level)
def self.logger_level=(level : Logger::Severity)
@@logger_level = level
end

def self.hosts_path
@@hosts_path ||= ENV.fetch("PRAX_HOSTS", File.join(ENV["HOME"], ".prax"))
@@hosts_path ||= ENV.fetch("PRAX_HOSTS", File.join(ENV["HOME"], ".prax")).tap do |path|
Dir.mkdir(path) unless Dir.exists?(path)
end
end

def self.hosts_path=(level)
@@hosts_path = level
def self.hosts_path=(path)
@@hosts_path = path
end

def self.logs_path
@@logs_path ||= ENV.fetch("PRAX_LOGS", File.join(hosts_path, "_logs"))
end

def self.logs_path=(level)
@@logs_path = level
def self.logs_path=(path)
@@logs_path = path
end

def self.http_port
@@http_port ||= ENV.fetch("PRAX_HTTP_PORT", 20559).to_i
end

def self.http_port=(level)
@@http_port = level
def self.http_port=(port)
@@http_port = port
end
end

0 comments on commit ada4e55

Please sign in to comment.