Module: S3ExtendCGI::ClassMethods

Defined in:
lib/s3sync/S3encoder.rb

Constant Summary collapse

@@exemptSlashesInEscape =
false
@@usePercent20InEscape =
false
@@nativeCharacterEncoding =
"ISO-8859-1"
@@useUTF8InEscape =
false

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#exemptSlashesInEscape=(value) ⇒ Object (writeonly)

Sets the attribute exemptSlashesInEscape

Parameters:

  • value

    the value to set the attribute exemptSlashesInEscape to.



32
33
34
# File 'lib/s3sync/S3encoder.rb', line 32

def exemptSlashesInEscape=(value)
  @exemptSlashesInEscape = value
end

#nativeCharacterEncoding=(value) ⇒ Object (writeonly)

Sets the attribute nativeCharacterEncoding

Parameters:

  • value

    the value to set the attribute nativeCharacterEncoding to.



36
37
38
# File 'lib/s3sync/S3encoder.rb', line 36

def nativeCharacterEncoding=(value)
  @nativeCharacterEncoding = value
end

#usePercent20InEscape=(value) ⇒ Object (writeonly)

Sets the attribute usePercent20InEscape

Parameters:

  • value

    the value to set the attribute usePercent20InEscape to.



34
35
36
# File 'lib/s3sync/S3encoder.rb', line 34

def usePercent20InEscape=(value)
  @usePercent20InEscape = value
end

#useUTF8InEscape=(value) ⇒ Object (writeonly)

Sets the attribute useUTF8InEscape

Parameters:

  • value

    the value to set the attribute useUTF8InEscape to.



38
39
40
# File 'lib/s3sync/S3encoder.rb', line 38

def useUTF8InEscape=(value)
  @useUTF8InEscape = value
end

Instance Method Details

#S3Extend_escape(string) ⇒ Object



40
41
42
43
44
45
46
47
# File 'lib/s3sync/S3encoder.rb', line 40

def S3Extend_escape(string)
	result = string
	result = Iconv.iconv("UTF-8", @nativeCharacterEncoding, string).join if @useUTF8InEscape 
	result = S3Extend_escape_orig(result)
	result.gsub!(/%2f/i, "/") if @exemptSlashesInEscape
	result.gsub!("+", "%20") if @usePercent20InEscape
	result
end