vfs 0.1.1 → 0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/lib/vfs/entries/file.rb +11 -0
- data/lib/vfs/integration/string.rb +1 -1
- data/lib/vfs/storages/specification.rb +5 -5
- data/lib/vfs/vfs.rb +4 -0
- data/readme.md +1 -0
- data/spec/container_spec.rb +1 -1
- data/spec/dir_spec.rb +5 -5
- data/spec/entry_spec.rb +1 -1
- data/spec/file_spec.rb +6 -2
- data/spec/storages/hash_fs_spec.rb +1 -1
- data/spec/storages/local_spec.rb +1 -1
- data/spec/universal_entry_spec.rb +1 -1
- metadata +17 -26
data/Rakefile
CHANGED
data/lib/vfs/entries/file.rb
CHANGED
@@ -181,5 +181,16 @@ module Vfs
|
|
181
181
|
options[:override] = true
|
182
182
|
move_to to, options
|
183
183
|
end
|
184
|
+
|
185
|
+
|
186
|
+
#
|
187
|
+
# Extra Stuff
|
188
|
+
#
|
189
|
+
def render *args
|
190
|
+
require 'tilt'
|
191
|
+
|
192
|
+
args.unshift Object.new if args.size == 1 and args.first.is_a?(Hash)
|
193
|
+
Tilt::ERBTemplate.new(path).render *args
|
194
|
+
end
|
184
195
|
end
|
185
196
|
end
|
@@ -3,13 +3,13 @@ require 'rspec_ext'
|
|
3
3
|
require 'ruby_ext'
|
4
4
|
|
5
5
|
shared_examples_for 'vfs storage' do
|
6
|
-
before
|
6
|
+
before do
|
7
7
|
@storage.open_fs do |fs|
|
8
8
|
@tmp_dir = fs.tmp
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
after
|
12
|
+
after do
|
13
13
|
@storage.open_fs do |fs|
|
14
14
|
attrs = fs.attributes(@tmp_dir)
|
15
15
|
fs.delete_dir @tmp_dir if attrs && attrs[:dir]
|
@@ -29,7 +29,7 @@ shared_examples_for 'vfs storage' do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
describe "files" do
|
32
|
-
before
|
32
|
+
before do
|
33
33
|
@remote_file = "#{@tmp_dir}/remote_file"
|
34
34
|
end
|
35
35
|
|
@@ -70,11 +70,11 @@ shared_examples_for 'vfs storage' do
|
|
70
70
|
end
|
71
71
|
|
72
72
|
describe 'directories' do
|
73
|
-
# before
|
73
|
+
# before do
|
74
74
|
# @from_local, @remote_path, @to_local = "#{@local_dir}/dir", "#{@tmp_dir}/upload", "#{@local_dir}/download"
|
75
75
|
# end
|
76
76
|
|
77
|
-
before
|
77
|
+
before do
|
78
78
|
@remote_dir = "#{@tmp_dir}/some_dir"
|
79
79
|
end
|
80
80
|
|
data/lib/vfs/vfs.rb
CHANGED
data/readme.md
CHANGED
@@ -112,6 +112,7 @@ different API than local FS, and you has to remember all thouse little quirks).
|
|
112
112
|
|
113
113
|
### v 0.2
|
114
114
|
|
115
|
+
- remove :host from Vfs to Vos
|
115
116
|
- efficient (not copy/destroy) versions of move_to, rename
|
116
117
|
- glob search for directories: Dir['**/*.yml']
|
117
118
|
- access via attributes and helpers for unix chmod
|
data/spec/container_spec.rb
CHANGED
data/spec/dir_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'Dir' do
|
4
|
-
before
|
4
|
+
before do
|
5
5
|
@fs = '/'.to_entry_on(Vfs::Storages::HashFs.new)
|
6
6
|
@path = @fs['/a/b/c']
|
7
7
|
end
|
@@ -87,7 +87,7 @@ describe 'Dir' do
|
|
87
87
|
end
|
88
88
|
|
89
89
|
describe 'content' do
|
90
|
-
before
|
90
|
+
before do
|
91
91
|
@path.dir('dir').create
|
92
92
|
@path.dir('dir/another_dir').create
|
93
93
|
@path.file('file').create
|
@@ -126,7 +126,7 @@ describe 'Dir' do
|
|
126
126
|
end
|
127
127
|
|
128
128
|
describe 'copying' do
|
129
|
-
before
|
129
|
+
before do
|
130
130
|
@from = @path.dir
|
131
131
|
@from.create
|
132
132
|
@from.file('file').write 'something'
|
@@ -197,7 +197,7 @@ describe 'Dir' do
|
|
197
197
|
describe 'general copy' do
|
198
198
|
it_should_behave_like 'copy_to behavior'
|
199
199
|
|
200
|
-
before
|
200
|
+
before do
|
201
201
|
# we using here another HashFs storage, to prevent :effective_dir_copy to be used
|
202
202
|
@to = '/'.to_entry_on(Vfs::Storages::HashFs.new)['to']
|
203
203
|
|
@@ -208,7 +208,7 @@ describe 'Dir' do
|
|
208
208
|
describe 'effective copy' do
|
209
209
|
it_should_behave_like 'copy_to behavior'
|
210
210
|
|
211
|
-
before
|
211
|
+
before do
|
212
212
|
# we using the same HashFs storage, so :effective_dir_copy will be used
|
213
213
|
@to = @fs['to']
|
214
214
|
|
data/spec/entry_spec.rb
CHANGED
data/spec/file_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'File' do
|
4
|
-
before
|
4
|
+
before do
|
5
5
|
@fs = '/'.to_entry_on(Vfs::Storages::HashFs.new)
|
6
6
|
@path = @fs['/a/b/c']
|
7
7
|
end
|
@@ -110,7 +110,7 @@ describe 'File' do
|
|
110
110
|
end
|
111
111
|
|
112
112
|
describe 'copying' do
|
113
|
-
before
|
113
|
+
before do
|
114
114
|
@from = @path.file
|
115
115
|
@from.write('something')
|
116
116
|
end
|
@@ -186,4 +186,8 @@ describe 'File' do
|
|
186
186
|
@path.file.destroy!.should == @path
|
187
187
|
end
|
188
188
|
end
|
189
|
+
|
190
|
+
describe "extra stuff" do
|
191
|
+
it 'render'
|
192
|
+
end
|
189
193
|
end
|
data/spec/storages/local_spec.rb
CHANGED
metadata
CHANGED
@@ -1,28 +1,23 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: vfs
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.2'
|
4
5
|
prerelease:
|
5
|
-
version: 0.1.1
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Alexey Petrushin
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2011-02-16 00:00:00 +03:00
|
12
|
+
date: 2011-04-11 00:00:00.000000000 +04:00
|
14
13
|
default_executable:
|
15
14
|
dependencies: []
|
16
|
-
|
17
15
|
description:
|
18
16
|
email:
|
19
17
|
executables: []
|
20
|
-
|
21
18
|
extensions: []
|
22
|
-
|
23
19
|
extra_rdoc_files: []
|
24
|
-
|
25
|
-
files:
|
20
|
+
files:
|
26
21
|
- Rakefile
|
27
22
|
- readme.md
|
28
23
|
- lib/vfs/entries/dir.rb
|
@@ -52,30 +47,26 @@ files:
|
|
52
47
|
has_rdoc: true
|
53
48
|
homepage: http://github.com/alexeypetrushin/vfs
|
54
49
|
licenses: []
|
55
|
-
|
56
50
|
post_install_message:
|
57
51
|
rdoc_options: []
|
58
|
-
|
59
|
-
require_paths:
|
52
|
+
require_paths:
|
60
53
|
- lib
|
61
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
55
|
none: false
|
63
|
-
requirements:
|
64
|
-
- -
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version:
|
67
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
61
|
none: false
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version:
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
73
66
|
requirements: []
|
74
|
-
|
75
67
|
rubyforge_project:
|
76
68
|
rubygems_version: 1.5.1
|
77
69
|
signing_key:
|
78
70
|
specification_version: 3
|
79
71
|
summary: Virtual File System
|
80
72
|
test_files: []
|
81
|
-
|