qf 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/README.md +36 -8
- data/bin/qf +3 -3
- data/lib/qf/version.rb +1 -1
- data/lib/rules.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 908aed30075ea00d838181b2253bc8df9754e13e
|
4
|
+
data.tar.gz: dd6b16e7748b730cdf8cd3e1622ea7223abb3edb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c65f5e27429e9c9f46eaf83d563d5598b7cd792b778b1b4d7aa50596deee1cb30dd9de445db086ed89f97a2af8aaa524be3e470cbd9e0952267bd00780afe03
|
7
|
+
data.tar.gz: 92e79ae1d0b39a9728108860467274cedddb6e120c6a4c883d05e369d19bfb4c53d094a53e8e00cdfcd2eb6a980ff282ac99ac64c3f745a85b847efa625a5a01
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Kerem Bozdas
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -4,7 +4,19 @@
|
|
4
4
|
[![Code Climate](https://img.shields.io/codeclimate/github/krmbzds/qf.svg)](https://codeclimate.com/github/krmbzds/qf)
|
5
5
|
[![Gem](https://img.shields.io/gem/dv/qf/stable.svg)](https://rubygems.org/gems/qf)
|
6
6
|
|
7
|
-
qf is a
|
7
|
+
**qf** is a Ruby gem that extracts specific substrings from a block of text.
|
8
|
+
|
9
|
+
**qf** is a productivity tool, it behaves like a standard Unix application and can be chained with other Unix commands.
|
10
|
+
|
11
|
+
It helps you extract:
|
12
|
+
|
13
|
+
* Emails
|
14
|
+
* URLs
|
15
|
+
* Magnet Links
|
16
|
+
* IPv4 & IPv6 Addressses
|
17
|
+
* Credit Card Numbers
|
18
|
+
|
19
|
+
.. and **much more** from any stream with flexibility and convenience.
|
8
20
|
|
9
21
|
## Installation
|
10
22
|
|
@@ -35,14 +47,14 @@ Examples
|
|
35
47
|
qf url
|
36
48
|
qf magnet
|
37
49
|
qf creditcard
|
38
|
-
qf
|
50
|
+
qf ipv4
|
39
51
|
|
40
|
-
This application standard input and output.
|
52
|
+
This application uses standard input and output.
|
41
53
|
```
|
42
54
|
|
43
55
|
## Examples
|
44
56
|
|
45
|
-
qf behaves like a standard
|
57
|
+
**qf** behaves like a standard Unix application.
|
46
58
|
|
47
59
|
Let's say you want to extract URLs from a website:
|
48
60
|
|
@@ -50,16 +62,16 @@ Let's say you want to extract URLs from a website:
|
|
50
62
|
curl kerembozdas.com | qf url
|
51
63
|
```
|
52
64
|
|
53
|
-
Or credit
|
65
|
+
Or extract and save credit card numbers from a csv file:
|
54
66
|
|
55
67
|
```sh
|
56
|
-
cat customers.csv | qf creditcard
|
68
|
+
cat customers.csv | qf creditcard > customer_ccn.txt
|
57
69
|
```
|
58
70
|
|
59
71
|
Emails from some contact page:
|
60
72
|
|
61
73
|
```sh
|
62
|
-
curl
|
74
|
+
curl linux.com/contact | qf email
|
63
75
|
```
|
64
76
|
|
65
77
|
To see all the options you can use:
|
@@ -70,6 +82,22 @@ qf --list
|
|
70
82
|
|
71
83
|
## Contributing
|
72
84
|
|
73
|
-
|
85
|
+
1. Fork it (https://github.com/krmbzds/qf/fork)
|
86
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
87
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
88
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
89
|
+
5. Create a new Pull Request
|
90
|
+
|
91
|
+
**Hint:** You can add new rules to the `rules.rb` file.
|
92
|
+
|
93
|
+
## Trivia
|
94
|
+
|
95
|
+
**qf** (pronounced as **/kjuː eff/**) is short for **quick fetch**, or **quick find**.
|
96
|
+
However, similar to how people pronounce **SQL** as **sequel**, the author likes to pronounce **qf** as **queef**.
|
97
|
+
|
98
|
+
## License
|
99
|
+
|
100
|
+
The MIT License (MIT)
|
101
|
+
Copyright (c) 2016 Kerem Bozdas
|
74
102
|
|
75
103
|
[logo]: http://i.imgur.com/PQxBoRI.png
|
data/bin/qf
CHANGED
data/lib/qf/version.rb
CHANGED
data/lib/rules.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
RULES = {
|
2
|
-
'url' => '
|
2
|
+
'url' => 'http://[^"]*',
|
3
3
|
'email' => '[a-zA-Z0-9_.+\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+',
|
4
4
|
'magnet' => 'magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}',
|
5
5
|
'ipv4' => '(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)',
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kerem Bozdas
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-01-
|
13
|
+
date: 2016-01-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- ".ruby-version"
|
71
71
|
- ".travis.yml"
|
72
72
|
- Gemfile
|
73
|
+
- LICENSE
|
73
74
|
- README.md
|
74
75
|
- Rakefile
|
75
76
|
- bin/console
|