Top Level Namespace

Defined Under Namespace

Modules: AWS Classes: MethodLogger, S3fsr, SBaseDir, SBucketDir, SBucketsDir, SFakeDir, SFile, SPrefixDir

Constant Summary collapse

S3ORGANIZER_DIR_SUFFIX =
'_$folder$'
S3SYNC_DIR_CONTENTS =
'{E40327BF-517A-46e8-A6C3-AF51BC263F59}'
S3SYNC_DIR_ETAG =
'd66759af42f282e1ba19144df2d405d0'
S3SYNC_DIR_LENGTH =
38

Instance Method Summary collapse

Instance Method Details

#last_part(key) ⇒ Object

old key split name perf sucked, so optimize with a cached rindex/slice



13
14
15
16
17
18
19
20
21
# File 'lib/s3fsr.rb', line 13

def last_part(key)
  last_slash = key.rindex('/', -2)
  drop = key.end_with?('/') ? 1 : 0
  if last_slash then
    key.slice(last_slash + 1, key.length - last_slash - 1 - drop)
  else
    key.slice(0, key.length - drop)
  end
end