eymiha_url 1.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/gem_package.rb +1 -1
- data/html/classes/Eymiha.html +121 -0
- data/html/classes/Eymiha/UrlException.html +117 -0
- data/html/classes/Eymiha/UrlNormalizer.html +358 -0
- data/html/classes/Eymiha/UrlNormalizer.src/M000001.html +20 -0
- data/html/classes/Eymiha/UrlNormalizer.src/M000002.html +22 -0
- data/html/classes/Eymiha/UrlNormalizer.src/M000003.html +18 -0
- data/html/classes/Eymiha/UrlNormalizer.src/M000004.html +18 -0
- data/html/classes/Eymiha/UrlNormalizer.src/M000005.html +19 -0
- data/html/classes/Eymiha/UrlNormalizer.src/M000006.html +21 -0
- data/html/classes/Eymiha/UrlNormalizer.src/M000007.html +18 -0
- data/html/classes/Eymiha/UrlNormalizer.src/M000008.html +22 -0
- data/html/classes/Eymiha/UrlNormalizer.src/M000009.html +20 -0
- data/html/classes/Eymiha/UrlNormalizer.src/M000010.html +19 -0
- data/html/classes/Eymiha/UrlNormalizer.src/M000011.html +24 -0
- data/html/classes/Eymiha/UrlOpener.html +353 -0
- data/html/classes/Eymiha/UrlOpener.src/M000012.html +18 -0
- data/html/classes/Eymiha/UrlOpener.src/M000013.html +18 -0
- data/html/classes/Eymiha/UrlOpener.src/M000014.html +22 -0
- data/html/classes/Eymiha/UrlOpener.src/M000015.html +18 -0
- data/html/classes/Eymiha/UrlOpener.src/M000016.html +18 -0
- data/html/classes/Eymiha/UrlOpener.src/M000017.html +18 -0
- data/html/classes/Eymiha/UrlOpener.src/M000018.html +23 -0
- data/html/classes/Eymiha/UrlOpener.src/M000019.html +22 -0
- data/html/classes/Eymiha/UrlOpener.src/M000020.html +26 -0
- data/html/classes/Eymiha/UrlOpener.src/M000021.html +18 -0
- data/html/created.rid +1 -0
- data/html/files/lib/eymiha/url/url_exception_rb.html +101 -0
- data/html/files/lib/eymiha/url/url_normalizer_rb.html +109 -0
- data/html/files/lib/eymiha/url/url_opener_rb.html +110 -0
- data/html/files/lib/eymiha/url_rb.html +116 -0
- data/html/files/lib/eymiha_url_rb.html +114 -0
- data/html/fr_class_index.html +30 -0
- data/html/fr_file_index.html +31 -0
- data/html/fr_method_index.html +47 -0
- data/html/index.html +24 -0
- data/html/rdoc-style.css +208 -0
- data/lib/eymiha/url/url_normalizer.rb +9 -2
- data/lib/eymiha/url/url_opener.rb +2 -2
- data/test/tc_url_normalizer.rb +1 -1
- metadata +46 -2
@@ -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>valid_relative_base? (Eymiha::UrlNormalizer)</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/eymiha/url/url_normalizer.rb, line 22</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">valid_relative_base?</span> <span class="ruby-identifier">relative_base</span>
|
15
|
+
((<span class="ruby-ivar">@@using_pc_filesystem</span> <span class="ruby-keyword kw">and</span> (<span class="ruby-identifier">relative_base</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[A-Za-z]:\//</span>)) <span class="ruby-keyword kw">or</span>
|
16
|
+
(<span class="ruby-operator">!</span><span class="ruby-ivar">@@using_pc_filesystem</span> <span class="ruby-keyword kw">and</span> (<span class="ruby-identifier">relative_base</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\//</span>))) <span class="ruby-keyword kw">and</span>
|
17
|
+
(<span class="ruby-identifier">relative_base</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\/$/</span>)
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>relative_base= (Eymiha::UrlNormalizer)</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/eymiha/url/url_normalizer.rb, line 31</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">relative_base=</span>(<span class="ruby-identifier">relative_base</span>)
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">valid_relative_base?</span> <span class="ruby-identifier">relative_base</span>
|
16
|
+
<span class="ruby-ivar">@@relative_base</span> = <span class="ruby-identifier">relative_base</span>
|
17
|
+
<span class="ruby-keyword kw">else</span>
|
18
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">UrlException</span>, <span class="ruby-node">"Invalid relative file base '#{relative_base}'"</span>
|
19
|
+
<span class="ruby-keyword kw">end</span>
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</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>relative_base (Eymiha::UrlNormalizer)</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/eymiha/url/url_normalizer.rb, line 40</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">relative_base</span>
|
15
|
+
<span class="ruby-ivar">@@relative_base</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>new (Eymiha::UrlNormalizer)</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/eymiha/url/url_normalizer.rb, line 48</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>()
|
15
|
+
<span class="ruby-ivar">@relative_base</span> = <span class="ruby-ivar">@@relative_base</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
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>normalize (Eymiha::UrlNormalizer)</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/eymiha/url/url_normalizer.rb, line 54</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">normalize</span>(<span class="ruby-identifier">url</span>,<span class="ruby-identifier">relative_base</span>=<span class="ruby-keyword kw">nil</span>)
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">relative_base</span> = <span class="ruby-identifier">relative_base</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">relative_base</span>
|
16
|
+
(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">file_url?</span> <span class="ruby-identifier">url</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">normalize_file</span>(<span class="ruby-identifier">url</span>) <span class="ruby-operator">:</span> <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">url</span>).<span class="ruby-identifier">to_s</span>
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
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>file_url? (Eymiha::UrlNormalizer)</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/eymiha/url/url_normalizer.rb, line 60</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">file_url?</span> <span class="ruby-identifier">url</span>
|
15
|
+
(<span class="ruby-identifier">url</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^file:/</span>) <span class="ruby-keyword kw">or</span>
|
16
|
+
(<span class="ruby-identifier">url</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\//</span>) <span class="ruby-keyword kw">or</span>
|
17
|
+
((<span class="ruby-identifier">url</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[A-Za-z]:/</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@@using_pc_filesystem</span>) <span class="ruby-keyword kw">or</span>
|
18
|
+
<span class="ruby-operator">!</span>(<span class="ruby-identifier">url</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/:/</span>)
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
20
|
+
</body>
|
21
|
+
</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>normalize_file (Eymiha::UrlNormalizer)</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/eymiha/url/url_normalizer.rb, line 68</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">normalize_file</span> <span class="ruby-identifier">file_url</span>
|
15
|
+
<span class="ruby-node">"file://#{normalize_file_path((file_url =~ /file:\/\//) ? $' : file_url)}"</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>relative_base= (Eymiha::UrlNormalizer)</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/eymiha/url/url_normalizer.rb, line 75</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">relative_base=</span>(<span class="ruby-identifier">relative_base</span>)
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">valid_relative_base?</span> <span class="ruby-identifier">relative_base</span>
|
16
|
+
<span class="ruby-ivar">@relative_base</span> = <span class="ruby-identifier">relative_base</span>
|
17
|
+
<span class="ruby-keyword kw">else</span>
|
18
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">UrlException</span>, <span class="ruby-node">"Invalid relative file base '#{relative_base}'"</span>
|
19
|
+
<span class="ruby-keyword kw">end</span>
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</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>absolute_file_path? (Eymiha::UrlNormalizer)</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/eymiha/url/url_normalizer.rb, line 84</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">absolute_file_path?</span> <span class="ruby-identifier">file_url</span>
|
15
|
+
<span class="ruby-ivar">@@using_pc_filesystem</span> <span class="ruby-operator">?</span>
|
16
|
+
((<span class="ruby-identifier">file_url</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[A-Za-z]:\//</span>) <span class="ruby-keyword kw">or</span> (<span class="ruby-identifier">file_url</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\//</span>)) <span class="ruby-operator">:</span>
|
17
|
+
(<span class="ruby-operator">!</span>(<span class="ruby-identifier">file_url</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[A-Za-z]:/</span>) <span class="ruby-keyword kw">and</span> (<span class="ruby-identifier">file_url</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\//</span>))
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
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>absolute_file_path (Eymiha::UrlNormalizer)</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/eymiha/url/url_normalizer.rb, line 92</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">absolute_file_path</span> <span class="ruby-identifier">file_url</span>
|
15
|
+
(<span class="ruby-ivar">@@using_pc_filesystem</span> <span class="ruby-operator">&&</span> (<span class="ruby-identifier">file_url</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\//</span>)) <span class="ruby-operator">?</span>
|
16
|
+
<span class="ruby-node">"C:#{file_url}"</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">file_url</span>
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
18
|
+
</body>
|
19
|
+
</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>normalize_file_path (Eymiha::UrlNormalizer)</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/eymiha/url/url_normalizer.rb, line 100</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">normalize_file_path</span> <span class="ruby-identifier">file_url</span>
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">absolute_file_path?</span> <span class="ruby-identifier">file_url</span>
|
16
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">absolute_file_path</span> <span class="ruby-identifier">file_url</span>
|
17
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@relative_base</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
18
|
+
<span class="ruby-node">"#{relative_base}#{file_url}"</span>
|
19
|
+
<span class="ruby-keyword kw">else</span>
|
20
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">UrlException</span>, <span class="ruby-value str">"no relative file base was configured"</span>
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
22
|
+
<span class="ruby-keyword kw">end</span></pre>
|
23
|
+
</body>
|
24
|
+
</html>
|
@@ -0,0 +1,353 @@
|
|
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: Eymiha::UrlOpener</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">Eymiha::UrlOpener</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/eymiha/url/url_opener_rb.html">
|
59
|
+
lib/eymiha/url/url_opener.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
|
+
Object
|
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
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
<a href="UrlOpener.html">UrlOpener</a> opens a URL in a user‘s URL
|
84
|
+
viewer of choice. URLs are normalized prior to being opened.
|
85
|
+
</p>
|
86
|
+
<p>
|
87
|
+
Instances use the Kernel::system method to <a
|
88
|
+
href="UrlOpener.html#M000020">open</a> the resource in its own Thread to
|
89
|
+
avoid blocking. Any problems are raised through a caller-supplied exception
|
90
|
+
handler‘s handle(Exception) method.
|
91
|
+
</p>
|
92
|
+
<p>
|
93
|
+
For Apple and Windows, the viewer-of-choice is defaulted to the
|
94
|
+
user‘s designated viewer in the environment. For other platforms, the
|
95
|
+
caller must assign the viewer prior to opening the URL.
|
96
|
+
</p>
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
<div id="method-list">
|
104
|
+
<h3 class="section-bar">Methods</h3>
|
105
|
+
|
106
|
+
<div class="name-list">
|
107
|
+
<a href="#M000017">exception_handler</a>
|
108
|
+
<a href="#M000016">exception_handler=</a>
|
109
|
+
<a href="#M000021">method_missing</a>
|
110
|
+
<a href="#M000018">new</a>
|
111
|
+
<a href="#M000020">open</a>
|
112
|
+
<a href="#M000015">relative_base</a>
|
113
|
+
<a href="#M000014">relative_base=</a>
|
114
|
+
<a href="#M000019">relative_base=</a>
|
115
|
+
<a href="#M000013">url_viewer</a>
|
116
|
+
<a href="#M000012">url_viewer=</a>
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
<!-- if includes -->
|
124
|
+
|
125
|
+
<div id="section">
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
<div id="attribute-list">
|
132
|
+
<h3 class="section-bar">Attributes</h3>
|
133
|
+
|
134
|
+
<div class="name-list">
|
135
|
+
<table>
|
136
|
+
<tr class="top-aligned-row context-row">
|
137
|
+
<td class="context-item-name">exception_handler</td>
|
138
|
+
<td class="context-item-value"> [RW] </td>
|
139
|
+
<td class="context-item-desc"></td>
|
140
|
+
</tr>
|
141
|
+
<tr class="top-aligned-row context-row">
|
142
|
+
<td class="context-item-name">relative_base</td>
|
143
|
+
<td class="context-item-value"> [R] </td>
|
144
|
+
<td class="context-item-desc"></td>
|
145
|
+
</tr>
|
146
|
+
<tr class="top-aligned-row context-row">
|
147
|
+
<td class="context-item-name">url_viewer</td>
|
148
|
+
<td class="context-item-value"> [RW] </td>
|
149
|
+
<td class="context-item-desc"></td>
|
150
|
+
</tr>
|
151
|
+
</table>
|
152
|
+
</div>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<!-- if method_list -->
|
158
|
+
<div id="methods">
|
159
|
+
<h3 class="section-bar">Public Class methods</h3>
|
160
|
+
|
161
|
+
<div id="method-M000017" class="method-detail">
|
162
|
+
<a name="M000017"></a>
|
163
|
+
|
164
|
+
<div class="method-heading">
|
165
|
+
<a href="UrlOpener.src/M000017.html" target="Code" class="method-signature"
|
166
|
+
onclick="popupCode('UrlOpener.src/M000017.html');return false;">
|
167
|
+
<span class="method-name">exception_handler</span><span class="method-args">()</span>
|
168
|
+
</a>
|
169
|
+
</div>
|
170
|
+
|
171
|
+
<div class="method-description">
|
172
|
+
<p>
|
173
|
+
Returns the default exception handler.
|
174
|
+
</p>
|
175
|
+
</div>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
<div id="method-M000016" class="method-detail">
|
179
|
+
<a name="M000016"></a>
|
180
|
+
|
181
|
+
<div class="method-heading">
|
182
|
+
<a href="UrlOpener.src/M000016.html" target="Code" class="method-signature"
|
183
|
+
onclick="popupCode('UrlOpener.src/M000016.html');return false;">
|
184
|
+
<span class="method-name">exception_handler=</span><span class="method-args">(exception_handler)</span>
|
185
|
+
</a>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div class="method-description">
|
189
|
+
<p>
|
190
|
+
Sets and returns the default exception handler. Problems are reported
|
191
|
+
through its handle method, so it should either have the method, or
|
192
|
+
construct it or delegate at runtime.
|
193
|
+
</p>
|
194
|
+
</div>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div id="method-M000018" class="method-detail">
|
198
|
+
<a name="M000018"></a>
|
199
|
+
|
200
|
+
<div class="method-heading">
|
201
|
+
<a href="UrlOpener.src/M000018.html" target="Code" class="method-signature"
|
202
|
+
onclick="popupCode('UrlOpener.src/M000018.html');return false;">
|
203
|
+
<span class="method-name">new</span><span class="method-args">(exception_handler=@@exception_handler, relative_base=@@relative_base, url_viewer=@@url_viewer)</span>
|
204
|
+
</a>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<div class="method-description">
|
208
|
+
<p>
|
209
|
+
Constructs and returns a <a href="UrlOpener.html#M000018">new</a> instance,
|
210
|
+
using the default exception handler, directory for opening relative file
|
211
|
+
resources, and viewer of choice.
|
212
|
+
</p>
|
213
|
+
</div>
|
214
|
+
</div>
|
215
|
+
|
216
|
+
<div id="method-M000015" class="method-detail">
|
217
|
+
<a name="M000015"></a>
|
218
|
+
|
219
|
+
<div class="method-heading">
|
220
|
+
<a href="UrlOpener.src/M000015.html" target="Code" class="method-signature"
|
221
|
+
onclick="popupCode('UrlOpener.src/M000015.html');return false;">
|
222
|
+
<span class="method-name">relative_base</span><span class="method-args">()</span>
|
223
|
+
</a>
|
224
|
+
</div>
|
225
|
+
|
226
|
+
<div class="method-description">
|
227
|
+
<p>
|
228
|
+
Returns the default directory for opening relative file resources.
|
229
|
+
</p>
|
230
|
+
</div>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div id="method-M000014" class="method-detail">
|
234
|
+
<a name="M000014"></a>
|
235
|
+
|
236
|
+
<div class="method-heading">
|
237
|
+
<a href="UrlOpener.src/M000014.html" target="Code" class="method-signature"
|
238
|
+
onclick="popupCode('UrlOpener.src/M000014.html');return false;">
|
239
|
+
<span class="method-name">relative_base=</span><span class="method-args">(relative_base)</span>
|
240
|
+
</a>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
<div class="method-description">
|
244
|
+
<p>
|
245
|
+
Sets and returns the default directory for opening relative file resources.
|
246
|
+
The directory is validated prior to assignment - if invalid a <a
|
247
|
+
href="UrlException.html">UrlException</a> will be raised.
|
248
|
+
</p>
|
249
|
+
</div>
|
250
|
+
</div>
|
251
|
+
|
252
|
+
<div id="method-M000013" class="method-detail">
|
253
|
+
<a name="M000013"></a>
|
254
|
+
|
255
|
+
<div class="method-heading">
|
256
|
+
<a href="UrlOpener.src/M000013.html" target="Code" class="method-signature"
|
257
|
+
onclick="popupCode('UrlOpener.src/M000013.html');return false;">
|
258
|
+
<span class="method-name">url_viewer</span><span class="method-args">()</span>
|
259
|
+
</a>
|
260
|
+
</div>
|
261
|
+
|
262
|
+
<div class="method-description">
|
263
|
+
<p>
|
264
|
+
Returns the user‘s default URL viewer-of-choice.
|
265
|
+
</p>
|
266
|
+
</div>
|
267
|
+
</div>
|
268
|
+
|
269
|
+
<div id="method-M000012" class="method-detail">
|
270
|
+
<a name="M000012"></a>
|
271
|
+
|
272
|
+
<div class="method-heading">
|
273
|
+
<a href="UrlOpener.src/M000012.html" target="Code" class="method-signature"
|
274
|
+
onclick="popupCode('UrlOpener.src/M000012.html');return false;">
|
275
|
+
<span class="method-name">url_viewer=</span><span class="method-args">(url_viewer)</span>
|
276
|
+
</a>
|
277
|
+
</div>
|
278
|
+
|
279
|
+
<div class="method-description">
|
280
|
+
<p>
|
281
|
+
Sets and returns the user‘s default URL viewer-or-choice.
|
282
|
+
</p>
|
283
|
+
</div>
|
284
|
+
</div>
|
285
|
+
|
286
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
287
|
+
|
288
|
+
<div id="method-M000021" class="method-detail">
|
289
|
+
<a name="M000021"></a>
|
290
|
+
|
291
|
+
<div class="method-heading">
|
292
|
+
<a href="UrlOpener.src/M000021.html" target="Code" class="method-signature"
|
293
|
+
onclick="popupCode('UrlOpener.src/M000021.html');return false;">
|
294
|
+
<span class="method-name">method_missing</span><span class="method-args">(method,*args)</span>
|
295
|
+
</a>
|
296
|
+
</div>
|
297
|
+
|
298
|
+
<div class="method-description">
|
299
|
+
</div>
|
300
|
+
</div>
|
301
|
+
|
302
|
+
<div id="method-M000020" class="method-detail">
|
303
|
+
<a name="M000020"></a>
|
304
|
+
|
305
|
+
<div class="method-heading">
|
306
|
+
<a href="UrlOpener.src/M000020.html" target="Code" class="method-signature"
|
307
|
+
onclick="popupCode('UrlOpener.src/M000020.html');return false;">
|
308
|
+
<span class="method-name">open</span><span class="method-args">(url)</span>
|
309
|
+
</a>
|
310
|
+
</div>
|
311
|
+
|
312
|
+
<div class="method-description">
|
313
|
+
<p>
|
314
|
+
opens the given URL in the user‘s viewer of choice. The method uses a
|
315
|
+
separate Thread to avoid blocking. Local file resources are opened relative
|
316
|
+
to the value of the current relative base directory, and any problems are
|
317
|
+
reported through the exception handler.
|
318
|
+
</p>
|
319
|
+
</div>
|
320
|
+
</div>
|
321
|
+
|
322
|
+
<div id="method-M000019" class="method-detail">
|
323
|
+
<a name="M000019"></a>
|
324
|
+
|
325
|
+
<div class="method-heading">
|
326
|
+
<a href="UrlOpener.src/M000019.html" target="Code" class="method-signature"
|
327
|
+
onclick="popupCode('UrlOpener.src/M000019.html');return false;">
|
328
|
+
<span class="method-name">relative_base=</span><span class="method-args">(relative_base)</span>
|
329
|
+
</a>
|
330
|
+
</div>
|
331
|
+
|
332
|
+
<div class="method-description">
|
333
|
+
<p>
|
334
|
+
Sets and Returns the directory for opening relative file resources. The
|
335
|
+
directory is validated prior to assignment - if invalid a <a
|
336
|
+
href="UrlException.html">UrlException</a> will be raised.
|
337
|
+
</p>
|
338
|
+
</div>
|
339
|
+
</div>
|
340
|
+
|
341
|
+
|
342
|
+
</div>
|
343
|
+
|
344
|
+
|
345
|
+
</div>
|
346
|
+
|
347
|
+
|
348
|
+
<div id="validator-badges">
|
349
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
350
|
+
</div>
|
351
|
+
|
352
|
+
</body>
|
353
|
+
</html>
|