vfs 0.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/vfs/entries/dir.rb +1 -1
- data/lib/vfs/entries/file.rb +8 -0
- metadata +2 -2
data/Rakefile
CHANGED
data/lib/vfs/entries/dir.rb
CHANGED
@@ -151,7 +151,7 @@ module Vfs
|
|
151
151
|
def copy_to to, options = {}
|
152
152
|
options[:bang] = true unless options.include? :bang
|
153
153
|
|
154
|
-
raise Error,
|
154
|
+
raise Error, "invalid argument, destination should be a Entry (#{to})!" unless to.is_a? Entry
|
155
155
|
raise Error, "you can't copy to itself" if self == to
|
156
156
|
|
157
157
|
target = if to.is_a? File
|
data/lib/vfs/entries/file.rb
CHANGED
@@ -192,5 +192,13 @@ module Vfs
|
|
192
192
|
args.unshift Object.new if args.size == 1 and args.first.is_a?(Hash)
|
193
193
|
Tilt::ERBTemplate.new(path).render *args
|
194
194
|
end
|
195
|
+
|
196
|
+
def basename
|
197
|
+
::File.basename(name, File.extname(name))
|
198
|
+
end
|
199
|
+
|
200
|
+
def extension
|
201
|
+
::File.extname(name).sub(/^\./, '')
|
202
|
+
end
|
195
203
|
end
|
196
204
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vfs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-06-18 00:00:00.000000000 +04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
description:
|