class String def increment_version short_version_parts = self.split('.') last_digit = short_version_parts.last.to_i + 1 $stdout.puts 'Incrementing version...' "#{short_version_parts.first(short_version_parts.length-1).join(".")}.#{last_digit}" end def increment_version! replace increment_version end def is_number? true if Float(self) rescue false end end