Module: Fog::RiakCS::MultipartUtils

Included in:
Provisioning::Real
Defined in:
lib/fog/riakcs/core.rb

Defined Under Namespace

Classes: Headers

Instance Method Summary collapse

Instance Method Details

#extract_boundary(header_string) ⇒ Object



41
42
43
# File 'lib/fog/riakcs/core.rb', line 41

def extract_boundary(header_string)
  $1 if header_string =~ /boundary=([A-Za-z0-9\'()+_,-.\/:=?]+)/
end

#parse(data, boundary) ⇒ Object



34
35
36
37
38
39
# File 'lib/fog/riakcs/core.rb', line 34

def parse(data, boundary)
  contents = data.match(end_boundary_regex(boundary)).pre_match rescue ""
  contents.split(inner_boundary_regex(boundary)).reject(&:empty?).map do |part|
    parse_multipart_section(part)
  end.compact
end