Skip to content

Commit

Permalink
Initial commit of project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Oct 17, 2011
0 parents commit c8ab7a6
Show file tree
Hide file tree
Showing 13 changed files with 198 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .gitignore
@@ -0,0 +1,22 @@
.DS_Store
coverage/*
pkg/*
scratch_directory/*
sandbox/*
tmp/*
*.gem
.bundle
Gemfile.lock
rdoc/*
TODO
ISSUES
DONATE
.yardoc/*
doc/*
*.swp
*.un~
*~
*.rbc
*.profile
*.profile.pdf
*.symbols
2 changes: 2 additions & 0 deletions .rspec
@@ -0,0 +1,2 @@
--colour
--format <%= ENV["CI"] ? 'progress' : 'documentation'%>
48 changes: 48 additions & 0 deletions .rvmrc
@@ -0,0 +1,48 @@
#!/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.
environment_id="ruby-1.9.2@origin"

#
# First we attempt to load the desired environment directly from the environment
# file. This is very fast and efficicent 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/hooks/after_use" ]] && . ".rvm/hooks/after_use"
else
# If the environment file has not yet been created, use the RVM CLI to select.
rvm --create use "$environment_id"
fi

#
# If you use an RVM gemset file to install a list of gems (*.gems), you can have
# it be automatically loaded. Uncomment the following and adjust the filename if
# necessary.
#
# filename=".gems"
# if [[ -s "$filename" ]] ; then
# rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
# fi

#
# If you use bundler and would like to run bundle each time you enter the
# directory, you can uncomment the following code.
#
# # Ensure that Bundler is installed. Install it if it is not.
# if ! command -v bundle >/dev/null; then
# printf "The rubygem 'bundler' is not installed. Installing it now.\n"
# gem install bundler
# fi
#
# # Bundle while reducing excess noise.
# printf "Bundling your gems. This may take a few minutes on a fresh clone.\n"
# bundle | grep -v '^Using ' | grep -v ' is complete' | sed '/^$/d'
#
18 changes: 18 additions & 0 deletions .travis.yml
@@ -0,0 +1,18 @@
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- ruby-head
- jruby
- rbx
- rbx-2.0
- ree
notifications:
email:
- durran@gmail.com
- arunagw@gmail.com
- cgriego@gmail.com
- gregory@kaddabra.co.il
- nick@deadorange.com
- paul@codingfrontier.com
- bj.schaefer@gmail.com
23 changes: 23 additions & 0 deletions .watchr
@@ -0,0 +1,23 @@
# vim:set filetype=ruby:
def run(cmd)
puts cmd
system cmd
end

def spec(file)
if File.exists?(file)
run("rspec --fail-fast #{file}")
else
puts("Spec: #{file} does not exist.")
end
end

watch("spec/.*/*_spec\.rb") do |match|
puts(match[0])
spec(match[0])
end

watch("lib/(.*/.*)\.rb") do |match|
puts(match[1])
spec("spec/#{match[1]}_spec.rb")
end
1 change: 1 addition & 0 deletions .yardopts
@@ -0,0 +1 @@
- CHANGELOG*
2 changes: 2 additions & 0 deletions Gemfile
@@ -0,0 +1,2 @@
source "http://rubygems.org"
gemspec
32 changes: 32 additions & 0 deletions Rakefile
@@ -0,0 +1,32 @@
require "rake"
require "rspec"
require "rspec/core/rake_task"

$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "origin/version"

task :gem => :build
task :build do
system "gem build origin.gemspec"
end

task :install => :build do
system "sudo gem install origin-#{Origin::VERSION}.gem"
end

task :release => :build do
system "git tag -a v#{Origin::VERSION} -m 'Tagging #{Origin::VERSION}'"
system "git push --tags"
system "gem push origin-#{Origin::VERSION}.gem"
end

RSpec::Core::RakeTask.new("spec") do |spec|
spec.pattern = "spec/**/*_spec.rb"
end

RSpec::Core::RakeTask.new("spec:progress") do |spec|
spec.rspec_opts = %w(--format progress)
spec.pattern = "spec/**/*_spec.rb"
end

task :default => :spec
3 changes: 3 additions & 0 deletions lib/origin.rb
@@ -0,0 +1,3 @@
# encoding: utf-8
require "origin/selection"
require "origin/version"
14 changes: 14 additions & 0 deletions lib/origin/selection.rb
@@ -0,0 +1,14 @@
# encoding: utf-8
module Origin

# Origin is a DSL that sits on top of the MongoDB query language, extracted
# from Mongoid 2 into it's own gem.
#
# @example Add the origin DSL to a model.
# class Model
# extend Origin::Selection
# end
module Selection

end
end
4 changes: 4 additions & 0 deletions lib/origin/version.rb
@@ -0,0 +1,4 @@
# encoding: utf-8
module Origin
VERSION = "1.0.0"
end
25 changes: 25 additions & 0 deletions origin.gemspec
@@ -0,0 +1,25 @@
# encoding: utf-8
lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)

require "origin/version"

Gem::Specification.new do |s|
s.name = "origin"
s.version = Origin::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Durran Jordan"]
s.email = ["durran@gmail.com"]
s.homepage = "http://mongoid.org"
s.summary = "Simple DSL for MongoDB query generation"
s.description = "Origin is a simple DSL for generating MongoDB selectors and options"

s.required_rubygems_version = ">= 1.3.6"
s.rubyforge_project = "origin"

s.add_development_dependency("rspec", ["~> 2.6"])
s.add_development_dependency("watchr", ["~> 0.6"])

s.files = Dir.glob("lib/**/*") + %w(Rakefile)
s.require_path = 'lib'
end
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
@@ -0,0 +1,4 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "origin"
require "rspec"

0 comments on commit c8ab7a6

Please sign in to comment.