Skip to content

Commit

Permalink
Moved configs around
Browse files Browse the repository at this point in the history
  • Loading branch information
crawford committed Jul 19, 2011
1 parent efece20 commit e462e4d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
File renamed without changes.
8 changes: 5 additions & 3 deletions software/config/deploy.rb → config/deploy.rb
Expand Up @@ -13,8 +13,10 @@

namespace :deploy do
task :fix_directories, :roles => :app do
run "mkdir /tmp/gatekeeper"
run "mv #{release_path}/software/* /tmp/gatekeeper/"
run "mkdir -p /tmp/gatekeeper/service"
run "mkdir -p /tmp/gatekeeper/site"
run "mv #{release_path}/software/* /tmp/gatekeeper/service"
run "mv #{release_path}/site/* /tmp/gatekeeper/site"
run "rm -rf #{release_path}/*"
run "rm -rf #{release_path}/.git"
run "rm -f #{release_path}/.gitignore"
Expand All @@ -23,7 +25,7 @@
end

task :copy_config, :roles => :app do
run "cp #{shared_path}/config.yml #{release_path}/config.yml"
run "cp #{shared_path}/database.yml #{release_path}/service/config/database.yml"
end
end

Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion software/servers/api_server.rb
@@ -1,4 +1,5 @@
require 'mysql2'
require 'json'
require 'user'

module Gatekeeper
Expand Down Expand Up @@ -64,7 +65,7 @@ def initialize(config)
# - Door State

def fetch_all_doors
query(FETCH_ALL_DOORS).each(:symbolize_keys => true)
query(FETCH_ALL_DOORS).each.to_json
end


Expand Down
12 changes: 6 additions & 6 deletions software/servers/http_server.rb
Expand Up @@ -32,12 +32,12 @@ def receive_data(data)

def parse_request(uri)
uri = uri[1..-1].split('/')
uri[0] ||= 'index.html'
#uri[0] ||= 'index.html'
case uri[0]
when 'index.html'
File.open('views/index.html') do |page|
send_data(page.read)
end
#when 'index.html'
# File.open('../site/views/index.html') do |page|
# send_data(page.read)
# end
when 'all_doors'
send_data(fetch_all_doors)
when 'door_state'
Expand All @@ -58,7 +58,7 @@ def parse_request(uri)
end
when 'favicon'
else
send_data('Unknown')
send_data('Invalid Command')
end
close_connection_after_writing
end
Expand Down

0 comments on commit e462e4d

Please sign in to comment.