Skip to content

Commit

Permalink
Make the executable run with the canto command
Browse files Browse the repository at this point in the history
  • Loading branch information
Dana Scheider committed May 5, 2015
1 parent c2ff23f commit 8c4bb1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions lib/canto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
require 'json'
require File.expand_path('../../config/settings', __FILE__)

require_relative './routes/routing.rb'
require_relative './routes/filters.rb'
require_relative './routes/admin_routes.rb'
require_relative './routes/listing_routes.rb'
require File.expand_path '../routes/routing.rb', __FILE__
require File.expand_path '../routes/filters.rb', __FILE__
require File.expand_path '../routes/admin_routes.rb', __FILE__
require File.expand_path '../routes/listing_routes.rb', __FILE__
require File.expand_path '../routes/organization_routes.rb', __FILE__
require File.expand_path '../routes/program_routes.rb', __FILE__
require File.expand_path '../routes/season_routes.rb', __FILE__
require File.expand_path '../routes/task_routes.rb', __FILE__
require File.expand_path '../routes/user_routes.rb', __FILE__

Dir['./lib/models/*.rb'].each {|f| require f }
Dir['./lib/routes/*.rb'].each {|f| require f }

class Canto < Sinatra::Base

Expand All @@ -36,4 +40,4 @@ class Canto < Sinatra::Base
post '/login' do
login
end
end
end
4 changes: 2 additions & 2 deletions lib/helpers/log_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module LogHelper
# The ++CONFIG_INFO++ hash provides information about the location of the app file and
# log files.

CONFIG_INFO = (File.open(File.expand_path('config/config.yml'), 'r+') {|f| YAML.load(f)}).symbolize_keys!
CONFIG_INFO = (File.open(File.expand_path('../../../config/config.yml', __FILE__), 'r+') {|f| YAML.load(f)}).symbolize_keys!

# The ++log_request++ method opens the request log file, identified by the ++:request_log++
# key in the ++CONFIG_INFO++ hash. It opens the file and appends the formatted
Expand Down Expand Up @@ -56,4 +56,4 @@ def response_log_entry
].join('')
end
end
end
end

0 comments on commit 8c4bb1f

Please sign in to comment.