Skip to content

Commit

Permalink
groupify edited
Browse files Browse the repository at this point in the history
  • Loading branch information
amvaleh committed Sep 9, 2014
1 parent 3b8a943 commit efb6655
Show file tree
Hide file tree
Showing 33 changed files with 2,681 additions and 0 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service_name: travis-ci
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
*.gem
*.rbc
.bundle
.config
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
/**/*.lock
.idea/
4 changes: 4 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--color
--format progress
--require spec_helper
--pattern "spec/**/*_spec.rb"
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: ruby
services: mongodb
rvm:
- 1.9.3
- 2.0.0
- 2.1.0
- 2.1.1
- 2.1.2
- jruby-19mode
- rbx-2
gemfile:
- gemfiles/rails_3.2.gemfile
- gemfiles/rails_4.0.gemfile
- gemfiles/rails_4.1.gemfile
matrix:
allow_failures:
- rvm: rbx-2
21 changes: 21 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
appraise "rails-3.2" do
gem 'activerecord', "~> 3.2"
gem "mongoid", ">= 3.0", "< 4"
end

appraise "rails-4.0" do
gem 'activerecord', "~> 4.0.0"
gem "mongoid", "~> 4.0"
end

appraise "rails-4.1" do
gem 'activerecord', "~> 4.1.0"

gem "mongoid", "~> 4.0"
end

appraise "rails-4.2" do
gem 'activerecord', "~> 4.2.0.beta1"

gem "mongoid", "~> 4.0"
end
15 changes: 15 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
source 'https://rubygems.org'

group :development do
gem 'pry'
end

group :test do
gem 'coveralls', require: false
end

# Specify your gem's dependencies in groupify.gemspec
gemspec

gem "jdbc-sqlite3", platform: :jruby
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2012 David Butler

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 changes: 12 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env rake
require "bundler/setup"
require "bundler/gem_tasks"

require 'rspec/core/rake_task'

desc "Run RSpec"
RSpec::Core::RakeTask.new do |t|
t.verbose = false
end

task :default => :spec
18 changes: 18 additions & 0 deletions gemfiles/rails_3.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "jdbc-sqlite3", :platform => :jruby
gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
gem "activerecord", "~> 3.2"
gem "mongoid", ">= 3.0", "< 4"

group :development do
gem "pry"
end

group :test do
gem "coveralls", :require => false
end

gemspec :path => "../"
18 changes: 18 additions & 0 deletions gemfiles/rails_4.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "jdbc-sqlite3", :platform => :jruby
gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
gem "activerecord", "~> 4.0.0"
gem "mongoid", "~> 4.0"

group :development do
gem "pry"
end

group :test do
gem "coveralls", :require => false
end

gemspec :path => "../"
18 changes: 18 additions & 0 deletions gemfiles/rails_4.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "jdbc-sqlite3", :platform => :jruby
gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
gem "activerecord", "~> 4.1.0"
gem "mongoid", "~> 4.0"

group :development do
gem "pry"
end

group :test do
gem "coveralls", :require => false
end

gemspec :path => "../"
18 changes: 18 additions & 0 deletions gemfiles/rails_4.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "jdbc-sqlite3", :platform => :jruby
gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
gem "activerecord", "~> 4.2.0.beta1"
gem "mongoid", "~> 4.0"

group :development do
gem "pry"
end

group :test do
gem "coveralls", :require => false
end

gemspec :path => "../"
31 changes: 31 additions & 0 deletions groupify.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/groupify/version', __FILE__)

Gem::Specification.new do |gem|
gem.authors = ["dwbutler"]
gem.email = ["[email protected]"]
gem.description = %q{Adds group and membership functionality to Rails models}
gem.summary = %q{Group functionality for Rails}
gem.homepage = "https://github.com/dwbutler/groupify"

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.name = "groupify"
gem.require_paths = ["lib"]
gem.version = Groupify::VERSION
gem.license = 'MIT'

gem.add_development_dependency "mongoid", ">= 3.1"
gem.add_development_dependency "activerecord", ">= 3.2"

unless defined?(JRUBY_VERSION)
gem.add_development_dependency "sqlite3"
end

gem.add_development_dependency "rake"
gem.add_development_dependency "rspec", ">= 3"

gem.add_development_dependency "database_cleaner"
gem.add_development_dependency "appraisal"
end
3 changes: 3 additions & 0 deletions lib/groupify.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require 'active_support'

require 'groupify/railtie' if defined?(Rails)
14 changes: 14 additions & 0 deletions lib/groupify/adapter/active_record.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'active_record'
require 'set'

module Groupify
module ActiveRecord
require 'groupify/adapter/active_record/model'

autoload :Group, 'groupify/adapter/active_record/group'
autoload :GroupMember, 'groupify/adapter/active_record/group_member'
autoload :GroupMembership, 'groupify/adapter/active_record/group_membership'
autoload :NamedGroupCollection, 'groupify/adapter/active_record/named_group_collection'
autoload :NamedGroupMember, 'groupify/adapter/active_record/named_group_member'
end
end
Loading

0 comments on commit efb6655

Please sign in to comment.