hilighter 1.5.2 → 1.5.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hilighter/methods.rb +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38a7e41d03cc21a6083c092f0e067b0ce7fb70e179a94a4d680bff20f07c3833
|
4
|
+
data.tar.gz: 8e817d830d790589ca99fe8e11caf3c0cec1a6eda9439c52f52692d321de4818
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a828064e051c5f144a3af6b7a48bf321ef6bd2b866f879e4d4fafe9e815eac62893746ae5277d60a42b6a49eda2f4a72976151fab9bd0f44fc02d41febe3f989
|
7
|
+
data.tar.gz: 61ac2c722528eef80206714b29f1c6f57c2f1ca7790354a2228f1c18647e6cbbecd1f52924d2c6bb582988560494974a9942c31e60a628888e3bf75f239fe459
|
data/lib/hilighter/methods.rb
CHANGED
@@ -87,17 +87,18 @@ class Hilighter
|
|
87
87
|
line = ""
|
88
88
|
lines = Array.new
|
89
89
|
self.split(/\s+/).each do |word|
|
90
|
-
if (
|
91
|
-
lines.push("#{line}\n")
|
90
|
+
if (line.empty?)
|
92
91
|
line = word
|
93
|
-
elsif (line.
|
92
|
+
elsif ((line.plain.size + word.plain.size) + 1 > width)
|
93
|
+
lines.push(line)
|
94
94
|
line = word
|
95
95
|
else
|
96
96
|
line += " #{word}"
|
97
97
|
end
|
98
98
|
end
|
99
|
-
lines.push(
|
100
|
-
|
99
|
+
lines.push(line) if (!line.empty?)
|
100
|
+
lines.push("") if (self.end_with?("\n"))
|
101
|
+
return lines.join("\n")
|
101
102
|
end
|
102
103
|
end
|
103
104
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hilighter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Whittaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11
|
11
|
+
date: 2019-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|