forked from davidcelis/recommendable
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
247 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,35 @@ | ||
# bundler | ||
.bundle | ||
vendor/bundle | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
# | ||
# If you find yourself ignoring temporary files generated by your text editor | ||
# or operating system, you probably want to add a global ignore instead: | ||
# git config --global core.excludesfile ~/.gitignore | ||
|
||
# logging | ||
*.log | ||
# Ignore all of the generated gem stuff | ||
/pkg | ||
/*.gem | ||
|
||
# sqlite3 | ||
*.sqlite3-journal | ||
# Ignore bundler config | ||
/.bundle | ||
/Gemfile.lock | ||
|
||
# For MacOS: | ||
.DS_Store | ||
# Ignore all bundler caching | ||
/vendor/cache | ||
/vendor/ruby | ||
|
||
# Ignore test dummy files | ||
/test/dummy/log/*.log | ||
/test/dummy/db/*.sqlite* | ||
|
||
# Ignore all tempfiles | ||
/tmp | ||
|
||
# Ignore all log files | ||
|
||
# Ignores that should be in the global gitignore | ||
# /*.rbc | ||
# /.config | ||
/.yardoc | ||
/coverage/ | ||
/doc/ | ||
# /rdoc/ | ||
# /spec/reports/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This is an RVM Project .rvmrc file, used to automatically load the ruby | ||
# development environment upon cd'ing into the directory | ||
|
||
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional, | ||
# Only full ruby name is supported here, for short names use: | ||
# echo "rvm use 2.0.0" > .rvmrc | ||
environment_id="ruby-2.0.0-p0@recommendable" | ||
|
||
# Uncomment the following lines if you want to verify rvm version per project | ||
# rvmrc_rvm_version="1.19.6 (stable)" # 1.10.1 seams as a safe start | ||
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || { | ||
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading." | ||
# return 1 | ||
# } | ||
|
||
# First we attempt to load the desired environment directly from the environment | ||
# file. This is very fast and efficient compared to running through the entire | ||
# CLI and selector. If you want feedback on which environment was used then | ||
# insert the word 'use' after --create as this triggers verbose mode. | ||
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" | ||
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] | ||
then | ||
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id" | ||
for __hook in "${rvm_path:-$HOME/.rvm}/hooks/after_use"* | ||
do | ||
if [[ -f "${__hook}" && -x "${__hook}" && -s "${__hook}" ]] | ||
then \. "${__hook}" || true | ||
fi | ||
done | ||
unset __hook | ||
else | ||
# If the environment file has not yet been created, use the RVM CLI to select. | ||
rvm --create "$environment_id" || { | ||
echo "Failed to create RVM environment '${environment_id}'." | ||
return 1 | ||
} | ||
fi | ||
|
||
# If you use bundler, this might be useful to you: | ||
# if [[ -s Gemfile ]] && { | ||
# ! builtin command -v bundle >/dev/null || | ||
# builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null | ||
# } | ||
# then | ||
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n" | ||
# gem install bundler | ||
# fi | ||
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null | ||
# then | ||
# bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete' | ||
# fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ rvm: | |
- 1.9.2 | ||
- 1.9.3 | ||
- 2.0.0 | ||
script: bundle exec rake test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
source 'https://rubygems.org/' | ||
source "https://rubygems.org/" | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,29 @@ | ||
#!/usr/bin/env rake | ||
require 'rake/testtask' | ||
require "bundler/gem_tasks" | ||
require "rake/clean" | ||
require "rake/testtask" | ||
require "yard" | ||
|
||
task :default => :test | ||
begin | ||
Bundler.setup :default, :development | ||
Bundler::GemHelper.install_tasks | ||
rescue Bundler::BundlerError => error | ||
$stderr.puts error.message | ||
$stderr.puts "Run `bundle install` to install missing gems" | ||
exit error.status_code | ||
end | ||
|
||
Rake::TestTask.new(:test) do |t| | ||
t.libs << 'test' | ||
t.pattern = 'test/**/*_test.rb' | ||
t.verbose = true | ||
desc "Run all of the tests" | ||
Rake::TestTask.new(:test) do |config| | ||
config.libs << "test" | ||
config.pattern = "test/**/*_test.rb" | ||
config.verbose = true | ||
end | ||
|
||
task :default => :test | ||
desc "Generate all of the docs" | ||
YARD::Rake::YardocTask.new do |config| | ||
config.files = Dir["lib/**/*.rb"] | ||
end | ||
desc "Default: run tests and generate docs" | ||
task :default => [ :test, :yard ] | ||
|
||
require 'yard' | ||
YARD::Rake::YardocTask.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__) | ||
require 'recommendable/version' | ||
# coding: utf-8 | ||
lib = File.expand_path("../lib", __FILE__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require "recommendable/version" | ||
|
||
Gem::Specification.new do |s| | ||
s.name = 'recommendable' | ||
s.version = Recommendable::VERSION | ||
s.summary = 'A Like/Dislike recommendation engine for Ruby apps using Redis' | ||
s.description = <<EOF | ||
A Like/Dislike recommendation engine for Ruby apps using Redis. | ||
EOF | ||
Gem::Specification.new do |spec| | ||
spec.name = "recommendable" | ||
spec.version = Recommendable::VERSION | ||
spec.summary = "A Like/Dislike recommendation engine for Ruby apps using Redis" | ||
spec.description = spec.summary | ||
|
||
s.files = Dir['lib/**/*'] | ||
spec.files = Dir["lib/**/*"] | ||
|
||
s.has_rdoc = 'yard' | ||
spec.has_rdoc = "yard" | ||
|
||
s.authors = ['David Celis'] | ||
s.email = %w[david@davidcelis.com] | ||
s.homepage = 'https://github.com/davidcelis/recommendable' | ||
spec.authors = ["David Celis"] | ||
spec.email = %w[david@davidcelis.com] | ||
spec.homepage = "https://davidcelis.github.com/recommendable" | ||
|
||
s.add_dependency 'activesupport', '>= 3.0.0' | ||
s.add_dependency 'redis', '>= 2.2.0' | ||
s.add_dependency 'hooks', '>= 0.2.1' | ||
|
||
s.add_development_dependency 'minitest' | ||
s.add_development_dependency 'miniskirt' | ||
s.add_development_dependency 'yard' | ||
s.add_development_dependency 'rails', '>= 3.1.0' | ||
s.add_development_dependency 'sqlite3' | ||
s.add_development_dependency 'database_cleaner' | ||
spec.add_dependency "activesupport", "~> 3.0" | ||
spec.add_dependency "redis", "~> 3.0" | ||
spec.add_dependency "hooks", "~> 0.2" | ||
spec.add_development_dependency "minitest" | ||
spec.add_development_dependency "miniskirt" | ||
spec.add_development_dependency "yard" | ||
spec.add_development_dependency "rails", ">= 3.1.0" | ||
spec.add_development_dependency "sqlite3" | ||
spec.add_development_dependency "database_cleaner" | ||
spec.add_development_dependency "bundler" | ||
spec.add_development_dependency "rake" | ||
spec.add_development_dependency "coveralls" | ||
spec.add_development_dependency "yard" | ||
spec.add_development_dependency "kramdown" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
Factory.define(:user) do |f| | ||
f.email 'user%d@example.com' | ||
f.email "user%d@example.com" | ||
end | ||
|
||
Factory.define(:movie) do |f| | ||
f.title '%{year}: A Space Odyssey' | ||
f.year { '200%d'.to_i } | ||
f.title "%{year}: A Space Odyssey" | ||
f.year { "200%d".to_i } | ||
end | ||
|
||
Factory.define(:book) do |f| | ||
f.title 'Harry Potter Vol. %d' | ||
f.author 'J.K. Rowling' | ||
f.title "Harry Potter Vol. %d" | ||
f.author "J.K. Rowling" | ||
end | ||
|
||
Factory.define(:rock) do |f| | ||
f.name 'Boring Specimen No. %d' | ||
f.name "Boring Specimen No. %d" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.