Class: Fog::Storage::Local::Real
- Inherits:
-
Object
- Object
- Fog::Storage::Local::Real
- Defined in:
- lib/rackspace-fog/local/storage.rb
Instance Method Summary collapse
- #copy_object(source_directory_name, source_object_name, target_directory_name, target_object_name, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Real
constructor
A new instance of Real.
- #local_root ⇒ Object
- #path_to(partial) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Real
Returns a new instance of Real.
55 56 57 58 |
# File 'lib/rackspace-fog/local/storage.rb', line 55 def initialize(={}) require 'mime/types' @local_root = ::File.([:local_root]) end |
Instance Method Details
#copy_object(source_directory_name, source_object_name, target_directory_name, target_object_name, options = {}) ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/rackspace-fog/local/storage.rb', line 68 def copy_object(source_directory_name, source_object_name, target_directory_name, target_object_name, ={}) require 'fileutils' source_path = path_to(::File.join(source_directory_name, source_object_name)) target_path = path_to(::File.join(target_directory_name, target_object_name)) ::FileUtils.mkdir_p(::File.dirname(source_path)) ::FileUtils.copy_file(source_path, target_path) end |
#local_root ⇒ Object
60 61 62 |
# File 'lib/rackspace-fog/local/storage.rb', line 60 def local_root @local_root end |
#path_to(partial) ⇒ Object
64 65 66 |
# File 'lib/rackspace-fog/local/storage.rb', line 64 def path_to(partial) ::File.join(@local_root, partial) end |