Skip to content

Commit

Permalink
extconf.rb, version bump to 0.3.0, spec fixes for ruby 1.8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
asmuth committed Mar 8, 2012
1 parent 7ce05b5 commit 23111bc
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
bin/
*.gem
Gemfile.lock
ext/Makefile
5 changes: 1 addition & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ task YARD::Rake::YardocTask.new

desc "Compile the native client"
task :build_native do
out_dir = ::File.expand_path("../bin", __FILE__)
src_dir = ::File.expand_path("../src", __FILE__)
%x{mkdir -p #{out_dir}}
%x{gcc -Wall #{src_dir}/recommendify.c -lhiredis -o #{out_dir}/recommendify}
exec "cd ext && ruby extconf.rb && make"
end
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions ext/extconf.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
makefile = <<-MAKEFILE
all: prepare build
build:
gcc -Wall recommendify.c -lhiredis -o ../bin/recommendify
prepare:
mkdir -p ../bin
clean:
rm -f *.o
install: prepare
MAKEFILE

File.open(::File.expand_path("../Makefile", __FILE__), "w+") do |f|
f.write(makefile)
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 5 additions & 4 deletions recommendify.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ $:.push File.expand_path("../lib", __FILE__)

Gem::Specification.new do |s|
s.name = "recommendify"
s.version = "0.2.3"
s.version = "0.3.0"
s.date = Date.today.to_s
s.platform = Gem::Platform::RUBY
s.authors = ["Paul Asmuth"]
s.email = ["paul@paulasmuth.com"]
s.homepage = "http://github.com/paulasmuth/recommendify"
s.summary = %q{Distributed item-based "Collaborative Filtering" with ruby and redis}
s.description = %q{Distributed item-based "Collaborative Filtering" with ruby and redis}
s.summary = %q{ruby/redis based recommendation engine (collaborative filtering)}
s.description = %q{Recommendify is a distributed, incremental item-based recommendation engine for binary input ratings. It's based on ruby and redis and uses an approach called "Collaborative Filtering"}
s.licenses = ["MIT"]

s.extensions = ['ext/extconf.rb']

s.add_dependency "redis", ">= 2.2.2"

s.add_development_dependency "rspec", "~> 2.8.0"

s.files = `git ls-files`.split("\n") - [".gitignore", ".rspec", ".travis.yml"]
s.test_files = `git ls-files -- spec/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
end
6 changes: 3 additions & 3 deletions spec/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

before(:each) do
flush_redis!
Recommendify::Base.class_variable_set(:@@max_neighbors, nil)
Recommendify::Base.class_variable_set(:@@input_matrices, {})
Recommendify::Base.send(:class_variable_set, :@@max_neighbors, nil)
Recommendify::Base.send(:class_variable_set, :@@input_matrices, {})
end

describe "configuration" do
Expand All @@ -24,7 +24,7 @@

it "should add an input_matrix by 'key'" do
Recommendify::Base.input_matrix(:myinput, :similarity_func => :jaccard)
Recommendify::Base.class_variable_get(:@@input_matrices).keys.should == [:myinput]
Recommendify::Base.send(:class_variable_get, :@@input_matrices).keys.should == [:myinput]
end

it "should retrieve an input_matrix on a new instance" do
Expand Down

0 comments on commit 23111bc

Please sign in to comment.