Permalink
Browse files

Add gemspec.

  • Loading branch information...
1 parent 9cac024 commit 6c03fabb3b2bb2a1f11c0732792bd89923e0ceed @drewolson committed Apr 10, 2012
Showing with 35 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 Gemfile
  3. +6 −4 Gemfile.lock
  4. +3 −1 lib/params_cleaner.rb
  5. +17 −0 params_cleaner.gemspec
  6. +6 −0 spec/params_cleaner_spec.rb
  7. +1 −1 spec/spec_helper.rb
View
@@ -1,3 +1,4 @@
/bin
/.bundle
/vendor/bundle
+/*.gem
View
@@ -1,6 +1,6 @@
source "http://rubygems.org"
-gem "active_support", "~>3.0.0"
+gem "activesupport", "~>3.2.3"
group :development do
gem "rake", "0.9.2.2"
View
@@ -1,10 +1,12 @@
GEM
remote: http://rubygems.org/
specs:
- active_support (3.0.0)
- activesupport (= 3.0.0)
- activesupport (3.0.0)
+ activesupport (3.2.3)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
diff-lcs (1.1.3)
+ i18n (0.6.0)
+ multi_json (1.2.0)
rake (0.9.2.2)
rake_commit (0.12.0)
rspec (2.9.0)
@@ -20,7 +22,7 @@ PLATFORMS
ruby
DEPENDENCIES
- active_support (~> 3.0.0)
+ activesupport (~> 3.2.3)
rake (= 0.9.2.2)
rake_commit (= 0.12.0)
rspec (= 2.9.0)
@@ -1,9 +1,11 @@
-require "active_support"
+require "active_support/concern"
require "active_support/core_ext/hash/slice"
module ParamsCleaner
extend ActiveSupport::Concern
+ VERSION = "0.1.0"
+
def clean_params(root_params = params)
cleaned_params = root_params.map do |key, val|
if val.is_a?(Hash)
@@ -0,0 +1,17 @@
+# -*- encoding: utf-8 -*-
+require File.expand_path("../lib/params_cleaner", __FILE__)
+
+Gem::Specification.new do |gem|
+ gem.authors = ["Drew Olson"]
+ gem.email = ["drew@drewolson.org"]
+ gem.description = %q{Rails mass assignment protection in the controller}
+ gem.summary = %q{Rails mass assignment protection in the controller}
+ gem.homepage = "https://github.com/drewolson/params_cleaner"
+
+ gem.files = Dir.glob("lib/**/*.rb")
+ gem.name = "params_cleaner"
+ gem.require_paths = ["lib"]
+ gem.version = ParamsCleaner::VERSION
+
+ gem.add_dependency "activesupport", "~> 3.2.3"
+end
@@ -1,6 +1,12 @@
require "spec_helper"
describe ParamsCleaner do
+ describe "version" do
+ it "is 0.1.0" do
+ ParamsCleaner::VERSION.should == "0.1.0"
+ end
+ end
+
describe "clean_params" do
it "returns params that respect the allowed_params" do
klass = Class.new do
View
@@ -1 +1 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "params_cleaner"))
+require File.expand_path("../../lib/params_cleaner", __FILE__)

0 comments on commit 6c03fab

Please sign in to comment.