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 +4 -4
- data/lib/nexpose/util.rb +24 -0
- data/lib/nexpose/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d53af256a38fa293d1ba3a20353ed46605b067c
|
4
|
+
data.tar.gz: e8564b802c313c0bfb983b714da40f4a9a18bdaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/nexpose/version.rb
CHANGED
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.
|
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-
|
14
|
+
date: 2014-12-11 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rex
|