pretty_strings 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pretty_strings.rb +6 -1
- data/lib/pretty_strings/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69f404ce3a7e5b50beaffbb42b695c5f110dd9a8
|
4
|
+
data.tar.gz: 7d06f91be8f0c05f6708ef9b49e90834e4628e23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b22be2ebfac04032d66f97c3c262584492ff5fb97be573db5fb3a58b2694750f513f07887ab4e957fbb2861d78dbc8ce1dd1ce85b00b1fef10e41a8e5ad6a82
|
7
|
+
data.tar.gz: 65c535c17ddcb8c4641120899a4a4174bf184dae6c6c9daf5d0d6f01348548410940f6082ebaaa9584d6605c3c27131bc4664be7f67bcf1e060b6acbc724fd45
|
data/lib/pretty_strings.rb
CHANGED
@@ -11,6 +11,7 @@ module PrettyStrings
|
|
11
11
|
def pretty
|
12
12
|
return '' if text.nil? || text.empty?
|
13
13
|
remove_bracketed_numbers(
|
14
|
+
remove_consecutive_dots(
|
14
15
|
replace_symbol_with_bracket(
|
15
16
|
remove_newlines(
|
16
17
|
replace_tabs(
|
@@ -23,7 +24,7 @@ module PrettyStrings
|
|
23
24
|
sanitize_text(
|
24
25
|
replace_bracket_with_symbol(
|
25
26
|
text
|
26
|
-
)))))))))))).squeeze(" ").strip
|
27
|
+
))))))))))))).squeeze(" ").strip
|
27
28
|
end
|
28
29
|
|
29
30
|
private
|
@@ -51,6 +52,10 @@ module PrettyStrings
|
|
51
52
|
text.gsub!(/⚘/, '{') || text
|
52
53
|
end
|
53
54
|
|
55
|
+
def remove_consecutive_dots(text)
|
56
|
+
text.gsub!(/\.{5,}/, '') || text
|
57
|
+
end
|
58
|
+
|
54
59
|
def replace_bracket_with_symbol(text)
|
55
60
|
text.gsub!(/<(?=\s*\d+)/, '♳') || text
|
56
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretty_strings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin S. Dias
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails-html-sanitizer
|