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
32 33 34 |
# File 'lib/s3sync/S3encoder.rb', line 32 def exemptSlashesInEscape=(value) @exemptSlashesInEscape = value end |
#nativeCharacterEncoding=(value) ⇒ Object (writeonly)
Sets the attribute nativeCharacterEncoding
36 37 38 |
# File 'lib/s3sync/S3encoder.rb', line 36 def nativeCharacterEncoding=(value) @nativeCharacterEncoding = value end |
#usePercent20InEscape=(value) ⇒ Object (writeonly)
Sets the attribute usePercent20InEscape
34 35 36 |
# File 'lib/s3sync/S3encoder.rb', line 34 def usePercent20InEscape=(value) @usePercent20InEscape = value end |
#useUTF8InEscape=(value) ⇒ Object (writeonly)
Sets the attribute useUTF8InEscape
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 |