attr_cleaner 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/.rvmrc +7 -0
- data/Gemfile.lock +32 -0
- data/attr_cleaner.gemspec +4 -1
- data/lib/attr_cleaner.rb +9 -1
- data/lib/attr_cleaner/version.rb +1 -1
- metadata +36 -6
- data/lib/attr_cleaner/railtie.rb +0 -12
data/.gitignore
CHANGED
data/.rvmrc
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
attr_cleaner (0.0.3)
|
5
|
+
activerecord (~> 3.0.0)
|
6
|
+
activesupport (~> 3.0.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activemodel (3.0.3)
|
12
|
+
activesupport (= 3.0.3)
|
13
|
+
builder (~> 2.1.2)
|
14
|
+
i18n (~> 0.4)
|
15
|
+
activerecord (3.0.3)
|
16
|
+
activemodel (= 3.0.3)
|
17
|
+
activesupport (= 3.0.3)
|
18
|
+
arel (~> 2.0.2)
|
19
|
+
tzinfo (~> 0.3.23)
|
20
|
+
activesupport (3.0.3)
|
21
|
+
arel (2.0.6)
|
22
|
+
builder (2.1.2)
|
23
|
+
i18n (0.5.0)
|
24
|
+
tzinfo (0.3.23)
|
25
|
+
|
26
|
+
PLATFORMS
|
27
|
+
ruby
|
28
|
+
|
29
|
+
DEPENDENCIES
|
30
|
+
activerecord (~> 3.0.0)
|
31
|
+
activesupport (~> 3.0.0)
|
32
|
+
attr_cleaner!
|
data/attr_cleaner.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Thomas Drake-Brockman"]
|
10
10
|
s.email = ["thomas@pixent.com.au"]
|
11
|
-
s.homepage = ""
|
11
|
+
s.homepage = "https://rubygems.org/gems/attr_cleaner"
|
12
12
|
s.summary = "Cleans up model attributes."
|
13
13
|
s.description = "Strips spaces from attributes, and sets empty strings to nil."
|
14
14
|
|
@@ -16,4 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
|
+
|
20
|
+
s.add_dependency('activesupport', '~> 3.0.0')
|
21
|
+
s.add_dependency('activerecord', '~> 3.0.0')
|
19
22
|
end
|
data/lib/attr_cleaner.rb
CHANGED
@@ -1,2 +1,10 @@
|
|
1
|
+
require "active_support"
|
2
|
+
require "active_record"
|
3
|
+
|
4
|
+
require "active_support/core_ext/module/aliasing"
|
5
|
+
require "active_support/concern"
|
6
|
+
|
7
|
+
# If not using active_record require attr_cleaner/module_mixin
|
8
|
+
# and include it into your own ORM.
|
1
9
|
require "attr_cleaner/module_mixin"
|
2
|
-
|
10
|
+
ActiveRecord::Base.send(:include, AttrCleaner::ModuleMixin)
|
data/lib/attr_cleaner/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Thomas Drake-Brockman
|
@@ -16,8 +16,37 @@ cert_chain: []
|
|
16
16
|
|
17
17
|
date: 2010-12-30 00:00:00 +08:00
|
18
18
|
default_executable:
|
19
|
-
dependencies:
|
20
|
-
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: activesupport
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 3
|
30
|
+
- 0
|
31
|
+
- 0
|
32
|
+
version: 3.0.0
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: activerecord
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
segments:
|
44
|
+
- 3
|
45
|
+
- 0
|
46
|
+
- 0
|
47
|
+
version: 3.0.0
|
48
|
+
type: :runtime
|
49
|
+
version_requirements: *id002
|
21
50
|
description: Strips spaces from attributes, and sets empty strings to nil.
|
22
51
|
email:
|
23
52
|
- thomas@pixent.com.au
|
@@ -29,17 +58,18 @@ extra_rdoc_files: []
|
|
29
58
|
|
30
59
|
files:
|
31
60
|
- .gitignore
|
61
|
+
- .rvmrc
|
32
62
|
- Gemfile
|
63
|
+
- Gemfile.lock
|
33
64
|
- LICENSE
|
34
65
|
- README.rdoc
|
35
66
|
- Rakefile
|
36
67
|
- attr_cleaner.gemspec
|
37
68
|
- lib/attr_cleaner.rb
|
38
69
|
- lib/attr_cleaner/module_mixin.rb
|
39
|
-
- lib/attr_cleaner/railtie.rb
|
40
70
|
- lib/attr_cleaner/version.rb
|
41
71
|
has_rdoc: true
|
42
|
-
homepage:
|
72
|
+
homepage: https://rubygems.org/gems/attr_cleaner
|
43
73
|
licenses: []
|
44
74
|
|
45
75
|
post_install_message:
|
data/lib/attr_cleaner/railtie.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require "attr_cleaner"
|
2
|
-
require "rails"
|
3
|
-
|
4
|
-
module AttrCleaner
|
5
|
-
class Railtie < Rails::Railtie
|
6
|
-
initializer "attr_cleaner.initialize" do
|
7
|
-
ActiveSupport.on_load(:active_record) do
|
8
|
-
ActiveRecord::Base.send :include, AttrCleaner::ModuleMixin
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|