From 2940f59e6b6bee7a143611c5f26a201b85f7e915 Mon Sep 17 00:00:00 2001 From: Heinrich Klobuczek Date: Thu, 28 Jan 2010 23:34:05 +0100 Subject: [PATCH] added max_cost_evaluator --- lib/neo4jr-simple.rb | 1 + lib/neo4jr/max_cost_evaluator.rb | 13 +++++++++++++ neo4jr-simple.gemspec | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 lib/neo4jr/max_cost_evaluator.rb diff --git a/lib/neo4jr-simple.rb b/lib/neo4jr-simple.rb index bac3494..f35a9d6 100644 --- a/lib/neo4jr-simple.rb +++ b/lib/neo4jr-simple.rb @@ -38,6 +38,7 @@ module Neo4jr require 'neo4jr/returnable_evaluator' require 'neo4jr/stop_evaluator' require 'neo4jr/simple_cost_evaluator' +require 'neo4jr/max_cost_evaluator' require 'neo4jr/order' require 'neo4jr/direction' require 'neo4jr/path_rater' diff --git a/lib/neo4jr/max_cost_evaluator.rb b/lib/neo4jr/max_cost_evaluator.rb new file mode 100644 index 0000000..9cbc74d --- /dev/null +++ b/lib/neo4jr/max_cost_evaluator.rb @@ -0,0 +1,13 @@ +module Neo4jr + class MaxCostEvaluator + include org.neo4j.graphalgo.shortestpath.MaxCostEvaluator + + def initialize &block + @evaluator_block = block + end + + def maxCostExceeded currentCost + @evaluator_block.call currentCost + end + end +end \ No newline at end of file diff --git a/neo4jr-simple.gemspec b/neo4jr-simple.gemspec index 0423fcf..05a94b2 100644 --- a/neo4jr-simple.gemspec +++ b/neo4jr-simple.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Matthew Deiters"] - s.date = %q{2010-01-26} + s.date = %q{2010-01-27} s.default_executable = %q{neosh} s.description = %q{A simple, ready to go JRuby wrapper for the Neo4j graph database engine. Nothing more then Neo4j and Ruby goodness} s.email = %q{matthew_deiters@mckinsey.com}