forked from jffjs/mongoid_auto_inc
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get all the specs to pass with Mongoid 3.
- Loading branch information
1 parent
c119dbe
commit e8655cd
Showing
8 changed files
with
105 additions
and
134 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,5 +1,19 @@ | ||
*.gem | ||
*.rbc | ||
*.swp | ||
.bundle | ||
.config | ||
.DS_Store | ||
.yardoc | ||
Gemfile.lock | ||
pkg/* | ||
*.swp | ||
InstalledFiles | ||
_yardoc | ||
coverage | ||
doc/ | ||
lib/bundler/man | ||
pkg | ||
rdoc | ||
spec/reports | ||
test/tmp | ||
test/version_tmp | ||
tmp |
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,48 @@ | ||
rvm_gemset_create_on_use_flag=1 | ||
rvm use 1.9.2@mongoid_auto_increment | ||
#!/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 1.9.3" > .rvmrc | ||
environment_id="ruby-1.9.3-p194@mongoid_auto_increment" | ||
|
||
# Uncomment the following lines if you want to verify rvm version per project | ||
# rvmrc_rvm_version="1.15.0 (master)" # 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" | ||
[[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] && | ||
\. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true | ||
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 |
---|---|---|
@@ -1,17 +1,14 @@ | ||
source "http://rubygems.org" | ||
source 'https://rubygems.org' | ||
|
||
# Add dependencies required to use your gem here. | ||
|
||
gem "bson_ext" | ||
gem "mongoid" | ||
# Specify your gem's dependencies in mongoid_auto_increment.gemspec | ||
gemspec | ||
|
||
# Add dependencies to develop your gem here. | ||
# Include everything needed to run rake, tests, features, etc. | ||
group :development do | ||
gem "bundler", "~> 1.0.0" | ||
gem "jeweler", "~> 1.6.2" | ||
gem "simplecov", '>= 0.4.0', :require => false | ||
gem "rdoc", ">= 0" | ||
gem "rspec", ">= 2.0.0" | ||
gem "database_cleaner" | ||
gem 'rake' | ||
gem 'rdoc' | ||
gem 'rspec', '>= 2.0.0' | ||
gem 'simplecov', '>= 0.4.0', require: false | ||
gem 'database_cleaner' | ||
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,60 +1,18 @@ | ||
# encoding: utf-8 | ||
|
||
require 'rubygems' | ||
require 'rake' | ||
require 'bundler' | ||
Bundler::GemHelper.install_tasks | ||
|
||
begin | ||
Bundler.setup(:default, :development) | ||
rescue Bundler::BundlerError => e | ||
$stderr.puts e.message | ||
$stderr.puts "Run `bundle install` to install missing gems" | ||
exit e.status_code | ||
end | ||
|
||
require 'jeweler' | ||
Jeweler::Tasks.new do |gem| | ||
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options | ||
gem.name = "mongoid_auto_increment" | ||
gem.homepage = "http://github.com/proton/mongoid_auto_increment" | ||
gem.license = "MIT" | ||
gem.summary = %q{Auto-incrementing fields for Mongoid documents} | ||
gem.description = %q{Add SQL like auto-incrementing fields to your Mongoid documents.} | ||
gem.email = "psavichev@gmail.com" | ||
gem.authors = ["Peter Savichev (proton)"] | ||
# dependencies defined in Gemfile | ||
end | ||
Jeweler::RubygemsDotOrgTasks.new | ||
require 'bundler/gem_tasks' | ||
|
||
require 'rspec/core/rake_task' | ||
|
||
RSpec::Core::RakeTask.new(:spec) do |spec| | ||
spec.pattern = 'spec/**/*_spec.rb' | ||
end | ||
|
||
task :default => :spec | ||
|
||
require 'rdoc/task' | ||
RDoc::Task.new do |rdoc| | ||
version = File.exist?('VERSION') ? File.read('VERSION') : "" | ||
|
||
RDoc::Task.new(:rdoc) do |rdoc| | ||
rdoc.rdoc_dir = 'rdoc' | ||
rdoc.title = "mongoid_auto_increment #{version}" | ||
rdoc.rdoc_files.include('README*') | ||
rdoc.title = 'mongoid_auto_increment' | ||
rdoc.options << '--line-numbers' | ||
rdoc.rdoc_files.include('README.rdoc') | ||
rdoc.rdoc_files.include('lib/**/*.rb') | ||
end | ||
|
||
desc "Build gem" | ||
task :build do | ||
puts "Regenerating gemspec" | ||
system "rake gemspec" | ||
puts "Building" | ||
system "gem build mongoid_auto_increment.gemspec" | ||
end | ||
|
||
desc "Release gem" | ||
task :release => :build do | ||
version = File.exist?('VERSION') ? File.read('VERSION') : "" | ||
end | ||
|
||
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
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,3 @@ | ||
module MongoidAutoIncrement | ||
VERSION = "0.0.8" | ||
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,74 +1,21 @@ | ||
# Generated by jeweler | ||
# DO NOT EDIT THIS FILE DIRECTLY | ||
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' | ||
# -*- encoding: utf-8 -*- | ||
lib = File.expand_path('../lib', __FILE__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require 'mongoid_auto_increment/version' | ||
|
||
Gem::Specification.new do |s| | ||
s.name = %q{mongoid_auto_increment} | ||
s.version = "0.0.8" | ||
Gem::Specification.new do |gem| | ||
gem.name = 'mongoid_auto_increment' | ||
gem.version = MongoidAutoIncrement::VERSION | ||
gem.authors = ["Peter Savichev (proton)"] | ||
gem.email = ["psavichev@gmail.com"] | ||
gem.description = %q{Add SQL like auto-incrementing fields to your Mongoid documents.} | ||
gem.summary = %q{Auto-incrementing fields for Mongoid documents} | ||
gem.homepage = "https://github.com/proton/mongoid_auto_increment" | ||
|
||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | ||
s.authors = [%q{Peter Savichev (proton)}] | ||
s.date = %q{2011-08-03} | ||
s.description = %q{Add SQL like auto-incrementing fields to your Mongoid documents.} | ||
s.email = %q{psavichev@gmail.com} | ||
s.extra_rdoc_files = [ | ||
"LICENSE", | ||
"README.rdoc", | ||
"TODO" | ||
] | ||
s.files = [ | ||
".rspec", | ||
".rvmrc", | ||
"Gemfile", | ||
"LICENSE", | ||
"README.rdoc", | ||
"Rakefile", | ||
"lib/mongoid_auto_increment.rb", | ||
"lib/mongoid_auto_increment/incrementor.rb", | ||
"mongoid_auto_increment.gemspec", | ||
"spec/models/book.rb", | ||
"spec/models/order.rb", | ||
"spec/mongoid_auto_increment_spec.rb", | ||
"spec/spec_helper.rb" | ||
] | ||
s.homepage = %q{http://github.com/proton/mongoid_auto_increment} | ||
s.licenses = [%q{MIT}] | ||
s.require_paths = [%q{lib}] | ||
s.rubygems_version = %q{1.8.6} | ||
s.summary = %q{Auto-incrementing fields for Mongoid documents} | ||
gem.files = `git ls-files`.split($/) | ||
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } | ||
gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) | ||
gem.require_paths = ["lib"] | ||
|
||
if s.respond_to? :specification_version then | ||
s.specification_version = 3 | ||
|
||
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then | ||
s.add_runtime_dependency(%q<bson_ext>, [">= 0"]) | ||
s.add_runtime_dependency(%q<mongoid>, [">= 0"]) | ||
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"]) | ||
s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"]) | ||
s.add_development_dependency(%q<simplecov>, [">= 0.4.0"]) | ||
s.add_development_dependency(%q<rdoc>, [">= 0"]) | ||
s.add_development_dependency(%q<rspec>, [">= 2.0.0"]) | ||
s.add_development_dependency(%q<database_cleaner>, [">= 0"]) | ||
else | ||
s.add_dependency(%q<bson_ext>, [">= 0"]) | ||
s.add_dependency(%q<mongoid>, [">= 0"]) | ||
s.add_dependency(%q<bundler>, ["~> 1.0.0"]) | ||
s.add_dependency(%q<jeweler>, ["~> 1.6.2"]) | ||
s.add_dependency(%q<simplecov>, [">= 0.4.0"]) | ||
s.add_dependency(%q<rdoc>, [">= 0"]) | ||
s.add_dependency(%q<rspec>, [">= 2.0.0"]) | ||
s.add_dependency(%q<database_cleaner>, [">= 0"]) | ||
end | ||
else | ||
s.add_dependency(%q<bson_ext>, [">= 0"]) | ||
s.add_dependency(%q<mongoid>, [">= 0"]) | ||
s.add_dependency(%q<bundler>, ["~> 1.0.0"]) | ||
s.add_dependency(%q<jeweler>, ["~> 1.6.2"]) | ||
s.add_dependency(%q<simplecov>, [">= 0.4.0"]) | ||
s.add_dependency(%q<rdoc>, [">= 0"]) | ||
s.add_dependency(%q<rspec>, [">= 2.0.0"]) | ||
s.add_dependency(%q<database_cleaner>, [">= 0"]) | ||
end | ||
gem.add_dependency 'mongoid' | ||
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