lib/jss/utility.rb in ruby-jss-0.8.2 vs lib/jss/utility.rb in ruby-jss-0.9.0.b1
- old
+ new
@@ -279,10 +279,11 @@
string.gsub(/&/, '&').gsub(/\"/, '"').gsub(/>/, '>').gsub(/</, '<').gsub(/'/, ''')
end
# Given an element name and an array of content, generate an Array of
# REXML::Element objects with that name, and matching content.
+ # Given element name 'foo' and the array ['bar','morefoo']
# The array of REXML elements would render thus:
# <foo>bar</foo>
# <foo>morefoo</foo>
#
# @param element [#to_s] an element_name like :foo
@@ -417,9 +418,12 @@
# (see parse_jss_version)
def self.parse_jss_version_newstyle(version)
release, build = version.split '-'
major, minor, revision = release.split '.'
+ minor ||= 0
+ revision ||= 0
+
{
major: major.to_i,
minor: minor.to_i,
revision: revision.to_i,
maint: revision.to_i,