diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/infrastructure/block_specification.rb | 15 | ||||
| -rw-r--r-- | lib/infrastructure/mixins/specification.rb | 23 | ||||
| -rw-r--r-- | lib/web/route_registry.rb | 1 |
3 files changed, 0 insertions, 39 deletions
diff --git a/lib/infrastructure/block_specification.rb b/lib/infrastructure/block_specification.rb deleted file mode 100644 index fcbec59..0000000 --- a/lib/infrastructure/block_specification.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'specification' - -module Booty - class BlockSpecification - include Booty::Specification - - def initialize(&block) - @block = block - end - - def matches?(item) - @block.call(item) - end - end -end diff --git a/lib/infrastructure/mixins/specification.rb b/lib/infrastructure/mixins/specification.rb deleted file mode 100644 index 38abebb..0000000 --- a/lib/infrastructure/mixins/specification.rb +++ /dev/null @@ -1,23 +0,0 @@ -module Booty - module Specification - def or(other_predicate = nil, &block) - matcher = create_predicate(other_predicate, &block) - create_predicate { |item| self.matches?(item) || matcher.matches?(item) } - end - - def and(other_predicate = nil, &block) - matcher = create_predicate(other_predicate, &block) - create_predicate { |item| self.matches?(item) && matcher.matches?(item) } - end - - def not - create_predicate { |item| !self.matches?(item) } - end - - private - - def create_predicate(predicate = nil, &block) - block_given? ? Booty::BlockSpecification.new(&block) : predicate - end - end -end diff --git a/lib/web/route_registry.rb b/lib/web/route_registry.rb index f53c885..42a9c53 100644 --- a/lib/web/route_registry.rb +++ b/lib/web/route_registry.rb @@ -1,5 +1,4 @@ require 'routed_command' -require 'block_specification' module Booty class RouteRegistry |
