druid-tools 0.2.6

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.
Files changed (46) hide show
  1. data/.gitignore +16 -0
  2. data/.rvmrc +1 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE +20 -0
  5. data/README.md +80 -0
  6. data/Rakefile +7 -0
  7. data/VERSION +1 -0
  8. data/doc/classes/DruidTools.html +132 -0
  9. data/doc/classes/DruidTools/DifferentContentExistsError.html +111 -0
  10. data/doc/classes/DruidTools/Druid.html +352 -0
  11. data/doc/classes/DruidTools/Druid.src/M000001.html +18 -0
  12. data/doc/classes/DruidTools/Druid.src/M000002.html +18 -0
  13. data/doc/classes/DruidTools/Druid.src/M000003.html +18 -0
  14. data/doc/classes/DruidTools/Druid.src/M000004.html +24 -0
  15. data/doc/classes/DruidTools/Druid.src/M000005.html +18 -0
  16. data/doc/classes/DruidTools/Druid.src/M000006.html +18 -0
  17. data/doc/classes/DruidTools/Druid.src/M000007.html +20 -0
  18. data/doc/classes/DruidTools/Druid.src/M000008.html +25 -0
  19. data/doc/classes/DruidTools/Druid.src/M000009.html +20 -0
  20. data/doc/classes/DruidTools/Druid.src/M000010.html +27 -0
  21. data/doc/classes/DruidTools/Druid.src/M000011.html +24 -0
  22. data/doc/classes/DruidTools/Druid.src/M000012.html +29 -0
  23. data/doc/classes/DruidTools/InvalidDruidError.html +111 -0
  24. data/doc/classes/DruidTools/SameContentExistsError.html +111 -0
  25. data/doc/created.rid +1 -0
  26. data/doc/files/lib/druid-tools_rb.html +108 -0
  27. data/doc/files/lib/druid_tools/druid_rb.html +108 -0
  28. data/doc/files/lib/druid_tools/exceptions_rb.html +101 -0
  29. data/doc/files/lib/druid_tools/version_rb.html +101 -0
  30. data/doc/files/lib/druid_tools_rb.html +110 -0
  31. data/doc/files/spec/druid_tools_spec_rb.html +115 -0
  32. data/doc/files/spec/spec_helper_rb.html +114 -0
  33. data/doc/fr_class_index.html +28 -0
  34. data/doc/fr_file_index.html +30 -0
  35. data/doc/fr_method_index.html +38 -0
  36. data/doc/index.html +24 -0
  37. data/doc/rdoc-style.css +208 -0
  38. data/druid-tools.gemspec +21 -0
  39. data/lib/druid-tools.rb +1 -0
  40. data/lib/druid_tools.rb +5 -0
  41. data/lib/druid_tools/druid.rb +127 -0
  42. data/lib/druid_tools/exceptions.rb +5 -0
  43. data/lib/druid_tools/version.rb +3 -0
  44. data/spec/druid_tools_spec.rb +255 -0
  45. data/spec/spec_helper.rb +3 -0
  46. metadata +133 -0
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>pattern (DruidTools::Druid)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/druid_tools/druid.rb, line 11</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pattern</span>
15
+ <span class="ruby-node">/\A(?:#{self.prefix}:)?([a-z]{2})(\d{3})([a-z]{2})(\d{4})\z/</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>glob (DruidTools::Druid)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/druid_tools/druid.rb, line 16</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">glob</span>
15
+ <span class="ruby-node">&quot;{#{self.prefix}:,}[a-z][a-z][0-9][0-9][0-9][a-z][a-z][0-9][0-9][0-9][0-9]&quot;</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>valid? (DruidTools::Druid)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/druid_tools/druid.rb, line 22</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid?</span>(<span class="ruby-identifier">druid</span>)
15
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">druid</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">pattern</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>new (DruidTools::Druid)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/druid_tools/druid.rb, line 44</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">druid</span>, <span class="ruby-identifier">base</span>=<span class="ruby-value str">'.'</span>)
15
+ <span class="ruby-identifier">druid</span> = <span class="ruby-identifier">druid</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">druid</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">String</span>
16
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">valid?</span>(<span class="ruby-identifier">druid</span>)
17
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Invalid DRUID: '#{druid}'&quot;</span>
18
+ <span class="ruby-keyword kw">end</span>
19
+ <span class="ruby-identifier">druid</span> = [<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">prefix</span>,<span class="ruby-identifier">druid</span>].<span class="ruby-identifier">join</span>(<span class="ruby-value str">':'</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">druid</span> <span class="ruby-operator">=~</span> <span class="ruby-node">/^#{self.class.prefix}:/</span>
20
+ <span class="ruby-ivar">@base</span> = <span class="ruby-identifier">base</span>
21
+ <span class="ruby-ivar">@druid</span> = <span class="ruby-identifier">druid</span>
22
+ <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>id (DruidTools::Druid)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/druid_tools/druid.rb, line 54</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">id</span>
15
+ <span class="ruby-ivar">@druid</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">pattern</span>).<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">''</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>tree (DruidTools::Druid)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/druid_tools/druid.rb, line 58</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tree</span>
15
+ <span class="ruby-ivar">@druid</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">pattern</span>).<span class="ruby-identifier">flatten</span> <span class="ruby-operator">+</span> [<span class="ruby-identifier">id</span>]
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>path (DruidTools::Druid)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/druid_tools/druid.rb, line 62</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path</span>(<span class="ruby-identifier">extra</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">create</span>=<span class="ruby-keyword kw">false</span>)
15
+ <span class="ruby-identifier">result</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-operator">*</span>([<span class="ruby-identifier">base</span>,<span class="ruby-identifier">tree</span>,<span class="ruby-identifier">extra</span>].<span class="ruby-identifier">compact</span>))
16
+ <span class="ruby-identifier">mkdir</span>(<span class="ruby-identifier">extra</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">create</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">result</span>)
17
+ <span class="ruby-identifier">result</span>
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>mkdir (DruidTools::Druid)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/druid_tools/druid.rb, line 68</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mkdir</span>(<span class="ruby-identifier">extra</span>=<span class="ruby-keyword kw">nil</span>)
15
+ <span class="ruby-identifier">new_path</span> = <span class="ruby-identifier">path</span>(<span class="ruby-identifier">extra</span>)
16
+ <span class="ruby-keyword kw">if</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">symlink?</span> <span class="ruby-identifier">new_path</span>)
17
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">DruidTools</span><span class="ruby-operator">::</span><span class="ruby-constant">DifferentContentExistsError</span>, <span class="ruby-node">&quot;Unable to create directory, link already exists: #{new_path}&quot;</span>
18
+ <span class="ruby-keyword kw">end</span>
19
+ <span class="ruby-keyword kw">if</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">new_path</span>)
20
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">DruidTools</span><span class="ruby-operator">::</span><span class="ruby-constant">SameContentExistsError</span>, <span class="ruby-node">&quot;The directory already exists: #{new_path}&quot;</span>
21
+ <span class="ruby-keyword kw">end</span>
22
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">new_path</span>)
23
+ <span class="ruby-keyword kw">end</span></pre>
24
+ </body>
25
+ </html>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>find (DruidTools::Druid)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/druid_tools/druid.rb, line 79</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">path</span>)
15
+ <span class="ruby-identifier">possibles</span> = [<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>(<span class="ruby-identifier">type</span>.<span class="ruby-identifier">to_s</span>),<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>,<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-value str">'..'</span>,<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>)]
16
+ <span class="ruby-identifier">loc</span> = <span class="ruby-identifier">possibles</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">p</span>,<span class="ruby-identifier">path</span>)) }
17
+ <span class="ruby-identifier">loc</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">loc</span>,<span class="ruby-identifier">path</span>)
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>find_filelist_parent (DruidTools::Druid)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/druid_tools/druid.rb, line 89</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_filelist_parent</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">filelist</span>)
15
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;File list not specified&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filelist</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">filelist</span>.<span class="ruby-identifier">empty?</span>
16
+ <span class="ruby-identifier">filelist</span> = [<span class="ruby-identifier">filelist</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filelist</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
17
+ <span class="ruby-identifier">search_dir</span> = <span class="ruby-constant">Pathname</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>(<span class="ruby-identifier">type</span>))
18
+ <span class="ruby-identifier">directories</span> = [<span class="ruby-identifier">search_dir</span>, <span class="ruby-identifier">search_dir</span>.<span class="ruby-identifier">parent</span>, <span class="ruby-identifier">search_dir</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">parent</span>]
19
+ <span class="ruby-identifier">found_dir</span> = <span class="ruby-identifier">directories</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">pathname</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pathname</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">filelist</span>[<span class="ruby-value">0</span>]).<span class="ruby-identifier">exist?</span> }
20
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;#{type} dir not found for '#{filelist[0]}' when searching '#{search_dir}'&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">found_dir</span>.<span class="ruby-identifier">nil?</span>
21
+ <span class="ruby-identifier">filelist</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filename</span><span class="ruby-operator">|</span>
22
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;File '#{filename}' not found in #{type} dir s'#{found_dir}'&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">found_dir</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">filename</span>).<span class="ruby-identifier">exist?</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-identifier">found_dir</span>
25
+ <span class="ruby-keyword kw">end</span></pre>
26
+ </body>
27
+ </html>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>mkdir_with_final_link (DruidTools::Druid)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/druid_tools/druid.rb, line 102</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mkdir_with_final_link</span>(<span class="ruby-identifier">source</span>, <span class="ruby-identifier">extra</span>=<span class="ruby-keyword kw">nil</span>)
15
+ <span class="ruby-identifier">new_path</span> = <span class="ruby-identifier">path</span>(<span class="ruby-identifier">extra</span>)
16
+ <span class="ruby-keyword kw">if</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">new_path</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">symlink?</span>(<span class="ruby-identifier">new_path</span>))
17
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">DruidTools</span><span class="ruby-operator">::</span><span class="ruby-constant">DifferentContentExistsError</span>, <span class="ruby-node">&quot;Unable to create link, directory already exists: #{new_path}&quot;</span>
18
+ <span class="ruby-keyword kw">end</span>
19
+ <span class="ruby-identifier">real_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-value str">'..'</span>,<span class="ruby-identifier">new_path</span>)
20
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">real_path</span>)
21
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">ln_s</span>(<span class="ruby-identifier">source</span>, <span class="ruby-identifier">new_path</span>, <span class="ruby-identifier">:force=</span><span class="ruby-operator">&gt;</span><span class="ruby-keyword kw">true</span>)
22
+ <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </html>
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>rmdir (DruidTools::Druid)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/druid_tools/druid.rb, line 112</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rmdir</span>(<span class="ruby-identifier">extra</span>=<span class="ruby-keyword kw">nil</span>)
15
+ <span class="ruby-identifier">parts</span> = <span class="ruby-identifier">tree</span>
16
+ <span class="ruby-identifier">parts</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">extra</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">extra</span>.<span class="ruby-identifier">nil?</span>
17
+ <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">parts</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
18
+ <span class="ruby-identifier">dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">base</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">parts</span>)
19
+ <span class="ruby-keyword kw">begin</span>
20
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">dir</span>,<span class="ruby-value str">'.DS_Store'</span>), <span class="ruby-identifier">:force</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>)
21
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rmdir</span>(<span class="ruby-identifier">dir</span>)
22
+ <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOTEMPTY</span>
23
+ <span class="ruby-keyword kw">break</span>
24
+ <span class="ruby-keyword kw">end</span>
25
+ <span class="ruby-identifier">parts</span>.<span class="ruby-identifier">pop</span>
26
+ <span class="ruby-keyword kw">end</span>
27
+ <span class="ruby-keyword kw">end</span></pre>
28
+ </body>
29
+ </html>
@@ -0,0 +1,111 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: DruidTools::InvalidDruidError</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">DruidTools::InvalidDruidError</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/druid_tools/exceptions_rb.html">
59
+ lib/druid_tools/exceptions.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Exception
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+
82
+
83
+ </div>
84
+
85
+
86
+ </div>
87
+
88
+
89
+ <!-- if includes -->
90
+
91
+ <div id="section">
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <!-- if method_list -->
101
+
102
+
103
+ </div>
104
+
105
+
106
+ <div id="validator-badges">
107
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
108
+ </div>
109
+
110
+ </body>
111
+ </html>
@@ -0,0 +1,111 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: DruidTools::SameContentExistsError</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">DruidTools::SameContentExistsError</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/druid_tools/exceptions_rb.html">
59
+ lib/druid_tools/exceptions.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Exception
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+
82
+
83
+ </div>
84
+
85
+
86
+ </div>
87
+
88
+
89
+ <!-- if includes -->
90
+
91
+ <div id="section">
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <!-- if method_list -->
101
+
102
+
103
+ </div>
104
+
105
+
106
+ <div id="validator-badges">
107
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
108
+ </div>
109
+
110
+ </body>
111
+ </html>