gman 3.0.2 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bc0d3fa221fe624e6befd6300c367e526ea520e
4
- data.tar.gz: 47a305176a8f7108f2803608b96bb88e1b1f112a
3
+ metadata.gz: f047f7772a6191964d2796fa888384d8a57ac5d2
4
+ data.tar.gz: 5fe4fcfb30848a9b87fa45dda502e61fc37ef5f3
5
5
  SHA512:
6
- metadata.gz: d96b144d0122da83ce03c2b384464a1943abaec5d58f3b84c9aaabb49450d028dee06caaac5cc8805fc1385cefec5cef48b0370348578d3ea4f122fe4b2f8304
7
- data.tar.gz: a3380739bba14684868e48674102647ed47ed892a4c4f12e1aff724d150a8330fbeced47f03656e6b5fcc7a458a844d741f05e5b550d10f3c597a98e8d0e7550
6
+ metadata.gz: 1358a11511b15ebbd3ecb5c32664debe1080c1087741f02a9bb496e895087e6f3ff7d4f5e77924c4e66910cbbed47b61048c6c73e3c5613f098128564677e35f
7
+ data.tar.gz: bab8164ba21dee01b5ce7d09a1d0d2b33d43f324698aab55b62f6029765e77c996ee7c11dfbee6876f4007afe5af6ad67fdc09f9c3174e6ca3b9890ded9deb84
data/README.md CHANGED
@@ -51,6 +51,14 @@ domain.country.currency #=> "USD"
51
51
  domain.conutry.calling_code #=> "+1"
52
52
  ```
53
53
 
54
+ ### Command line
55
+
56
+ Filters newline-separated email addresses from stdin. Example usage:
57
+
58
+ ```
59
+ $ gman_filter < path/to/list/of/addresses.txt
60
+ ```
61
+
54
62
  ## Contributing
55
63
 
56
64
  Contributions welcome! Please see [the contribution guidelines](CONTRIBUTING.md) for code contributions or for details on how to add, update, or delete government domains.
data/bin/gman_filter ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ # Given a list of newline-separated email addresses, retain only government/military
3
+
4
+ require "./lib/gman"
5
+
6
+ # Auto-flush
7
+ STDOUT.sync = true
8
+ STDERR.sync = true
9
+
10
+ ARGF.each do |line|
11
+ begin
12
+ puts line if Gman.valid?(line)
13
+ rescue
14
+ STDERR.write "Couldn't parse #{line}"
15
+ end
16
+ end
data/gman.gemspec CHANGED
@@ -20,12 +20,16 @@ Gem::Specification.new do |s|
20
20
  "lib/gman/version.rb",
21
21
  "script/build",
22
22
  "script/release",
23
+ "bin/gman_filter",
23
24
  "gman.gemspec",
24
25
  "test/helper.rb",
25
26
  "test/test_gman.rb",
26
27
  "Rakefile",
27
28
  ".gitignore"
28
29
  ]
30
+
31
+ s.executables << "gman_filter"
32
+
29
33
  s.require_paths = ["lib"]
30
34
  s.add_dependency( "public_suffix", '~> 1.4')
31
35
  s.add_dependency( "swot", '~> 0.3.1' )
data/lib/gman/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Gman
2
- VERSION = '3.0.2'
2
+ VERSION = '3.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gman
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-14 00:00:00.000000000 Z
11
+ date: 2014-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: public_suffix
@@ -125,7 +125,8 @@ dependencies:
125
125
  description: A ruby gem to check if the owner of a given email address is working
126
126
  for THE MAN.
127
127
  email: ben.balter@github.com
128
- executables: []
128
+ executables:
129
+ - gman_filter
129
130
  extensions: []
130
131
  extra_rdoc_files: []
131
132
  files:
@@ -135,6 +136,7 @@ files:
135
136
  - LICENSE
136
137
  - README.md
137
138
  - Rakefile
139
+ - bin/gman_filter
138
140
  - gman.gemspec
139
141
  - lib/domains.txt
140
142
  - lib/gman.rb