57 lines
1.8 KiB
Ruby
57 lines
1.8 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
module ButtsAreCoolRoutes
|
|
DOMAIN = "butts-are.cool"
|
|
BALLS = "balls"
|
|
BALLS_DOMAIN = "#{BALLS}.#{DOMAIN}".freeze
|
|
COCKS = "cocks"
|
|
COCKS_DOMAIN = "#{COCKS}.#{DOMAIN}".freeze
|
|
KNOTS = "knots"
|
|
KNOTS_DOMAIN = "#{KNOTS}.#{DOMAIN}".freeze
|
|
SHEATHS = "sheaths"
|
|
SHEATHS_DOMAIN = "#{SHEATHS}.#{DOMAIN}".freeze
|
|
|
|
def self.extended(router)
|
|
router.instance_exec do
|
|
namespace(:butts_are_cool, path: "") do
|
|
constraints(DomainConstraint.new(DOMAIN)) do
|
|
namespace(:home, path: "") do
|
|
get(:manifest, constraints: { format: "json" })
|
|
get(:browserconfig, constraints: { format: "xml" })
|
|
end
|
|
|
|
root(to: "home#index")
|
|
end
|
|
constraints(DomainConstraint.new(DOMAIN, BALLS)) do
|
|
namespace(:balls, path: "") do
|
|
get(:manifest, constraints: { format: "json" })
|
|
get(:browserconfig, constraints: { format: "xml" })
|
|
root(action: :index)
|
|
end
|
|
end
|
|
constraints(DomainConstraint.new(DOMAIN, COCKS)) do
|
|
namespace(:cocks, path: "") do
|
|
get(:manifest, constraints: { format: "json" })
|
|
get(:browserconfig, constraints: { format: "xml" })
|
|
root(action: :index)
|
|
end
|
|
end
|
|
constraints(DomainConstraint.new(DOMAIN, KNOTS)) do
|
|
namespace(:knots, path: "") do
|
|
get(:manifest, constraints: { format: "json" })
|
|
get(:browserconfig, constraints: { format: "xml" })
|
|
root(action: :index)
|
|
end
|
|
end
|
|
constraints(DomainConstraint.new(DOMAIN, SHEATHS)) do
|
|
namespace(:sheaths, path: "") do
|
|
get(:manifest, constraints: { format: "json" })
|
|
get(:browserconfig, constraints: { format: "xml" })
|
|
root(action: :index)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|