epitools 0.5.44 → 0.5.45
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 +4 -4
- data/VERSION +1 -1
- data/lib/epitools/clitools.rb +0 -24
- data/lib/epitools/colored.rb +16 -0
- data/lib/epitools/path.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddab4d846566b83aec541419d90407c046cf5d02
|
4
|
+
data.tar.gz: 73162f34e533c01a7d2ae0ebd20a7b355df424e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63f0ea45189f9485f7441984d3a3f1766a6ae46f72f6a22f24d8214bba7837ed25e4e010a02485027b068e4a03a3b1ff3f7917b594c9c2a69016a31605d4ebc3
|
7
|
+
data.tar.gz: 1b796f700449c95cb22d64880b59ba155aa7655d770be146a294e734bcb061c31748f9a5626c0a1d9584cecb90b3bd453b7576550656eefda34f1e31e56fa7e2
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.45
|
data/lib/epitools/clitools.rb
CHANGED
@@ -1,25 +1,3 @@
|
|
1
|
-
require 'epitools/colored'
|
2
|
-
|
3
|
-
class String
|
4
|
-
|
5
|
-
#
|
6
|
-
# Find all occurrences of "pattern" in the string and highlight them
|
7
|
-
# with the specified color. (defaults to light_yellow)
|
8
|
-
#
|
9
|
-
# The pattern can be a string or a regular expression.
|
10
|
-
#
|
11
|
-
def highlight(pattern, color=:light_yellow, &block)
|
12
|
-
pattern = Regexp.new(Regexp.escape(pattern)) if pattern.is_a? String
|
13
|
-
|
14
|
-
if block_given?
|
15
|
-
gsub(pattern, &block)
|
16
|
-
else
|
17
|
-
gsub(pattern) { |match| match.send(color) }
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
1
|
#
|
24
2
|
# Create scrollable output via less!
|
25
3
|
#
|
@@ -182,5 +160,3 @@ def autoinstall(*packages)
|
|
182
160
|
end
|
183
161
|
end
|
184
162
|
|
185
|
-
|
186
|
-
|
data/lib/epitools/colored.rb
CHANGED
@@ -183,6 +183,22 @@ module Colored
|
|
183
183
|
end
|
184
184
|
end
|
185
185
|
|
186
|
+
#
|
187
|
+
# Find all occurrences of "pattern" in the string and highlight them
|
188
|
+
# with the specified color. (defaults to light_yellow)
|
189
|
+
#
|
190
|
+
# The pattern can be a string or a regular expression.
|
191
|
+
#
|
192
|
+
def highlight(pattern, color=:light_yellow, &block)
|
193
|
+
pattern = Regexp.new(Regexp.escape(pattern)) if pattern.is_a? String
|
194
|
+
|
195
|
+
if block_given?
|
196
|
+
gsub(pattern, &block)
|
197
|
+
else
|
198
|
+
gsub(pattern) { |match| match.send(color) }
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
186
202
|
#
|
187
203
|
# An array of all possible colors.
|
188
204
|
#
|
data/lib/epitools/path.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epitools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.45
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- epitron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.0.14
|
129
129
|
signing_key:
|
130
130
|
specification_version: 3
|
131
131
|
summary: Not utils... METILS!
|