Permalink
Browse files

* lib/journey/route.rb: add points based on constraints and defaults.

  • Loading branch information...
1 parent d278d23 commit 88a929643a6144722315ff1c262b22c6b3030bc7 @tenderlove tenderlove committed Aug 29, 2012
Showing with 5 additions and 1 deletion.
  1. +4 −0 CHANGELOG.rdoc
  2. +1 −1 lib/journey/route.rb
View
@@ -1,3 +1,7 @@
+Tue Aug 28 17:21:49 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/journey/route.rb: add points based on constraints and defaults.
+
Thu Jun 14 14:03:22 2012 Aaron Patterson <aaron@tenderlovemaking.com>
* lib/journey/formatter.rb: when generating routes, skip route
View
@@ -58,7 +58,7 @@ def score constraints
return -1 unless (required_keys - supplied_keys).empty?
score = (supplied_keys & path.names).length
- score + (required_defaults.length * 2)
+ score + constraints.find_all { |k,v| @defaults[k] == v }.length
end
def parts

0 comments on commit 88a9296

Please sign in to comment.