preformatter 0.5.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/preformatter.rb +10 -0
- data/preformatter.gemspec +4 -4
- metadata +25 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.7.0
|
data/lib/preformatter.rb
CHANGED
@@ -65,6 +65,16 @@ module Preformatter
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
+
def remove_extra_white_spaces(*args)
|
69
|
+
args.each do |field|
|
70
|
+
before_validation do |record|
|
71
|
+
attribute = record.send("#{field.to_s}")
|
72
|
+
attribute = attribute.strip.gsub(/[ ]+/, ' ') unless attribute.nil?
|
73
|
+
attribute
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
68
78
|
end
|
69
79
|
|
70
80
|
|
data/preformatter.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{preformatter}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.7.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Adrian Cuadros", "Eduardo Moreno", "Andres Paglayan"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-07-07}
|
13
13
|
s.description = %q{The gem helps you by deleting spaces, special characters or replacing accents in the fields you need.}
|
14
14
|
s.email = %q{adrian@innku.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
s.homepage = %q{http://github.com/adriancuadros/preformatter}
|
30
30
|
s.rdoc_options = ["--charset=UTF-8"]
|
31
31
|
s.require_paths = ["lib"]
|
32
|
-
s.rubygems_version = %q{1.3.
|
32
|
+
s.rubygems_version = %q{1.3.7}
|
33
33
|
s.summary = %q{Does basic preformatting of information before creating a record}
|
34
34
|
s.test_files = [
|
35
35
|
"test/app/controllers/application_controller.rb",
|
@@ -55,7 +55,7 @@ Gem::Specification.new do |s|
|
|
55
55
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
56
56
|
s.specification_version = 3
|
57
57
|
|
58
|
-
if Gem::Version.new(Gem::
|
58
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
59
59
|
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
60
60
|
else
|
61
61
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 7
|
8
|
+
- 0
|
9
|
+
version: 0.7.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Adrian Cuadros
|
@@ -16,13 +16,14 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-
|
19
|
+
date: 2010-07-07 00:00:00 -05:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: thoughtbot-shoulda
|
24
24
|
prerelease: false
|
25
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
26
27
|
requirements:
|
27
28
|
- - ">="
|
28
29
|
- !ruby/object:Gem::Version
|
@@ -49,6 +50,23 @@ files:
|
|
49
50
|
- VERSION
|
50
51
|
- lib/preformatter.rb
|
51
52
|
- preformatter.gemspec
|
53
|
+
- test/app/controllers/application_controller.rb
|
54
|
+
- test/app/helpers/application_helper.rb
|
55
|
+
- test/config/boot.rb
|
56
|
+
- test/config/environment.rb
|
57
|
+
- test/config/environments/development.rb
|
58
|
+
- test/config/environments/production.rb
|
59
|
+
- test/config/environments/test.rb
|
60
|
+
- test/config/initializers/backtrace_silencers.rb
|
61
|
+
- test/config/initializers/inflections.rb
|
62
|
+
- test/config/initializers/mime_types.rb
|
63
|
+
- test/config/initializers/new_rails_defaults.rb
|
64
|
+
- test/config/initializers/session_store.rb
|
65
|
+
- test/config/routes.rb
|
66
|
+
- test/db/migrate/20100524181952_add_ascii_name_to_users.rb
|
67
|
+
- test/db/seeds.rb
|
68
|
+
- test/test/performance/browsing_test.rb
|
69
|
+
- test/test/test_helper.rb
|
52
70
|
has_rdoc: true
|
53
71
|
homepage: http://github.com/adriancuadros/preformatter
|
54
72
|
licenses: []
|
@@ -59,6 +77,7 @@ rdoc_options:
|
|
59
77
|
require_paths:
|
60
78
|
- lib
|
61
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
62
81
|
requirements:
|
63
82
|
- - ">="
|
64
83
|
- !ruby/object:Gem::Version
|
@@ -66,6 +85,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
66
85
|
- 0
|
67
86
|
version: "0"
|
68
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
69
89
|
requirements:
|
70
90
|
- - ">="
|
71
91
|
- !ruby/object:Gem::Version
|
@@ -75,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
95
|
requirements: []
|
76
96
|
|
77
97
|
rubyforge_project:
|
78
|
-
rubygems_version: 1.3.
|
98
|
+
rubygems_version: 1.3.7
|
79
99
|
signing_key:
|
80
100
|
specification_version: 3
|
81
101
|
summary: Does basic preformatting of information before creating a record
|