http_find 0.1.1 → 0.1.3
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/README.md +3 -3
- data/lib/http_find/output.rb +4 -2
- data/lib/http_find/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed8fb2460352956373f577f5ba5cdcae92bb3267
|
4
|
+
data.tar.gz: 5512b95172ccdd7fb78b66a06dd37d8c9e2e96eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e06b0d0321ecd6b81b9204299f3374ef57e28ae03bb288cf4f7e9a9c4dabce4a584de84c1ddd45b99a2ae327c8cdf44493bba5f7882cf7f3ecea32646ba770d2
|
7
|
+
data.tar.gz: a8beaddae1653d2ee757d8c1c1291707335d4ffb3ff4766dc387af748edd36adbcdae76b995397779d5cb0fe47333abbd7502f7156cdcf000a4e2be2903daf5d
|
data/README.md
CHANGED
@@ -28,14 +28,14 @@ Installing this gem will add the executable `httpfind` to your system.
|
|
28
28
|
With `httpfind` in your $PATH, usage looks like:
|
29
29
|
|
30
30
|
```
|
31
|
-
$ httpfind [
|
31
|
+
$ httpfind [options] URI TERM
|
32
32
|
```
|
33
33
|
|
34
34
|
This will search the HTTP GET response from `URI` for the specified `TERM`.
|
35
35
|
|
36
36
|
`TERM` may be either a simple string or a regular expression in the form
|
37
|
-
`$ httpfind -e http://example.com '\d.{2} one'` (note the `-e`
|
38
|
-
Check `$httpfind help` for more info.
|
37
|
+
`$ httpfind -e http://example.com '\d.{2} one'` (note the `-e` option).
|
38
|
+
Check `$httpfind --help` for more info.
|
39
39
|
|
40
40
|
## Development
|
41
41
|
|
data/lib/http_find/output.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
module HttpFind
|
2
2
|
class Output
|
3
|
+
LINENUM_COLOR = :light_black
|
4
|
+
|
3
5
|
def initialize(matches)
|
4
6
|
@matches = matches
|
5
7
|
end
|
@@ -7,9 +9,9 @@ module HttpFind
|
|
7
9
|
def lines
|
8
10
|
justlen = @matches.map { |m| m[:line] }.sort.last.to_s.length
|
9
11
|
@matches.map do |m|
|
10
|
-
line = m[:line].to_s
|
12
|
+
line = m[:line].to_s.rjust(justlen).colorize(LINENUM_COLOR)
|
11
13
|
text = m[:text]
|
12
|
-
"
|
14
|
+
line + " | ".colorize(LINENUM_COLOR) + text
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
data/lib/http_find/version.rb
CHANGED