Skip to content

Commit

Permalink
Merge 1d8e2e8 into f69cec7
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurtis Rainbolt-Greene committed May 12, 2013
2 parents f69cec7 + 1d8e2e8 commit cc8631b
Show file tree
Hide file tree
Showing 20 changed files with 247 additions and 96 deletions.
41 changes: 32 additions & 9 deletions .gitignore
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/
53 changes: 53 additions & 0 deletions .rvmrc
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
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ rvm:
- 1.9.2
- 1.9.3
- 2.0.0
script: bundle exec rake test
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
source 'https://rubygems.org/'
source "https://rubygems.org/"

gemspec
74 changes: 69 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PATH
remote: .
specs:
recommendable (2.1.0)
activesupport (>= 3.0.0)
hooks (>= 0.2.1)
redis (>= 2.2.0)
recommendable (2.1.0.1)
activesupport (~> 3.0)
hooks (~> 0.2)
redis (~> 3.0)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -37,24 +37,75 @@ GEM
i18n (= 0.6.1)
multi_json (~> 1.0)
arel (3.0.2)
binding_of_caller (0.7.1)
debug_inspector (>= 0.0.1)
bond (0.4.3)
builder (3.0.4)
coderay (1.0.9)
colorize (0.5.8)
columnize (0.3.6)
coveralls (0.6.7)
colorize
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
thor
database_cleaner (0.9.1)
debug_inspector (0.0.2)
debugger (1.5.0)
columnize (>= 0.3.1)
debugger-linecache (~> 1.2.0)
debugger-ruby_core_source (~> 1.2.0)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.2.0)
erubis (2.7.0)
hike (1.2.1)
hooks (0.2.2)
i18n (0.6.1)
interception (0.3)
jist (1.5.1)
json
journey (1.0.4)
json (1.7.7)
kramdown (1.0.2)
mail (2.5.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.8.1)
mime-types (1.21)
miniskirt (1.2.1)
activesupport
minitest (4.6.2)
multi_json (1.7.1)
polyglot (0.3.3)
pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
pry-debugger (0.2.2)
debugger (~> 1.3)
pry (~> 0.9.10)
pry-doc (0.4.5)
pry (>= 0.9)
yard (>= 0.8)
pry-docmore (0.1.1)
pry
pry-doc
pry-plus (1.0.0)
bond
jist
pry-debugger
pry-doc
pry-docmore
pry-rescue
pry-stack_explorer
pry-rescue (1.1.1)
interception (>= 0.3)
pry
pry-stack_explorer (0.4.9)
binding_of_caller (>= 0.7)
pry (~> 0.9.11)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
Expand All @@ -80,7 +131,14 @@ GEM
rake (10.0.3)
rdoc (3.12.2)
json (~> 1.4)
redis (3.0.3)
redis (3.0.4)
rest-client (1.6.7)
mime-types (>= 1.16)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
slop (3.4.4)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
Expand All @@ -99,10 +157,16 @@ PLATFORMS
ruby

DEPENDENCIES
bundler
coveralls
database_cleaner
kramdown
miniskirt
minitest
pry
pry-plus
rails (>= 3.1.0)
rake
recommendable!
sqlite3
yard
32 changes: 23 additions & 9 deletions Rakefile
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
52 changes: 28 additions & 24 deletions recommendable.gemspec
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
12 changes: 6 additions & 6 deletions test/factories.rb
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
3 changes: 1 addition & 2 deletions test/recommendable/helpers/calculations_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
$LOAD_PATH.unshift File.expand_path('../../test', __FILE__)
require 'test_helper'
require "test_helper"

class CalculationsTest < MiniTest::Unit::TestCase
def setup
Expand Down

0 comments on commit cc8631b

Please sign in to comment.