nexpose 3.3.1 → 3.3.2

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: 68d45a47d8793a2dad4275370d1b52bec3e9c4fa
4
- data.tar.gz: 60b3700499822c989f301534af290aa75311a9aa
3
+ metadata.gz: ff0a541a3881e177817bd44ffd71e0372d327c53
4
+ data.tar.gz: 810e7389172b58708ac6569e94c83dcb08ffc73d
5
5
  SHA512:
6
- metadata.gz: 49e10063754f100fdd3532c0429ce8ec1cd4e0a6a76f0ebecb109e5414ebe4e733e89dabf17b60e36fe284aec9ff2e05bdaa66aae144f15a428939d8c190e4b0
7
- data.tar.gz: 9c163a49136f5021dca89c79142602825d8b7c53b3c72032d2e51ca1e4b971d8adfdd57c38ddc993cdeb9320093de1198dc7b71b2c251fd1062273629db13ac4
6
+ metadata.gz: c7553f4f8723d41cc0e19a19bf81e1ae0dc1041e1ef1c87729c1c14408992351c3c45ea449c311872bd06896f4d9eb2e04d4f8d003a590d37e59661a797788a7
7
+ data.tar.gz: 533a132b22a6cf35ae454690ece01e0ef6bb87ccfecb677b791645a10ff6aa0deb80d5d02d687d1f0754976a272dab4f824b9467c3ff0f311e10663963cfbe49
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nexpose (3.3.0)
4
+ nexpose (3.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/nexpose/ajax.rb CHANGED
@@ -245,11 +245,12 @@ module Nexpose
245
245
  end
246
246
 
247
247
  def get_rows(nsc, pref)
248
- uri = '/ajax/user_pref_get.txml'
249
- resp = get(nsc, uri, CONTENT_TYPE::XML, 'name' => "#{pref}.rows")
250
- xml = REXML::Document.new(resp)
251
- if val = REXML::XPath.first(xml, 'GetUserPref/userPref')
252
- rows = val.text.to_i
248
+ uri = '/data/user/preferences/all'
249
+ pref_key = "#{pref}.rows"
250
+ resp = get(nsc, uri)
251
+ json = JSON.parse(resp)
252
+ if json.has_key?(pref_key)
253
+ rows = json[pref_key].to_i
253
254
  rows > 0 ? rows : 10
254
255
  else
255
256
  10
@@ -257,14 +258,12 @@ module Nexpose
257
258
  end
258
259
 
259
260
  def set_rows(nsc, pref, value)
260
- uri = '/ajax/user_pref_set.txml'
261
+ uri = '/data/user/preference'
261
262
  params = { 'name' => "#{pref}.rows",
262
263
  'value' => value }
263
- resp = get(nsc, uri, CONTENT_TYPE::XML, params)
264
- xml = REXML::Document.new(resp)
265
- if attr = REXML::XPath.first(xml, 'SetUserPref/@success')
266
- attr.value == '1'
267
- end
264
+
265
+ form_post(nsc, uri, params)
268
266
  end
267
+
269
268
  end
270
269
  end
data/lib/nexpose/util.rb CHANGED
@@ -50,7 +50,7 @@ module Nexpose
50
50
  # @return [IPRange|HostName] Valid class, if it can be converted.
51
51
  #
52
52
  def convert(asset)
53
- ips = asset.split(' - ')
53
+ ips = asset.split('-').map(&:strip)
54
54
  IPAddr.new(ips[0])
55
55
  IPAddr.new(ips[1]) if ips[1]
56
56
  IPRange.new(ips[0], ips[1])
@@ -1,4 +1,4 @@
1
1
  module Nexpose
2
2
  # The latest version of the Nexpose gem
3
- VERSION = '3.3.1'
3
+ VERSION = '3.3.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexpose
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - HD Moore
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2016-04-08 00:00:00.000000000 Z
16
+ date: 2016-04-29 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler