lib/aws-matt/s3/extensions.rb in s3fsr-1.9 vs lib/aws-matt/s3/extensions.rb in s3fsr-1.10
- old
+ new
@@ -47,11 +47,11 @@
gsub(/([a-z\d])([A-Z])/,'\1_\2').
tr("-", "_").downcase
end unless public_method_defined? :underscore
def utf8?
- scan(/[^\x00-\xa0]/u) { |s| s.unpack('U') }
+ scan(Regexp.new("[^\x00-\xa0]", 'u')) { |s| s.unpack('U') }
true
rescue ArgumentError
false
end
@@ -73,14 +73,14 @@
end
end
def coerce
case self
- when 'true': true
- when 'false': false
+ when 'true' then true
+ when 'false' then false
# Don't coerce numbers that start with zero
- when /^[1-9]+\d*$/: Integer(self)
- when datetime_format: Time.parse(self)
+ when /^[1-9]+\d*$/ then Integer(self)
+ when datetime_format then Time.parse(self)
else
self
end
end