When trying to save a site with a Schedule object, I currently get the following error:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/util.rb:105:in to_string': undefined methodto_time' for "20181016T181411.812Z":String (NoMethodError)
Did you mean? to_i
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/common.rb:221:in to_h' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/site.rb:428:inmap'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/site.rb:428:in to_h' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/site.rb:411:into_json'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/site.rb:517:in save' from set-sites-schedule.rb:42:in'
Expected Behavior
Current Behavior
When trying to save a site with a Schedule object, I currently get the following error:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/util.rb:105:in'
to_string': undefined method
to_time' for "20181016T181411.812Z":String (NoMethodError) Did you mean? to_i from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/common.rb:221:into_h' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/site.rb:428:in
map' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/site.rb:428:into_h' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/site.rb:411:in
to_json' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/site.rb:517:insave' from set-sites-schedule.rb:42:in
Possible Solution
By replacing the current line with the one I've specified below, I was able to save the schedule in the site. In util.rb on line 105 (https://github.com/rapid7/nexpose-client/blob/master/lib/nexpose/util.rb#L105), shouldn't the line be:
to_time(time).utc.strftime('%Y%m%dT%H%M%S.%LZ')
Steps to Reproduce (for bugs)
Ruby code that reproduces the issue:
Context
Your Environment