mediatype_directory 0.0.2 → 0.0.3

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/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?
@@ -1,3 +1,3 @@
1
1
  module MediatypeDirectory
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mediatype_directory
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Lavin