nexpose 0.8.16 → 0.8.17

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: 1cb45443d83455f41bad616d55864c36548c1bbf
4
- data.tar.gz: f42d2cbdc6f3e30cabe2f18c7716ff0542aab120
3
+ metadata.gz: 2d53af256a38fa293d1ba3a20353ed46605b067c
4
+ data.tar.gz: e8564b802c313c0bfb983b714da40f4a9a18bdaa
5
5
  SHA512:
6
- metadata.gz: d78a1ed3b71c43bb3bf67425a9e0e43620efa44f8ba4f634679acc0093cf1d7a21b29c24981a128e4d2590c69f0618f78e8c495d41eb86201d320d119431dcfe
7
- data.tar.gz: fd40da514a564539e5916fe367d4e55c92f34e849a9ca895a056da4ab42947e1220ae752dd492f9940fb82a2846b9e76048be0b52313d0e63243bda3bcf672a4
6
+ metadata.gz: 8c820282edb3efbc36521c21edc6389a820fd91e035671cd2f2b6abff147d2757afb812065b86c54d8cadf1d384e18442602204eb057a32a0495454534b2776c
7
+ data.tar.gz: f283f2f236f7ebc5cd66c4c6f7c613a450ca365dce683c7bcb5097ec979ef995bf4ebe8ee356c34db5d2134cc8e872fdd564bc028c777b3ca586ce652bc26aa3
data/lib/nexpose/util.rb CHANGED
@@ -92,4 +92,28 @@ module Nexpose
92
92
  coll
93
93
  end
94
94
  end
95
+
96
+ # Function module for converting to ISO 8601 and UTC dates expected by 2.0 API.
97
+ module ISO8601
98
+ module_function
99
+
100
+ # Convert a string representation into a Time object.
101
+ #
102
+ # @param [String] time_string String representation in basic format.
103
+ # For example: '20141210T165822.412Z'
104
+ # @return [Time] Time, if it can be converted.
105
+ #
106
+ def to_time(time_string)
107
+ Time.strptime(time_string.to_s, '%Y%m%dT%H%M%S.%LZ')
108
+ end
109
+
110
+ # Convert a time object into a UTC ISO 8601 basic date-time format.
111
+ #
112
+ # @param [Time|Date|DateTime] time Time to convert.
113
+ # @return [String] ISO 8601 basic representation.
114
+ #
115
+ def to_string(time = Time.now)
116
+ time.to_time.utc.strftime('%Y%m%dT%H%M%S.%LZ')
117
+ end
118
+ end
95
119
  end
@@ -1,4 +1,4 @@
1
1
  module Nexpose
2
2
  # The latest version of the Nexpose gem
3
- VERSION = '0.8.16'
3
+ VERSION = '0.8.17'
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: 0.8.16
4
+ version: 0.8.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - HD Moore
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-12-10 00:00:00.000000000 Z
14
+ date: 2014-12-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rex