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
-
#exemptSlashesInEscape ⇒ Object
writeonly
Sets the attribute exemptSlashesInEscape.
-
#nativeCharacterEncoding ⇒ Object
writeonly
Sets the attribute nativeCharacterEncoding.
-
#usePercent20InEscape ⇒ Object
writeonly
Sets the attribute usePercent20InEscape.
-
#useUTF8InEscape ⇒ Object
writeonly
Sets the attribute useUTF8InEscape.
Instance Method Summary collapse
Instance Attribute Details
#exemptSlashesInEscape=(value) ⇒ Object (writeonly)
Sets the attribute exemptSlashesInEscape
31 32 33 |
# File 'lib/s3sync/S3encoder.rb', line 31 def exemptSlashesInEscape=(value) @exemptSlashesInEscape = value end |
#nativeCharacterEncoding=(value) ⇒ Object (writeonly)
Sets the attribute nativeCharacterEncoding
35 36 37 |
# File 'lib/s3sync/S3encoder.rb', line 35 def nativeCharacterEncoding=(value) @nativeCharacterEncoding = value end |
#usePercent20InEscape=(value) ⇒ Object (writeonly)
Sets the attribute usePercent20InEscape
33 34 35 |
# File 'lib/s3sync/S3encoder.rb', line 33 def usePercent20InEscape=(value) @usePercent20InEscape = value end |
#useUTF8InEscape=(value) ⇒ Object (writeonly)
Sets the attribute useUTF8InEscape
37 38 39 |
# File 'lib/s3sync/S3encoder.rb', line 37 def useUTF8InEscape=(value) @useUTF8InEscape = value end |
Instance Method Details
#S3Extend_escape(string) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/s3sync/S3encoder.rb', line 39 def S3Extend_escape(string) result = string result = string.encode("UTF-8", @nativeCharacterEncoding) if @useUTF8InEscape result = S3Extend_escape_orig(result) result.gsub!(/%2f/i, "/") if @exemptSlashesInEscape result.gsub!("+", "%20") if @usePercent20InEscape result end |