dronebl.rb 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/dronebl-add +9 -9
  3. data/bin/dronebl-query +5 -5
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90452b68385bacb07b71362b95b43f9529c52a00
4
- data.tar.gz: c6c7ac736b865e46054effce79866393a7174280
3
+ metadata.gz: 5f37b2955dc619fdf8bd836a76147e8b32a52de9
4
+ data.tar.gz: 5c467fa4f41e38f587261fdeb2f89811cfe052d0
5
5
  SHA512:
6
- metadata.gz: cac7d9db9af50b35875a0a596d33e53c4b6c66d82ed3dd09a3cc0b08c02eb3486b7551cc27422e5d081734f92575b79725fa7d793a73a66ed800ff3951d1ad88
7
- data.tar.gz: afc184cfb563ca52072ae0f87285abd8d1b4344206940966acb47acf13025ec08843594dcba74c813e027608f7930df8b30371cb105fb1a0632dc700558f3f35
6
+ metadata.gz: 9657a44c6692e019e5c2a34e7f2cbb3475a0ea2c6e723f08cfbbe364dd2142e97e6e708660664cf73e8a540b2bf81d94cb2df055c81550fc63e6f3ad6d05d182
7
+ data.tar.gz: 7bf45c7052d0051524e198532b951f33563fa5fb76bf740fd0e3c8ae3848d8347a989718a77ac6078cfb0362e24919b66f5c5a9fb6b33c5259bd7061c9dd631f
data/bin/dronebl-add CHANGED
@@ -24,7 +24,7 @@ class Options
24
24
  opts.on('-k', '--key KEY', String, 'Use KEY as your DroneBL RPC2 key') do |key|
25
25
  @key_str = key
26
26
  end
27
- opts.on('-f', '--keyfile [FILE_PATH]', 'Read the file at FILE_PATH and use it as the RPC key') do |path|
27
+ opts.on('-f', '--keyfile FILE_PATH', 'Read the file at FILE_PATH and use it as the RPC key') do |path|
28
28
  @use_key_file = true
29
29
  @key_file = path
30
30
  end
@@ -35,7 +35,7 @@ class Options
35
35
  puts DroneBL::TYPES.map { |k, v| "#{k} : #{v}"}.join("\n")
36
36
  exit
37
37
  end
38
- opts.on('-c', '--comment [COMMENT]', String, 'Attach the given comment to the listings.') do |comment|
38
+ opts.on('-c', '--comment COMMENT', String, 'Attach the given comment to the listings.') do |comment|
39
39
  @comment = comment
40
40
  opts.on('-u', '--use-key-file', 'Use the default key file located at ~/.droneblkey') do
41
41
  @use_key_file = true
@@ -93,14 +93,14 @@ prevalid, ipv6 = opts.ips.partition { |ip| (ip.match(Resolv::IPv6::Regex).nil?)
93
93
  valid, invalid = prevalid.partition { |ip| !(ip.match(Resolv::IPv4::Regex).nil?) }
94
94
  invalid += ipv6
95
95
  if @dry_run
96
- puts DroneBL::gen_add_query valid
97
- puts "#{valid.count} IPs will be added as type #{opts.type}#{" with comment 'opts.comment if opts.comment}'"}."
96
+ puts DroneBL::gen_add_query valid
97
+ puts "#{valid.count} IPs will be added as type #{opts.type}#{" with comment 'opts.comment if opts.comment}'"}."
98
98
  else
99
- response = DroneBL::add(valid, type, comment)
100
- print_table response, opts.long_types
101
- puts "#{valid.count} IPs looked up. #{response.map { |r| r['ip'] }.uniq.length} unique IPs found in response."
99
+ response = DroneBL::add(valid, type, comment)
100
+ print_table response, opts.long_types
101
+ puts "#{valid.count} IPs looked up. #{response.map { |r| r['ip'] }.uniq.length} unique IPs found in response."
102
102
  end
103
103
  unless invalid.empty?
104
- puts "IPs not valid for lookup: "
105
- invalid.each { |ip| puts ip }
104
+ puts "IPs not valid for lookup: "
105
+ invalid.each { |ip| puts ip }
106
106
  end
data/bin/dronebl-query CHANGED
@@ -15,7 +15,7 @@ class Options
15
15
  opts.banner = "Usage: #{$0} [options]"
16
16
  opts.separator ""
17
17
  opts.separator "Options available:"
18
- opts.on('-I', '--ips [ip1,ip2,ip3,...]', Array, 'Read in IPs.') do |list|
18
+ opts.on('-I', '--ips ip1,ip2,ip3,...', Array, 'Read in IPs.') do |list|
19
19
  @ips += list
20
20
  end
21
21
  opts.on('-s', '--stdin', 'Read a newline-delimited list of IPs from STDIN') do
@@ -24,16 +24,16 @@ class Options
24
24
  opts.on('-k', '--key KEY', String, 'Use KEY as your DroneBL RPC2 key') do |key|
25
25
  @key_str = key
26
26
  end
27
- opts.on('-f', '--keyfile [FILE_PATH]', 'Read the file at FILE_PATH and use it as the RPC key') do |path|
27
+ opts.on('-f', '--keyfile FILE_PATH', 'Read the file at FILE_PATH and use it as the RPC key') do |path|
28
28
  @use_key_file = true
29
29
  @key_file = path
30
30
  end
31
31
  opts.on('-a', '--get-archived', 'Get *all* DroneBL listings of the given IP, not just active ones.') do
32
32
  @get_archived = true
33
33
  end
34
- opts.on('-T', '--time-format [FORMAT]', String, 'Interpolate the time format string with FORMAT instead of the default. See `man 3 strftime` for format specifiers.') do |fmt|
35
- @time_format = fmt
36
- end
34
+ # opts.on('-T', '--time-format FORMAT', String, 'Interpolate the time format string with FORMAT instead of the default. See `man 3 strftime` for format specifiers.') do |fmt|
35
+ # @time_format = fmt
36
+ # end
37
37
  opts.on('-u', '--use-key-file', 'Use the default key file located at ~/.droneblkey') do
38
38
  @use_key_file = true
39
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dronebl.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rylee Fowler