pretty_strings 0.4.0 → 0.5.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ff8178afecac1b22dae2a3f3aa53af39f3521a5
4
- data.tar.gz: 5c907cc787b34369cefe91d1af62157d8dfcf02b
3
+ metadata.gz: 590082fe95de35d013970dd8894e18c09cd3cfe3
4
+ data.tar.gz: c2e878acc85cc63d60a7719f7b73adfa3afc1db0
5
5
  SHA512:
6
- metadata.gz: b83673da5b1c6f9f3ff3207cf547fb513dfbbf6a61bd95ce489fcae2d330901d72f29b45b13f342af5768e9c307bc91bb949480a6e680f7f0575db12f9c6536d
7
- data.tar.gz: bbb30c81a6ca195531cf103b1ab85f0760808adc7760c5e2fa96551535cbd5f31e5487fa0afbcd3076235b485a9935455521f88cf8d574128b87a310e7644b1b
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 )
@@ -1,3 +1,3 @@
1
1
  module PrettyStrings
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -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
- Rails::Html::FullSanitizer.new.sanitize(text)
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)
@@ -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"
@@ -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.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-22 00:00:00.000000000 Z
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