Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

gemspec, README and a few other changes to support gem install

  • Loading branch information...
commit dad1acd92e8ba373a8f70a1fa0269a6ce342a1ed 1 parent 5a1c2e4
alex authored
View
1  .gitignore
@@ -5,3 +5,4 @@
debug.log
coverage
coverage.data
+pkg/
View
4 README.markdown
@@ -3,6 +3,8 @@
This ActiverRecord plugin allows you to easily define and pull statistics for AR models. This plugin was built with reporting in mind.
## Installation
+ gem install statistics
+OR
script/plugin install git://github.com/acatighera/statistics.git
## Examples
@@ -60,6 +62,8 @@ This is a new feature that uses `Rails.cache`. You can cache certain statistics
Account.statistics(:state => 'PA') # This call generates a SQL query because the user count for NY and PA could be different (and probably is)
+Note: If you want Rails.cache to work properly, you need to use mem_cache_store in your rails enviroment file (ie. `config.cache_store = :mem_cache_store` in your enviroment.rb file).
+
#### Standardized
All ActiveRecord classes now respond to `statistics` and `get_stat` methods
View
13 Rakefile
@@ -0,0 +1,13 @@
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gemspec|
+ gemspec.name = "statistics"
+ gemspec.summary = "An ActiveRecord gem that makes it easier to do reporting."
+ gemspec.email = "acatighera@gmail.com"
+ gemspec.homepage = "http://github.com/acatighera/statistics"
+ gemspec.authors = ["Alexandru Catighera"]
+ end
+rescue LoadError
+ puts "Jeweler not available. Install it with: sudo gem install jeweler"
+end
+
View
1  init.rb
@@ -1,2 +1 @@
require File.join(File.dirname(__FILE__), 'lib', 'statistics')
-ActiveRecord::Base.send(:include, Statistics)
View
3  lib/statistics.rb
@@ -176,5 +176,6 @@ def sql_options(options)
options
end
end
-
end
+
+ActiveRecord::Base.send(:include, Statistics)
View
48 statistics.gemspec
@@ -0,0 +1,48 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{statistics}
+ s.version = "0.1.1"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Alexandru Catighera"]
+ s.date = %q{2009-12-16}
+ s.email = %q{acatighera@gmail.com}
+ s.extra_rdoc_files = [
+ "README.markdown"
+ ]
+ s.files = [
+ ".gitignore",
+ "CHANGES.markdown",
+ "MIT-LICENSE",
+ "README.markdown",
+ "Rakefile",
+ "VERSION",
+ "init.rb",
+ "lib/statistics.rb",
+ "statistics.gemspec",
+ "test/statistics_test.rb"
+ ]
+ s.homepage = %q{http://github.com/acatighera/statistics}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{An ActiveRecord gem that makes it easier to do reporting.}
+ s.test_files = [
+ "test/statistics_test.rb"
+ ]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ else
+ end
+ else
+ end
+end
+
Please sign in to comment.
Something went wrong with that request. Please try again.