Skip to content

Commit

Permalink
inital framework commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kjg committed Jun 15, 2011
0 parents commit d3755e0
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
pkg/
.bundle/
1 change: 1 addition & 0 deletions .rvmrc
@@ -0,0 +1 @@
rvm 1.9.2@has_normalized_sti
12 changes: 12 additions & 0 deletions Gemfile
@@ -0,0 +1,12 @@
source :rubygems

group :development do
gem 'jeweler'
gem 'mocha'
gem 'i18n'
end

group :test do
gem 'rspec'
gem 'activerecord', '~> 3.0.0'
end
43 changes: 43 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,43 @@
GEM
remote: http://rubygems.org/
specs:
activemodel (3.0.8)
activesupport (= 3.0.8)
builder (~> 2.1.2)
i18n (~> 0.5.0)
activerecord (3.0.8)
activemodel (= 3.0.8)
activesupport (= 3.0.8)
arel (~> 2.0.10)
tzinfo (~> 0.3.23)
activesupport (3.0.8)
arel (2.0.10)
builder (2.1.2)
diff-lcs (1.1.2)
git (1.2.5)
i18n (0.5.0)
jeweler (1.6.2)
bundler (~> 1.0)
git (>= 1.2.5)
rake
mocha (0.9.12)
rake (0.9.2)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
tzinfo (0.3.28)

PLATFORMS
ruby

DEPENDENCIES
activerecord (~> 3.0.0)
i18n
jeweler
mocha
rspec
Empty file added README
Empty file.
21 changes: 21 additions & 0 deletions Rakefile
@@ -0,0 +1,21 @@
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = 'has_normalized_sti'
gem.summary = 'allows rails STI to work when the type is normalized out'
gem.description = <<-DESC
has_normalzied_sti expects the model to have a type_id column
referencing a types table containg all the possible types.
the types table will be auto populated with new types as new
subclasses are saved
DESC
gem.email = 'kevin@glowacz.info'
gem.author = 'Kevin Glowacz'
gem.files.exclude '.rvmrc'
end
rescue LoadError
puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
end

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
1 change: 1 addition & 0 deletions init.rb
@@ -0,0 +1 @@
require 'has_normalized_sti'
12 changes: 12 additions & 0 deletions lib/has_normalized_sti.rb
@@ -0,0 +1,12 @@
module HasNormalizedSti
def self.included(base)
base.extend(ClassMethods)
end

module ClassMethods
def has_normalized_sti(options = {})
end
end
end

ActiveRecord::Base.send :include, HasNormalizedSti
7 changes: 7 additions & 0 deletions spec/spec_helper.rb
@@ -0,0 +1,7 @@
require 'rspec'

require 'rubygems'
require 'active_record'

$:.unshift File.dirname(__FILE__) + '/../lib'
require File.dirname(__FILE__) + '/../init'

0 comments on commit d3755e0

Please sign in to comment.