Class: Cynq::Local

Inherits:
Directory show all
Defined in:
lib/cynq/local.rb

Instance Attribute Summary

Attributes inherited from Directory

#bucket, #connection, #keys

Instance Method Summary collapse

Methods inherited from Directory

#<<, #[], #content_type_for_key, #delete, #include?, #inspect, #meta_equal?, #missing?, #modified?, #size

Constructor Details

#initialize(bucket_name) ⇒ Local

Returns a new instance of Local.



6
7
8
9
10
11
12
13
14
15
# File 'lib/cynq/local.rb', line 6

def initialize(bucket_name)
  # We expect a directory for a Local storage.
  # However, we have to use the root of that
  # directory as the 'root', and then the name
  # of that directory as the bucket.
  bucket_name = File.expand_path(bucket_name)
  @local_root = File.dirname bucket_name
  super(File.basename bucket_name)
  require 'cynq/ext/fog'
end