text-formatter 0.0.1 → 0.0.2
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/Rakefile +7 -1
- data/VERSION +1 -1
- data/lib/text-formatter.rb +4 -2
- metadata +2 -2
data/Rakefile
CHANGED
@@ -6,7 +6,13 @@ begin
|
|
6
6
|
Jeweler::Tasks.new do |gem|
|
7
7
|
gem.name = "text-formatter"
|
8
8
|
gem.summary = %Q{Formata seus textos com o método f}
|
9
|
-
gem.description = %Q{
|
9
|
+
gem.description = %Q{
|
10
|
+
Gem criada para formatar textos.Ela permite que o usuário utilize código HTML mas não javascript , assim permitindo uma maior customização por parte do usuário e uma maior segurança para sua aplicação.<br/>
|
11
|
+
Adiciona o método f para o ActionView::Base , e tira todas as tags '<javascript>', '</javascript>', '<script>' e '</script>'.<br/>
|
12
|
+
Se usa dessa forma:<br/>
|
13
|
+
|
14
|
+
<%=f modelo.coluna_no_banco %>
|
15
|
+
}
|
10
16
|
gem.email = "nathan@vieiraproenca.com"
|
11
17
|
gem.homepage = "http://github.com/NathanProenca/text-formatter"
|
12
18
|
gem.authors = ["nathanProenca"]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/lib/text-formatter.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
class ActionView::Base
|
2
2
|
def f(text)
|
3
|
-
|
4
|
-
|
3
|
+
[/<script(.)*">/ , /<\/script>/ , /<javascript(.)*">/ , /<\/javascript>/].each do |pdr|
|
4
|
+
text = text.gsub( pdr , "" ) if text =~ pdr
|
5
|
+
end
|
6
|
+
text
|
5
7
|
end
|
6
8
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: text-formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nathanProenca
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: "0"
|
24
24
|
version:
|
25
|
-
description: "
|
25
|
+
description: "\n Gem criada para formatar textos.Ela permite que o usu\xC3\xA1rio utilize c\xC3\xB3digo HTML mas n\xC3\xA3o javascript , assim permitindo uma maior customiza\xC3\xA7\xC3\xA3o por parte do usu\xC3\xA1rio e uma maior seguran\xC3\xA7a para sua aplica\xC3\xA7\xC3\xA3o.<br/>\n Adiciona o m\xC3\xA9todo f para o ActionView::Base , e tira todas as tags '<javascript>', '</javascript>', '<script>' e '</script>'.<br/>\n Se usa dessa forma:<br/>\n\n <%=f modelo.coluna_no_banco %>\n "
|
26
26
|
email: nathan@vieiraproenca.com
|
27
27
|
executables: []
|
28
28
|
|