diff options
author | Azul <azul@riseup.net> | 2016-08-29 10:36:05 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-08-29 10:36:05 +0200 |
commit | 55006b3ce5967fde08081bfd56d56f76dbaf7c53 (patch) | |
tree | be4c5f8f0000fedd5379260222b243db709e5a63 /lib | |
parent | becd26b0bdf44b3625caaa7643914d0379a4fea5 (diff) |
cleanup: remove outdated ideas
Lookup and InvalidSource were experiments for a design for the
dispatching. Our new dispatcher seems better.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/nickserver/invalid_source.rb | 14 | ||||
-rw-r--r-- | lib/nickserver/lookup.rb | 31 |
2 files changed, 0 insertions, 45 deletions
diff --git a/lib/nickserver/invalid_source.rb b/lib/nickserver/invalid_source.rb deleted file mode 100644 index dac245a..0000000 --- a/lib/nickserver/invalid_source.rb +++ /dev/null @@ -1,14 +0,0 @@ -# -# This is a dummy source for invalid queries. -# It simply always returns 500 and "Not a valid address" -# - -module Nickserver - class InvalidSource - - def query(nick) - yield 500, "Not a valid address" - end - - end -end diff --git a/lib/nickserver/lookup.rb b/lib/nickserver/lookup.rb deleted file mode 100644 index 105e77e..0000000 --- a/lib/nickserver/lookup.rb +++ /dev/null @@ -1,31 +0,0 @@ -require 'nickserver/invalid_source' - -module Nickserver - class Lookup - - attr_reader :nick - - def initialize(nick) - @nick = nick - end - - def respond_with(responder) - query do |status, content| - responder.send_response status: status, content: content - end - end - - protected - - def query(&block) - source.query nick, &block - end - - def source - if nick.invalid? then Nickserver::InvalidSource - elsif nick.local? then Nickserver::Config.local_source - else Nickserver::Config.remote_source - end - end - end -end |