railhead_autoformat 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/railhead_autoformat.rb +2 -6
- data/railhead_autoformat.gemspec +1 -1
- metadata +40 -25
data/lib/railhead_autoformat.rb
CHANGED
@@ -8,16 +8,12 @@ module RailheadAutoformat
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
def format(text)
|
12
|
-
text.gsub(/ +/, ' ').strip
|
13
|
-
end
|
14
|
-
|
15
11
|
def format_fields
|
16
12
|
self.class.columns.each do |column|
|
17
13
|
next unless column.type == :string or column.type == :text
|
18
14
|
field = column.name.to_sym
|
19
|
-
if self[field].is_a?(String)
|
20
|
-
self[field] =
|
15
|
+
if self[field].is_a?(String) and not (format_options and format_options[:except].include?(field))
|
16
|
+
self[field] = self[field].gsub(/ +/, ' ').strip
|
21
17
|
end
|
22
18
|
end
|
23
19
|
end
|
data/railhead_autoformat.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "railhead_autoformat"
|
3
|
-
s.version = "0.0.
|
3
|
+
s.version = "0.0.2"
|
4
4
|
s.date = "2012-08-15"
|
5
5
|
s.summary = "RailheadAutoformat is a Ruby on Rails plugin that automatically cleans up input fields."
|
6
6
|
s.email = "nagybence@tipogral.hu"
|
metadata
CHANGED
@@ -1,54 +1,69 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: railhead_autoformat
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Bence Nagy
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
16
|
+
|
17
|
+
date: 2012-08-15 00:00:00 +02:00
|
18
|
+
default_executable:
|
13
19
|
dependencies: []
|
14
|
-
|
15
|
-
|
20
|
+
|
21
|
+
description: RailheadAutoformat is a Ruby on Rails plugin that automatically cleans up input fields.
|
16
22
|
email: nagybence@tipogral.hu
|
17
23
|
executables: []
|
24
|
+
|
18
25
|
extensions: []
|
19
|
-
|
26
|
+
|
27
|
+
extra_rdoc_files:
|
20
28
|
- README.rdoc
|
21
|
-
files:
|
29
|
+
files:
|
22
30
|
- MIT-LICENSE
|
23
31
|
- README.rdoc
|
24
32
|
- init.rb
|
25
33
|
- railhead_autoformat.gemspec
|
26
34
|
- lib/railhead_autoformat.rb
|
35
|
+
has_rdoc: true
|
27
36
|
homepage: http://github.com/nagybence/railhead_autoformat
|
28
37
|
licenses: []
|
38
|
+
|
29
39
|
post_install_message:
|
30
|
-
rdoc_options:
|
40
|
+
rdoc_options:
|
31
41
|
- --main
|
32
42
|
- README.rdoc
|
33
|
-
require_paths:
|
43
|
+
require_paths:
|
34
44
|
- lib
|
35
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
46
|
none: false
|
37
|
-
requirements:
|
38
|
-
- -
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
|
41
|
-
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
segments:
|
51
|
+
- 0
|
52
|
+
version: "0"
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
54
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
47
61
|
requirements: []
|
62
|
+
|
48
63
|
rubyforge_project:
|
49
|
-
rubygems_version: 1.
|
64
|
+
rubygems_version: 1.3.7
|
50
65
|
signing_key:
|
51
66
|
specification_version: 3
|
52
|
-
summary: RailheadAutoformat is a Ruby on Rails plugin that automatically cleans up
|
53
|
-
input fields.
|
67
|
+
summary: RailheadAutoformat is a Ruby on Rails plugin that automatically cleans up input fields.
|
54
68
|
test_files: []
|
69
|
+
|