split up setup method
This commit is contained in:
parent
17d053ac21
commit
bff18a278c
|
@ -38,12 +38,9 @@ class Travis::Api::App
|
||||||
# the environment, so no biggy.
|
# the environment, so no biggy.
|
||||||
def self.setup
|
def self.setup
|
||||||
return if setup?
|
return if setup?
|
||||||
Travis::Database.connect
|
setup_travis
|
||||||
|
load_endpoints
|
||||||
Backports.require_relative_dir 'app/middleware'
|
setup_endpoints
|
||||||
Backports.require_relative_dir 'app/endpoint'
|
|
||||||
Responder.subclasses.each(&:setup)
|
|
||||||
|
|
||||||
@setup = true
|
@setup = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -65,4 +62,19 @@ class Travis::Api::App
|
||||||
def call(env)
|
def call(env)
|
||||||
app.call(env)
|
app.call(env)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def self.setup_travis
|
||||||
|
Travis::Database.connect
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.load_endpoints
|
||||||
|
Backports.require_relative_dir 'app/middleware'
|
||||||
|
Backports.require_relative_dir 'app/endpoint'
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.setup_endpoints
|
||||||
|
Responder.subclasses.each(&:setup)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user