summaryrefslogtreecommitdiff
path: root/lib/chef/resource/windows_task.rb
diff options
context:
space:
mode:
authorVasu1105 <vasundhara.jagdale@msystechnologies.com>2017-12-19 09:43:53 +0000
committerVasu1105 <vasundhara.jagdale@msystechnologies.com>2018-01-05 06:38:55 +0000
commitaefec12e4657657b1227af0be373c1644cddbe1e (patch)
tree3fb0e4f57aa2535f47abbc8a7bb632eeb818b7d9 /lib/chef/resource/windows_task.rb
parent7fd821058fb94d708e8f2fdc95b26823c1ef92b2 (diff)
downloadchef-aefec12e4657657b1227af0be373c1644cddbe1e.tar.gz
Added new specs and updated code to handle more scenarios
Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
Diffstat (limited to 'lib/chef/resource/windows_task.rb')
-rw-r--r--lib/chef/resource/windows_task.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/chef/resource/windows_task.rb b/lib/chef/resource/windows_task.rb
index 5ab5715ccf..6784f71f1d 100644
--- a/lib/chef/resource/windows_task.rb
+++ b/lib/chef/resource/windows_task.rb
@@ -205,11 +205,12 @@ class Chef
end
end
- # Convert the number of seconds to an ISO8601 duration format
- # @see http://tools.ietf.org/html/rfc2445#section-4.3.6
- # @param [Integer] seconds The amount of seconds for this duration
+ # Converts the number of seconds to an ISO8601 duration format
+ # Ref : https://github.com/arnau/ISO8601/blob/master/lib/iso8601/duration.rb#L18-L23
+ # dur = ISO8601::Duration.new(65707200)
+ # dur => 'P65707200S'
def sec_to_dur(seconds)
- dur = seconds.to_i == 0 ? nil : ISO8601::Duration.new(seconds.to_i).to_s
+ dur = ISO8601::Duration.new(seconds.to_i).to_s
end
end