Class: Fog::Local::Storage::Mock
- Inherits:
-
Object
- Object
- Fog::Local::Storage::Mock
- Defined in:
- lib/fog/storage/local.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Mock
constructor
A new instance of Mock.
- #local_root ⇒ Object
- #path_to(partial) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Mock
Returns a new instance of Mock.
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/fog/storage/local.rb', line 28 def initialize(={}) Fog::Mock.not_implemented unless .delete(:provider) location = caller.first warning = "[yellow][WARN] Fog::Local::Storage.new is deprecated, use Fog::Storage.new(:provider => 'Local') instead[/]" warning << " [light_black](" << location << ")[/] " Formatador.display_line(warning) end @local_root = ::File.([:local_root]) @data = self.class.data[@local_root] end |
Class Method Details
.data ⇒ Object
16 17 18 19 20 |
# File 'lib/fog/storage/local.rb', line 16 def self.data @data ||= Hash.new do |hash, key| hash[key] = {} end end |
.reset_data(keys = data.keys) ⇒ Object
22 23 24 25 26 |
# File 'lib/fog/storage/local.rb', line 22 def self.reset_data(keys=data.keys) for key in [*keys] data.delete(key) end end |
Instance Method Details
#local_root ⇒ Object
42 43 44 |
# File 'lib/fog/storage/local.rb', line 42 def local_root @local_root end |
#path_to(partial) ⇒ Object
46 47 48 |
# File 'lib/fog/storage/local.rb', line 46 def path_to(partial) ::File.join(@local_root, partial) end |