dronebl.rb 0.0.5.pre.1 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 125abad2b2c26327eeaa22de38d316aaabd17ef8
4
- data.tar.gz: ab6f8e783ba6f4e7cb39c3d36f2fd30f7beca1b8
3
+ metadata.gz: 379138ce46c0c464447e92e60fa002cdc580db63
4
+ data.tar.gz: 1213dc5cebb786b9565ee7961b57f36d763589ba
5
5
  SHA512:
6
- metadata.gz: 02848779b2f29f9dac1312a258c6551929c345d5ec0c6bb594ac62b7cf502a93bff88a69a781ce6e88450f54aa45fdfd9ee643cafbbdd92242db9e97eeff8e0e
7
- data.tar.gz: b93e3a97b0b81f54c4771c62c19c3b2f0c3125f775733d04e84cb169715d2cce2568847c83c590ab8a29efc356351c26e1378e6f56ecaad035a749d48a19ce33
6
+ metadata.gz: ff35d03b19a0cf1bfdcdd1153ffe823ecc62d1549d791be3ef1a437790ba9f29c2f30a3e96f5f5a6318207a0402bbc1e07622d1281a3cdc5ef0d95f2361a2964
7
+ data.tar.gz: 32bbd489797d86c413099ecae2d739d580cab1b66d1f464e3ef98d0b34bbe741d1c5439b4fb87852b17cd1a4f1b2a56221eb99979adcad2a592bbfa6bb247e22
data/bin/dronebl-add CHANGED
@@ -97,9 +97,9 @@ if @dry_run
97
97
  puts DroneBL::gen_add_query valid
98
98
  puts "#{valid.count} IPs will be added as type #{opts.type}#{" with comment 'opts.comment if opts.comment}'"}."
99
99
  else
100
- response = DroneBL::add(valid, type, comment)
101
- print_table response, opts.long_types
102
- puts "#{valid.count} IPs looked up. #{response.map { |r| r['ip'] }.uniq.length} unique IPs found in response."
100
+ response = DroneBL::add(valid, opts.type, opts.comment)
101
+ puts response
102
+ puts "#{valid.count} IPs added as type #{opts.type}#{" with comment '#{opts.comment}'" if opts.comment}"
103
103
  end
104
104
  unless invalid.empty?
105
105
  puts "IPs not valid for lookup: "
@@ -37,6 +37,7 @@ module DroneBL
37
37
  end
38
38
 
39
39
  def gen_lookup_query ips, archived=false
40
+ archived ||= false
40
41
  <<EOF
41
42
  <?xml version='1.0'?>
42
43
  <request key='#{key}'>
@@ -45,9 +46,10 @@ module DroneBL
45
46
  EOF
46
47
  end
47
48
  def gen_add_query ips, type, comment=''
49
+ comment ||= ''
48
50
  "<?xml version='1.0'?>
49
51
  <request key='#{key}'>
50
- #{ips.map { |ip| "<add ip='#{ip}' type='#{type}'#{ " comment='#{comment}'" unless comment.empty?}>"}.join("\n")}
52
+ #{ips.map { |ip| "<add ip='#{ip}' type='#{type}'#{ " comment='#{comment}'" unless comment.nil? || comment.empty?}>"}.join("\n")}
51
53
  </request>"
52
54
  end
53
55
 
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.5.pre.1
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rylee Fowler
@@ -36,9 +36,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
36
36
  version: '0'
37
37
  required_rubygems_version: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">"
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: 1.3.1
41
+ version: '0'
42
42
  requirements: []
43
43
  rubyforge_project:
44
44
  rubygems_version: 2.2.2