qf 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +21 -0
  3. data/README.md +36 -8
  4. data/bin/qf +3 -3
  5. data/lib/qf/version.rb +1 -1
  6. data/lib/rules.rb +1 -1
  7. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f4d166e63208746ed68d83bec31a4dd713dde77
4
- data.tar.gz: 5703b3fb473441f2a473d96a11e1156cf98a1016
3
+ metadata.gz: 908aed30075ea00d838181b2253bc8df9754e13e
4
+ data.tar.gz: dd6b16e7748b730cdf8cd3e1622ea7223abb3edb
5
5
  SHA512:
6
- metadata.gz: af6371bf2ca69ddf2ea8334789bc4f4d9295969f06214540a2fef43f5ca953c84e98e465aa47ea56f9d49cfe007a0aa72cb7ae9ad58ec53e5eec508393f1fe98
7
- data.tar.gz: c4c17071ddc70fa93ca8d26f245ef73858e9d1984206cb08b842b81a0fc5eedf325b87f1ef35a5c30e8eb2d89dda832f3384578d3be169f5b90d3c5ecd7755f9
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 ruby gem that extracts specific substrings from a block of text. Examples of substrings are the following, but not limited to: emails, URIs, magnets links, ipv4, ipv6 addresses, etc.
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 creditcard:visa
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 unix application.
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 cards from some csv file:
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 www.linux.com/contact | qf email
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
- Bug reports and pull requests are welcome on GitHub at https://github.com/krmbzds/qf.
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
@@ -17,10 +17,10 @@ require 'rules'
17
17
  qf url
18
18
  qf magnet
19
19
  qf creditcard
20
- qf creditcard:visa
20
+ qf ipv4
21
+
22
+ This application uses standard input and output.
21
23
 
22
- This application standard input and output.
23
-
24
24
  '
25
25
 
26
26
  def parse_options
@@ -1,3 +1,3 @@
1
1
  class Qf
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  RULES = {
2
- 'url' => '(^$)|(^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)',
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.2
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-23 00:00:00.000000000 Z
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