pretty_strings 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -6
- data/lib/pretty_strings/version.rb +1 -1
- data/lib/pretty_strings.rb +2 -2
- data/pretty_strings.gemspec +0 -1
- data/spec/pretty_strings_spec.rb +10 -0
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 590082fe95de35d013970dd8894e18c09cd3cfe3
|
4
|
+
data.tar.gz: c2e878acc85cc63d60a7719f7b73adfa3afc1db0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aca5cdb756ed72dae588b6429232ab7a85e6c137cca7b125cec7ef1a9d8a326b712cac12db0ea073732b7ceb324174ea8e7acf412350013694424ee1e8567429
|
7
|
+
data.tar.gz: 1bca232a2195c1fcf51d83ec5f0e50551bd68c15665be20c028ffd6b28300e507c5c68396482f30403df59a272783cf60ff7cf7ae5b3ffee6f4e4c5f28154ad0
|
data/README.md
CHANGED
@@ -28,12 +28,6 @@ PrettyStrings::Cleaner.new(text).pretty
|
|
28
28
|
# => "The SuperTrack system is easy to set up and use, providing real-time insight and stats."
|
29
29
|
```
|
30
30
|
|
31
|
-
## Development
|
32
|
-
|
33
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
34
|
-
|
35
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
36
|
-
|
37
31
|
## Contributing
|
38
32
|
|
39
33
|
1. Fork it ( https://github.com/diasks2/pretty_strings/fork )
|
data/lib/pretty_strings.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require "pretty_strings/version"
|
2
|
-
require "rails-html-sanitizer"
|
3
2
|
|
4
3
|
module PrettyStrings
|
5
4
|
class Cleaner
|
@@ -73,7 +72,8 @@ module PrettyStrings
|
|
73
72
|
end
|
74
73
|
|
75
74
|
def sanitize_text(text)
|
76
|
-
|
75
|
+
text.gsub!(/(<[^>\d\/][^>]*>)|\n\t/, '') || text
|
76
|
+
text.gsub!(/(<\/[^>\d][^>]*>)|\n\t/, '') || text
|
77
77
|
end
|
78
78
|
|
79
79
|
def scan_for_code(text)
|
data/pretty_strings.gemspec
CHANGED
@@ -18,7 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_runtime_dependency "rails-html-sanitizer"
|
22
21
|
spec.add_development_dependency "bundler", "~> 1.9"
|
23
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
23
|
spec.add_development_dependency "rspec"
|
data/spec/pretty_strings_spec.rb
CHANGED
@@ -139,4 +139,14 @@ describe PrettyStrings do
|
|
139
139
|
text = "hello...what is your name."
|
140
140
|
expect(PrettyStrings::Cleaner.new(text).pretty).to eq("hello...what is your name.")
|
141
141
|
end
|
142
|
+
|
143
|
+
it "prettifies example #028" do
|
144
|
+
text = "hello <3 and </3 and the temp is <8 and >6...what is your name."
|
145
|
+
expect(PrettyStrings::Cleaner.new(text).pretty).to eq("hello <3 and </3 and the temp is <8 and >6...what is your name.")
|
146
|
+
end
|
147
|
+
|
148
|
+
it "prettifies example #029" do
|
149
|
+
text = "hello <h1>This is HTML</h1>."
|
150
|
+
expect(PrettyStrings::Cleaner.new(text).pretty).to eq("hello This is HTML.")
|
151
|
+
end
|
142
152
|
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretty_strings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin S. Dias
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rails-html-sanitizer
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: bundler
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|