rkneufeld-fuzzy-realty 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 7
4
- :patch: 0
4
+ :patch: 1
data/lib/benchmark.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'fuzzy_realty.rb'
2
-
2
+ if __FILE__ == $0
3
3
  puts "Benchmarking search through 100,000-1 (powers of ten) random listings"
4
4
  puts "======================================================================="
5
5
  listings = []
@@ -18,3 +18,4 @@ Benchmark.bm do |x|
18
18
  listings = listings[(0...1)]
19
19
  x.report("1 listing:") { FuzzyRealty::ExpertSystem.scores(listings,Query.random) }
20
20
  end
21
+ end
data/lib/classes.rb CHANGED
@@ -69,4 +69,4 @@ class Array
69
69
  def contains(value)
70
70
  self.any? {|array_value| array_value == value }
71
71
  end
72
- end
72
+ end
data/lib/fuzzy_realty.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'benchmark'
2
-
3
1
  require 'weights.rb'
4
2
  require 'classes.rb'
5
3
  require 'scores_table.rb'
@@ -33,6 +31,8 @@ end
33
31
 
34
32
  #When running the library directly calculate an example
35
33
  if __FILE__ == $0
34
+ require 'benchmark'
35
+
36
36
  listings = []
37
37
  1000.times do |i|
38
38
  listings << FuzzyRealty::Listing.random
@@ -65,4 +65,4 @@ if __FILE__ == $0
65
65
  scores[(0..20)].each do |score|
66
66
  puts "%.2f" % score[:score] + "\t\t#{score[:listing].inspect}"
67
67
  end
68
- end
68
+ end
data/lib/profiler.rb CHANGED
@@ -2,6 +2,7 @@ require 'rubygems'
2
2
  require 'ruby-prof'
3
3
  require 'fuzzy_realty.rb'
4
4
 
5
+ if __FILE__ == $0
5
6
  RubyProf.start
6
7
 
7
8
  puts "Generating 10000 Listings"
@@ -45,4 +46,5 @@ end
45
46
  result = RubyProf.stop
46
47
 
47
48
  printer = RubyProf::GraphHtmlPrinter.new(result)
48
- printer.print(STDOUT, :min_percent=>0)
49
+ printer.print(STDOUT, :min_percent=>0)
50
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rkneufeld-fuzzy-realty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Neufeld
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-20 00:00:00 -07:00
12
+ date: 2009-04-29 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15