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.
Files changed (4) hide show
  1. data/Rakefile +7 -1
  2. data/VERSION +1 -1
  3. data/lib/text-formatter.rb +4 -2
  4. 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{Utilize o helper f no lugar do h e permita que o usuario utilize HTML , mas não use Javascript}
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 '&lt;javascript&gt;', '&lt;/javascript&gt;', '&lt;script&gt;' e '&lt;/script&gt;'.<br/>
12
+ Se usa dessa forma:<br/>
13
+
14
+ &lt;%=f modelo.coluna_no_banco %&gt;
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
1
+ 0.0.2
@@ -1,6 +1,8 @@
1
1
  class ActionView::Base
2
2
  def f(text)
3
- text.gsub(/<javascript>/, "")
4
- text.gsub(/<\/javascript>/, "")
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.1
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: "Utilize o helper f no lugar do h e permita que o usuario utilize HTML , mas n\xC3\xA3o use Javascript"
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 '&lt;javascript&gt;', '&lt;/javascript&gt;', '&lt;script&gt;' e '&lt;/script&gt;'.<br/>\n Se usa dessa forma:<br/>\n\n &lt;%=f modelo.coluna_no_banco %&gt;\n "
26
26
  email: nathan@vieiraproenca.com
27
27
  executables: []
28
28