mediatype_directory 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown
CHANGED
@@ -31,6 +31,8 @@ Create a new MediatypeDirectory object, passing in all your configuration option
|
|
31
31
|
|
32
32
|
MediatypeDirectory.new(config).create_directory
|
33
33
|
|
34
|
+
It's safe to re-run the program as many times as you want. If a link already exists, it will be skipped. But if a new file is found that matches the criteria, a new link will be added.
|
35
|
+
|
34
36
|
## EXAMPLE
|
35
37
|
|
36
38
|
require 'mediatype_directory'
|
@@ -33,8 +33,8 @@ class MediatypeDirectory
|
|
33
33
|
|
34
34
|
def initialize(config)
|
35
35
|
self.extensions = config[:extensions]
|
36
|
-
self.mediatype_dirname = config[:mediatype_dirname]
|
37
|
-
self.directory_tree = config[:directory_tree]
|
36
|
+
self.mediatype_dirname = config[:mediatype_dirname] || config[:target] || config[:to]
|
37
|
+
self.directory_tree = config[:directory_tree] || config[:source] || config[:from]
|
38
38
|
self.linktype = config[:linktype] || 'soft'
|
39
39
|
self.test_mode = config[:test_mode] || false
|
40
40
|
end
|
@@ -52,6 +52,15 @@ class MediatypeDirectory
|
|
52
52
|
@directory_tree = nil_or_convert_dirname(dirname)
|
53
53
|
end
|
54
54
|
|
55
|
+
alias_method :source, :directory_tree
|
56
|
+
alias_method :from, :directory_tree
|
57
|
+
alias_method :source=, :directory_tree=
|
58
|
+
alias_method :from=, :directory_tree=
|
59
|
+
alias_method :target, :mediatype_dirname
|
60
|
+
alias_method :to, :mediatype_dirname
|
61
|
+
alias_method :target=, :mediatype_dirname=
|
62
|
+
alias_method :to=, :mediatype_dirname=
|
63
|
+
|
55
64
|
private
|
56
65
|
|
57
66
|
def hardlinks?
|