fog-local 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/Rakefile +1 -1
- data/lib/fog/local.rb +15 -1
- data/lib/fog/local/version.rb +1 -1
- data/lib/fog/{local/storage.rb → storage/local.rb} +6 -4
- data/lib/fog/{local/models/storage → storage/local/models}/directories.rb +0 -3
- data/lib/fog/{local/models/storage → storage/local/models}/directory.rb +0 -3
- data/lib/fog/{local/models/storage → storage/local/models}/file.rb +0 -3
- data/lib/fog/{local/models/storage → storage/local/models}/files.rb +0 -3
- data/tests/helper.rb +1 -0
- data/tests/local/models/directories_tests.rb +3 -2
- data/tests/local/models/directory_tests.rb +7 -3
- data/tests/local/models/file_tests.rb +5 -1
- data/tests/local/storage_tests.rb +5 -1
- metadata +7 -9
- data/lib/fog-local.rb +0 -1
- data/lib/fog/local/core.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a95da8ab33a335e4bb68e9c3fdf3715a6aec3305
|
4
|
+
data.tar.gz: 4d93eee4372f1c7110dcfc6014a61c7cb08bb28b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4d85e10b6ebe75cf458ccf0bda70b9f76e697d0befbe08f748d75ae4b561cf95d3163fa4b1231adbb0cf9acf73f05e7be0e95bf8534c309abd399cb05395e48
|
7
|
+
data.tar.gz: 6f7da030400de9f2de428e34ce487d1c79fa6bafdc3bbb9dc4bf588f21572ce62917d750f8252d7aa43146d6754604412166b89ec4f5cfc10c56674329763618
|
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
data/lib/fog/local.rb
CHANGED
@@ -1 +1,15 @@
|
|
1
|
-
require 'fog/
|
1
|
+
require 'fog/core'
|
2
|
+
require 'fileutils'
|
3
|
+
require File.expand_path('../local/version', __FILE__)
|
4
|
+
|
5
|
+
module Fog
|
6
|
+
module Storage
|
7
|
+
autoload :Local, File.expand_path('../storage/local', __FILE__)
|
8
|
+
end
|
9
|
+
|
10
|
+
module Local
|
11
|
+
extend Fog::Provider
|
12
|
+
|
13
|
+
service(:storage, 'Storage')
|
14
|
+
end
|
15
|
+
end
|
data/lib/fog/local/version.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
-
require 'fog/local/core'
|
2
|
-
|
3
1
|
module Fog
|
4
2
|
module Storage
|
5
3
|
class Local < Fog::Service
|
4
|
+
autoload :Directories, ::File.expand_path('../local/models/directories', __FILE__)
|
5
|
+
autoload :Directory, ::File.expand_path('../local/models/directory', __FILE__)
|
6
|
+
autoload :File, ::File.expand_path('../local/models/file', __FILE__)
|
7
|
+
autoload :Files, ::File.expand_path('../local/models/files', __FILE__)
|
8
|
+
|
6
9
|
requires :local_root
|
7
10
|
recognizes :endpoint, :scheme, :host, :port, :path
|
8
11
|
|
9
|
-
model_path 'fog/local/models
|
12
|
+
model_path 'fog/storage/local/models'
|
10
13
|
collection :directories
|
11
14
|
model :directory
|
12
15
|
model :file
|
@@ -77,7 +80,6 @@ module Fog
|
|
77
80
|
end
|
78
81
|
|
79
82
|
def copy_object(source_directory_name, source_object_name, target_directory_name, target_object_name, options={})
|
80
|
-
require 'fileutils'
|
81
83
|
source_path = path_to(::File.join(source_directory_name, source_object_name))
|
82
84
|
target_path = path_to(::File.join(target_directory_name, target_object_name))
|
83
85
|
::FileUtils.mkdir_p(::File.dirname(target_path))
|
data/tests/helper.rb
CHANGED
@@ -2,16 +2,17 @@ Shindo.tests('Storage[:local] | directories', ["local"]) do
|
|
2
2
|
|
3
3
|
pending if Fog.mocking?
|
4
4
|
|
5
|
-
@options = { :local_root =>
|
5
|
+
@options = { :local_root => Dir.mktmpdir('fog-tests') }
|
6
6
|
@collection = Fog::Storage::Local.new(@options).directories
|
7
7
|
|
8
8
|
collection_tests(@collection, {:key => "fogdirtests"}, true)
|
9
9
|
|
10
10
|
tests("#all") do
|
11
11
|
tests("succeeds when :local_root does not exist").succeeds do
|
12
|
-
FileUtils.
|
12
|
+
FileUtils.remove_entry_secure(@options[:local_root])
|
13
13
|
@collection.all
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
+
FileUtils.remove_entry_secure(@options[:local_root]) if File.directory?(@options[:local_root])
|
17
18
|
end
|
@@ -3,14 +3,18 @@ Shindo.tests('Storage[:local] | directory', ["local"]) do
|
|
3
3
|
pending if Fog.mocking?
|
4
4
|
|
5
5
|
before do
|
6
|
-
@options = { :local_root => '
|
6
|
+
@options = { :local_root => Dir.mktmpdir('fog-tests') }
|
7
|
+
end
|
8
|
+
|
9
|
+
after do
|
10
|
+
FileUtils.remove_entry_secure @options[:local_root]
|
7
11
|
end
|
8
12
|
|
9
13
|
tests('save') do
|
10
|
-
returns(
|
14
|
+
returns('directory') do
|
11
15
|
connection = Fog::Storage::Local.new(@options)
|
12
16
|
connection.directories.create(:key => 'directory')
|
13
|
-
connection.directories.create(:key => 'directory')
|
17
|
+
connection.directories.create(:key => 'directory').key
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
@@ -3,7 +3,11 @@ Shindo.tests('Storage[:local] | file', ["local"]) do
|
|
3
3
|
pending if Fog.mocking?
|
4
4
|
|
5
5
|
before do
|
6
|
-
@options = { :local_root => '
|
6
|
+
@options = { :local_root => Dir.mktmpdir('fog-tests') }
|
7
|
+
end
|
8
|
+
|
9
|
+
after do
|
10
|
+
FileUtils.remove_entry_secure @options[:local_root]
|
7
11
|
end
|
8
12
|
|
9
13
|
tests('#public_url') do
|
@@ -3,7 +3,11 @@ Shindo.tests('Local | storage') do
|
|
3
3
|
pending if Fog.mocking?
|
4
4
|
|
5
5
|
before do
|
6
|
-
@options = { :local_root =>
|
6
|
+
@options = { :local_root => Dir.mktmpdir('fog-tests') }
|
7
|
+
end
|
8
|
+
|
9
|
+
after do
|
10
|
+
FileUtils.remove_entry_secure @options[:local_root]
|
7
11
|
end
|
8
12
|
|
9
13
|
tests('#endpoint') do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-local
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wesley Beary
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-04-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -86,16 +86,14 @@ files:
|
|
86
86
|
- README.md
|
87
87
|
- Rakefile
|
88
88
|
- fog-local.gemspec
|
89
|
-
- lib/fog-local.rb
|
90
89
|
- lib/fog/bin/local.rb
|
91
90
|
- lib/fog/local.rb
|
92
|
-
- lib/fog/local/core.rb
|
93
|
-
- lib/fog/local/models/storage/directories.rb
|
94
|
-
- lib/fog/local/models/storage/directory.rb
|
95
|
-
- lib/fog/local/models/storage/file.rb
|
96
|
-
- lib/fog/local/models/storage/files.rb
|
97
|
-
- lib/fog/local/storage.rb
|
98
91
|
- lib/fog/local/version.rb
|
92
|
+
- lib/fog/storage/local.rb
|
93
|
+
- lib/fog/storage/local/models/directories.rb
|
94
|
+
- lib/fog/storage/local/models/directory.rb
|
95
|
+
- lib/fog/storage/local/models/file.rb
|
96
|
+
- lib/fog/storage/local/models/files.rb
|
99
97
|
- tests/helper.rb
|
100
98
|
- tests/helpers/collection_helper.rb
|
101
99
|
- tests/helpers/formats_helper.rb
|
data/lib/fog-local.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'fog/local'
|