boris 1.0.0.beta.1
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/LICENSE.md +9 -0
- data/README.md +94 -0
- data/boris.gemspec +28 -0
- data/doc/Array.html +437 -0
- data/doc/Boris.html +230 -0
- data/doc/Boris/ConnectionAlreadyActive.html +123 -0
- data/doc/Boris/ConnectionFailed.html +127 -0
- data/doc/Boris/Connector.html +794 -0
- data/doc/Boris/InvalidCredentials.html +131 -0
- data/doc/Boris/InvalidOption.html +123 -0
- data/doc/Boris/InvalidTargetName.html +123 -0
- data/doc/Boris/Lumberjack.html +466 -0
- data/doc/Boris/MissingCredentials.html +123 -0
- data/doc/Boris/NoActiveConnection.html +123 -0
- data/doc/Boris/NoProfileDetected.html +123 -0
- data/doc/Boris/Options.html +783 -0
- data/doc/Boris/Profiles.html +117 -0
- data/doc/Boris/Profiles/Linux.html +1151 -0
- data/doc/Boris/Profiles/RedHat.html +875 -0
- data/doc/Boris/Profiles/Solaris.html +1230 -0
- data/doc/Boris/Profiles/Structure.html +2050 -0
- data/doc/Boris/Profiles/UNIX.html +893 -0
- data/doc/Boris/Profiles/Windows.html +1846 -0
- data/doc/Boris/Profiles/Windows/Windows2003.html +304 -0
- data/doc/Boris/Profiles/Windows/Windows2008.html +379 -0
- data/doc/Boris/Profiles/Windows/Windows2012.html +304 -0
- data/doc/Boris/SNMPConnector.html +512 -0
- data/doc/Boris/SSHConnector.html +633 -0
- data/doc/Boris/Target.html +2002 -0
- data/doc/Boris/WMIConnector.html +1134 -0
- data/doc/BorisLogger.html +217 -0
- data/doc/Hash.html +195 -0
- data/doc/String.html +1246 -0
- data/doc/_index.html +420 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.README.html +183 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +183 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1468 -0
- data/doc/top-level-namespace.html +126 -0
- data/lib/boris.rb +30 -0
- data/lib/boris/connectors.rb +47 -0
- data/lib/boris/connectors/snmp.rb +56 -0
- data/lib/boris/connectors/ssh.rb +110 -0
- data/lib/boris/connectors/wmi.rb +186 -0
- data/lib/boris/errors.rb +17 -0
- data/lib/boris/helpers/array.rb +63 -0
- data/lib/boris/helpers/constants.rb +20 -0
- data/lib/boris/helpers/hash.rb +8 -0
- data/lib/boris/helpers/scrubber.rb +51 -0
- data/lib/boris/helpers/string.rb +130 -0
- data/lib/boris/lumberjack.rb +47 -0
- data/lib/boris/options.rb +86 -0
- data/lib/boris/profiles/linux/redhat.rb +77 -0
- data/lib/boris/profiles/linux_core.rb +216 -0
- data/lib/boris/profiles/unix/solaris.rb +307 -0
- data/lib/boris/profiles/unix_core.rb +85 -0
- data/lib/boris/profiles/windows/windows2003.rb +15 -0
- data/lib/boris/profiles/windows/windows2008.rb +23 -0
- data/lib/boris/profiles/windows/windows2012.rb +15 -0
- data/lib/boris/profiles/windows_core.rb +530 -0
- data/lib/boris/structure.rb +167 -0
- data/lib/boris/target.rb +340 -0
- data/test/connector_tests/test_snmp.rb +35 -0
- data/test/connector_tests/test_ssh.rb +51 -0
- data/test/connector_tests/test_wmi.rb +129 -0
- data/test/helper_tests/test_array.rb +25 -0
- data/test/helper_tests/test_hash.rb +10 -0
- data/test/helper_tests/test_string.rb +136 -0
- data/test/profile_tests/test_core_skeleton +107 -0
- data/test/profile_tests/test_linux_core.rb +331 -0
- data/test/profile_tests/test_redhat.rb +134 -0
- data/test/profile_tests/test_solaris.rb +523 -0
- data/test/profile_tests/test_unix_core.rb +117 -0
- data/test/profile_tests/test_windows.rb +536 -0
- data/test/setup_tests.rb +14 -0
- data/test/test_all.rb +8 -0
- data/test/test_options.rb +44 -0
- data/test/test_structure.rb +136 -0
- data/test/test_target.rb +146 -0
- metadata +241 -0
@@ -0,0 +1,123 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Exception: Boris::MissingCredentials
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (M)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Boris.html" title="Boris (module)">Boris</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">MissingCredentials</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Exception: Boris::MissingCredentials
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Exception</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">Exception</li>
|
82
|
+
|
83
|
+
<li class="next">Boris::MissingCredentials</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/boris/errors.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<div id="footer">
|
117
|
+
Generated on Sun Feb 3 16:32:42 2013 by
|
118
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
|
+
0.8.3 (ruby-1.9.3).
|
120
|
+
</div>
|
121
|
+
|
122
|
+
</body>
|
123
|
+
</html>
|
@@ -0,0 +1,123 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Exception: Boris::NoActiveConnection
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (N)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Boris.html" title="Boris (module)">Boris</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">NoActiveConnection</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Exception: Boris::NoActiveConnection
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">StandardError</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">StandardError</li>
|
82
|
+
|
83
|
+
<li class="next">Boris::NoActiveConnection</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/boris/errors.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<div id="footer">
|
117
|
+
Generated on Sun Feb 3 16:32:42 2013 by
|
118
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
|
+
0.8.3 (ruby-1.9.3).
|
120
|
+
</div>
|
121
|
+
|
122
|
+
</body>
|
123
|
+
</html>
|
@@ -0,0 +1,123 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Exception: Boris::NoProfileDetected
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (N)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Boris.html" title="Boris (module)">Boris</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">NoProfileDetected</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Exception: Boris::NoProfileDetected
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">StandardError</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">StandardError</li>
|
82
|
+
|
83
|
+
<li class="next">Boris::NoProfileDetected</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/boris/errors.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<div id="footer">
|
117
|
+
Generated on Sun Feb 3 16:32:42 2013 by
|
118
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
|
+
0.8.3 (ruby-1.9.3).
|
120
|
+
</div>
|
121
|
+
|
122
|
+
</body>
|
123
|
+
</html>
|
@@ -0,0 +1,783 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Boris::Options
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (O)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Boris.html" title="Boris (module)">Boris</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Options</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: Boris::Options
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">Boris::Options</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/boris/options.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
107
|
+
<ul class="summary">
|
108
|
+
|
109
|
+
<li class="public ">
|
110
|
+
<span class="summary_signature">
|
111
|
+
|
112
|
+
<a href="#options-instance_method" title="#options (instance method)">- (Object) <strong>options</strong> </a>
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
</span>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<span class="summary_desc"><div class='inline'>
|
130
|
+
<p>Returns the value of attribute options.</p>
|
131
|
+
</div></span>
|
132
|
+
|
133
|
+
</li>
|
134
|
+
|
135
|
+
|
136
|
+
</ul>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<h2>
|
143
|
+
Instance Method Summary
|
144
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
145
|
+
</h2>
|
146
|
+
|
147
|
+
<ul class="summary">
|
148
|
+
|
149
|
+
<li class="public ">
|
150
|
+
<span class="summary_signature">
|
151
|
+
|
152
|
+
<a href="#%5B%5D-instance_method" title="#[] (instance method)">- (Object) <strong>[]</strong>(key) </a>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
</span>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
<span class="summary_desc"><div class='inline'>
|
167
|
+
<p>Getter method for grabbing a value from the Options.</p>
|
168
|
+
</div></span>
|
169
|
+
|
170
|
+
</li>
|
171
|
+
|
172
|
+
|
173
|
+
<li class="public ">
|
174
|
+
<span class="summary_signature">
|
175
|
+
|
176
|
+
<a href="#%5B%5D%3D-instance_method" title="#[]= (instance method)">- (Object) <strong>[]=</strong>(key, val) </a>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
</span>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
<span class="summary_desc"><div class='inline'>
|
191
|
+
<p>Setter method for setting the value in the options hash.</p>
|
192
|
+
</div></span>
|
193
|
+
|
194
|
+
</li>
|
195
|
+
|
196
|
+
|
197
|
+
<li class="public ">
|
198
|
+
<span class="summary_signature">
|
199
|
+
|
200
|
+
<a href="#add_credential-instance_method" title="#add_credential (instance method)">- (Object) <strong>add_credential</strong>(cred) </a>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
</span>
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
<span class="summary_desc"><div class='inline'>
|
215
|
+
<p>Provides a simple mechanism for adding credentials to the credentials array
|
216
|
+
of Options.</p>
|
217
|
+
</div></span>
|
218
|
+
|
219
|
+
</li>
|
220
|
+
|
221
|
+
|
222
|
+
<li class="public ">
|
223
|
+
<span class="summary_signature">
|
224
|
+
|
225
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Options) <strong>initialize</strong>(options = {}) </a>
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
</span>
|
230
|
+
|
231
|
+
|
232
|
+
<span class="note title constructor">constructor</span>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
<span class="summary_desc"><div class='inline'>
|
242
|
+
<p>Creates our options hash where the user can pass in an optional hash to
|
243
|
+
immediately override the default values.</p>
|
244
|
+
</div></span>
|
245
|
+
|
246
|
+
</li>
|
247
|
+
|
248
|
+
|
249
|
+
</ul>
|
250
|
+
|
251
|
+
|
252
|
+
<div id="constructor_details" class="method_details_list">
|
253
|
+
<h2>Constructor Details</h2>
|
254
|
+
|
255
|
+
<div class="method_details first">
|
256
|
+
<h3 class="signature first" id="initialize-instance_method">
|
257
|
+
|
258
|
+
- (<tt><span class='object_link'><a href="" title="Boris::Options (class)">Options</a></span></tt>) <strong>initialize</strong>(options = {})
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
</h3><div class="docstring">
|
265
|
+
<div class="discussion">
|
266
|
+
|
267
|
+
<p>Creates our options hash where the user can pass in an optional hash to
|
268
|
+
immediately override the default values.</p>
|
269
|
+
|
270
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_credentials'>credentials</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='lbrace'>{</span><span class='symbol'>:user</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>joe</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:password</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>mypassword</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:connection_types</span><span class='op'>=></span><span class='lbracket'>[</span><span class='symbol'>:ssh</span><span class='comma'>,</span> <span class='symbol'>:wmi</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rbracket'>]</span>
|
271
|
+
<span class='id identifier rubyid_ssh_keys'>ssh_keys</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/home/joe/private_key</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
272
|
+
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='const'>Boris</span><span class='op'>::</span><span class='const'>Options</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:log_level</span><span class='op'>=></span><span class='symbol'>:debug</span><span class='comma'>,</span> <span class='symbol'>:ssh_options</span><span class='op'>=></span><span class='lbrace'>{</span><span class='symbol'>:keys</span><span class='op'>=></span><span class='id identifier rubyid_ssh_keys'>ssh_keys</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='symbol'>:credentials</span><span class='op'>=></span><span class='id identifier rubyid_credentials'>credentials</span><span class='rparen'>)</span></code></pre>
|
273
|
+
|
274
|
+
|
275
|
+
</div>
|
276
|
+
</div>
|
277
|
+
<div class="tags">
|
278
|
+
<p class="tag_title">Parameters:</p>
|
279
|
+
<ul class="param">
|
280
|
+
|
281
|
+
<li>
|
282
|
+
|
283
|
+
<span class='name'>options</span>
|
284
|
+
|
285
|
+
|
286
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
|
287
|
+
|
288
|
+
|
289
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
290
|
+
|
291
|
+
|
292
|
+
—
|
293
|
+
<div class='inline'>
|
294
|
+
<p>a customizable set of options</p>
|
295
|
+
</div>
|
296
|
+
|
297
|
+
</li>
|
298
|
+
|
299
|
+
</ul>
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
<p class="tag_title">Options Hash (<tt>options</tt>):</p>
|
305
|
+
<ul class="option">
|
306
|
+
|
307
|
+
<li>
|
308
|
+
<span class="name">:auto_scrub_data</span>
|
309
|
+
<span class="type">(<tt>Boolean</tt>)</span>
|
310
|
+
<span class="default">
|
311
|
+
|
312
|
+
</span>
|
313
|
+
|
314
|
+
— <div class='inline'>
|
315
|
+
<p>should the target's data be scrubbed after running #retrieve_all?</p>
|
316
|
+
</div>
|
317
|
+
|
318
|
+
</li>
|
319
|
+
|
320
|
+
<li>
|
321
|
+
<span class="name">:credentials</span>
|
322
|
+
<span class="type">(<tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span></tt>)</span>
|
323
|
+
<span class="default">
|
324
|
+
|
325
|
+
</span>
|
326
|
+
|
327
|
+
— <div class='inline'>
|
328
|
+
<p>an array of credentials in the format of <tt>:user</tt>,
|
329
|
+
<tt>:password</tt>, <tt>:connection_types</tt>. Only <tt>:user</tt> is
|
330
|
+
mandatory.</p>
|
331
|
+
</div>
|
332
|
+
|
333
|
+
</li>
|
334
|
+
|
335
|
+
<li>
|
336
|
+
<span class="name">:log_level</span>
|
337
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
338
|
+
<span class="default">
|
339
|
+
|
340
|
+
</span>
|
341
|
+
|
342
|
+
— <div class='inline'>
|
343
|
+
<p>The level of logging. Options are: <tt>:debug</tt>, <tt>:info</tt>,
|
344
|
+
<tt>:warn</tt>, <tt>:error</tt>, <tt>:fatal (default)</tt></p>
|
345
|
+
</div>
|
346
|
+
|
347
|
+
</li>
|
348
|
+
|
349
|
+
<li>
|
350
|
+
<span class="name">profiles</span>
|
351
|
+
<span class="type">(<tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span></tt>)</span>
|
352
|
+
<span class="default">
|
353
|
+
|
354
|
+
</span>
|
355
|
+
|
356
|
+
— <div class='inline'>
|
357
|
+
<p>An array of module names of the profiles we wish to have available for use
|
358
|
+
on this target. <span class='object_link'><a href="Profiles/RedHat.html" title="Boris::Profiles::RedHat (module)">Profiles::RedHat</a></span> and <span class='object_link'><a href="Profiles/Solaris.html" title="Boris::Profiles::Solaris (module)">Profiles::Solaris</a></span> are
|
359
|
+
always the defaults, and Windows profiles are included as defaults as well
|
360
|
+
if <span class='object_link'><a href="../Boris.html" title="Boris (module)">Boris</a></span> is running on a Windows host (where WMI connections are
|
361
|
+
available)</p>
|
362
|
+
</div>
|
363
|
+
|
364
|
+
</li>
|
365
|
+
|
366
|
+
<li>
|
367
|
+
<span class="name">snmp_options</span>
|
368
|
+
<span class="type">(<tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
|
369
|
+
<span class="default">
|
370
|
+
|
371
|
+
</span>
|
372
|
+
|
373
|
+
— <div class='inline'>
|
374
|
+
<p>A hash of options supported by ruby-snmp.</p>
|
375
|
+
</div>
|
376
|
+
|
377
|
+
</li>
|
378
|
+
|
379
|
+
<li>
|
380
|
+
<span class="name">ssh_options</span>
|
381
|
+
<span class="type">(<tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
|
382
|
+
<span class="default">
|
383
|
+
|
384
|
+
</span>
|
385
|
+
|
386
|
+
— <div class='inline'>
|
387
|
+
<p>A hash of options supported by net-ssh.</p>
|
388
|
+
</div>
|
389
|
+
|
390
|
+
</li>
|
391
|
+
|
392
|
+
</ul>
|
393
|
+
|
394
|
+
|
395
|
+
<p class="tag_title">Raises:</p>
|
396
|
+
<ul class="raise">
|
397
|
+
|
398
|
+
<li>
|
399
|
+
|
400
|
+
|
401
|
+
<span class='type'></span>
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
<div class='inline'>
|
407
|
+
<p>ArgumentError when invalid arguments are passed</p>
|
408
|
+
</div>
|
409
|
+
|
410
|
+
</li>
|
411
|
+
|
412
|
+
</ul>
|
413
|
+
|
414
|
+
</div><table class="source_code">
|
415
|
+
<tr>
|
416
|
+
<td>
|
417
|
+
<pre class="lines">
|
418
|
+
|
419
|
+
|
420
|
+
27
|
421
|
+
28
|
422
|
+
29
|
423
|
+
30
|
424
|
+
31
|
425
|
+
32
|
426
|
+
33
|
427
|
+
34
|
428
|
+
35
|
429
|
+
36
|
430
|
+
37
|
431
|
+
38
|
432
|
+
39
|
433
|
+
40
|
434
|
+
41
|
435
|
+
42
|
436
|
+
43
|
437
|
+
44
|
438
|
+
45
|
439
|
+
46</pre>
|
440
|
+
</td>
|
441
|
+
<td>
|
442
|
+
<pre class="code"><span class="info file"># File 'lib/boris/options.rb', line 27</span>
|
443
|
+
|
444
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
445
|
+
<span class='ivar'>@options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
446
|
+
|
447
|
+
<span class='comment'># set our defaults
|
448
|
+
</span> <span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:auto_scrub_data</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='kw'>true</span>
|
449
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:credentials</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
450
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:log_level</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='symbol'>:fatal</span>
|
451
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:profiles</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='const'>Profiles</span><span class='op'>::</span><span class='const'>RedHat</span><span class='comma'>,</span> <span class='const'>Profiles</span><span class='op'>::</span><span class='const'>Solaris</span><span class='rbracket'>]</span>
|
452
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:profiles</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_concat'>concat</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='const'>Profiles</span><span class='op'>::</span><span class='const'>Windows</span><span class='op'>::</span><span class='const'>Windows2003</span><span class='comma'>,</span> <span class='const'>Profiles</span><span class='op'>::</span><span class='const'>Windows</span><span class='op'>::</span><span class='const'>Windows2008</span><span class='comma'>,</span> <span class='const'>Profiles</span><span class='op'>::</span><span class='const'>Windows</span><span class='op'>::</span><span class='const'>Windows2012</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='const'>PLATFORM</span> <span class='op'>==</span> <span class='symbol'>:win32</span>
|
453
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:snmp_options</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
454
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:ssh_options</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
455
|
+
|
456
|
+
<span class='id identifier rubyid_invalid_options'>invalid_options</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span> <span class='op'>-</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span>
|
457
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_invalid_options'>invalid_options</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
458
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>invalid options specified (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_invalid_options'>invalid_options</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>, </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
459
|
+
<span class='kw'>end</span>
|
460
|
+
|
461
|
+
<span class='comment'># override the defaults with passed in Options
|
462
|
+
</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
463
|
+
<span class='kw'>end</span></pre>
|
464
|
+
</td>
|
465
|
+
</tr>
|
466
|
+
</table>
|
467
|
+
</div>
|
468
|
+
|
469
|
+
</div>
|
470
|
+
|
471
|
+
<div id="instance_attr_details" class="attr_details">
|
472
|
+
<h2>Instance Attribute Details</h2>
|
473
|
+
|
474
|
+
|
475
|
+
<span id="options=-instance_method"></span>
|
476
|
+
<div class="method_details first">
|
477
|
+
<h3 class="signature first" id="options-instance_method">
|
478
|
+
|
479
|
+
- (<tt>Object</tt>) <strong>options</strong>
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
</h3><div class="docstring">
|
486
|
+
<div class="discussion">
|
487
|
+
|
488
|
+
<p>Returns the value of attribute options</p>
|
489
|
+
|
490
|
+
|
491
|
+
</div>
|
492
|
+
</div>
|
493
|
+
<div class="tags">
|
494
|
+
|
495
|
+
|
496
|
+
</div><table class="source_code">
|
497
|
+
<tr>
|
498
|
+
<td>
|
499
|
+
<pre class="lines">
|
500
|
+
|
501
|
+
|
502
|
+
3
|
503
|
+
4
|
504
|
+
5</pre>
|
505
|
+
</td>
|
506
|
+
<td>
|
507
|
+
<pre class="code"><span class="info file"># File 'lib/boris/options.rb', line 3</span>
|
508
|
+
|
509
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_options'>options</span>
|
510
|
+
<span class='ivar'>@options</span>
|
511
|
+
<span class='kw'>end</span></pre>
|
512
|
+
</td>
|
513
|
+
</tr>
|
514
|
+
</table>
|
515
|
+
</div>
|
516
|
+
|
517
|
+
</div>
|
518
|
+
|
519
|
+
|
520
|
+
<div id="instance_method_details" class="method_details_list">
|
521
|
+
<h2>Instance Method Details</h2>
|
522
|
+
|
523
|
+
|
524
|
+
<div class="method_details first">
|
525
|
+
<h3 class="signature first" id="[]-instance_method">
|
526
|
+
|
527
|
+
- (<tt>Object</tt>) <strong>[]</strong>(key)
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
</h3><div class="docstring">
|
534
|
+
<div class="discussion">
|
535
|
+
|
536
|
+
<p>Getter method for grabbing a value from the Options.</p>
|
537
|
+
|
538
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:log_level</span><span class='rbracket'>]</span> <span class='comment'>#=> :debug</span></code></pre>
|
539
|
+
|
540
|
+
|
541
|
+
</div>
|
542
|
+
</div>
|
543
|
+
<div class="tags">
|
544
|
+
<p class="tag_title">Parameters:</p>
|
545
|
+
<ul class="param">
|
546
|
+
|
547
|
+
<li>
|
548
|
+
|
549
|
+
<span class='name'>key</span>
|
550
|
+
|
551
|
+
|
552
|
+
<span class='type'></span>
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
—
|
557
|
+
<div class='inline'>
|
558
|
+
<p>symbol of the key-value pair</p>
|
559
|
+
</div>
|
560
|
+
|
561
|
+
</li>
|
562
|
+
|
563
|
+
</ul>
|
564
|
+
|
565
|
+
<p class="tag_title">Returns:</p>
|
566
|
+
<ul class="return">
|
567
|
+
|
568
|
+
<li>
|
569
|
+
|
570
|
+
|
571
|
+
<span class='type'></span>
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
<div class='inline'>
|
577
|
+
<p>returns the value of specified key from Options</p>
|
578
|
+
</div>
|
579
|
+
|
580
|
+
</li>
|
581
|
+
|
582
|
+
</ul>
|
583
|
+
|
584
|
+
</div><table class="source_code">
|
585
|
+
<tr>
|
586
|
+
<td>
|
587
|
+
<pre class="lines">
|
588
|
+
|
589
|
+
|
590
|
+
53
|
591
|
+
54
|
592
|
+
55</pre>
|
593
|
+
</td>
|
594
|
+
<td>
|
595
|
+
<pre class="code"><span class="info file"># File 'lib/boris/options.rb', line 53</span>
|
596
|
+
|
597
|
+
<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
598
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
|
599
|
+
<span class='kw'>end</span></pre>
|
600
|
+
</td>
|
601
|
+
</tr>
|
602
|
+
</table>
|
603
|
+
</div>
|
604
|
+
|
605
|
+
<div class="method_details ">
|
606
|
+
<h3 class="signature " id="[]=-instance_method">
|
607
|
+
|
608
|
+
- (<tt>Object</tt>) <strong>[]=</strong>(key, val)
|
609
|
+
|
610
|
+
|
611
|
+
|
612
|
+
|
613
|
+
|
614
|
+
</h3><div class="docstring">
|
615
|
+
<div class="discussion">
|
616
|
+
|
617
|
+
<p>Setter method for setting the value in the options hash</p>
|
618
|
+
|
619
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:log_level</span><span class='rbracket'>]</span> <span class='comment'>#=> :debug
|
620
|
+
</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:log_level</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='symbol'>:info</span>
|
621
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:log_level</span><span class='rbracket'>]</span> <span class='comment'>#=> :info</span></code></pre>
|
622
|
+
|
623
|
+
|
624
|
+
</div>
|
625
|
+
</div>
|
626
|
+
<div class="tags">
|
627
|
+
|
628
|
+
<p class="tag_title">Raises:</p>
|
629
|
+
<ul class="raise">
|
630
|
+
|
631
|
+
<li>
|
632
|
+
|
633
|
+
|
634
|
+
<span class='type'></span>
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
<div class='inline'>
|
640
|
+
<p>ArgumentError when invalid options are provided</p>
|
641
|
+
</div>
|
642
|
+
|
643
|
+
</li>
|
644
|
+
|
645
|
+
</ul>
|
646
|
+
|
647
|
+
</div><table class="source_code">
|
648
|
+
<tr>
|
649
|
+
<td>
|
650
|
+
<pre class="lines">
|
651
|
+
|
652
|
+
|
653
|
+
62
|
654
|
+
63
|
655
|
+
64
|
656
|
+
65</pre>
|
657
|
+
</td>
|
658
|
+
<td>
|
659
|
+
<pre class="code"><span class="info file"># File 'lib/boris/options.rb', line 62</span>
|
660
|
+
|
661
|
+
<span class='kw'>def</span> <span class='op'>[]=</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_val'>val</span><span class='rparen'>)</span>
|
662
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>invalid option provided</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
663
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_val'>val</span>
|
664
|
+
<span class='kw'>end</span></pre>
|
665
|
+
</td>
|
666
|
+
</tr>
|
667
|
+
</table>
|
668
|
+
</div>
|
669
|
+
|
670
|
+
<div class="method_details ">
|
671
|
+
<h3 class="signature " id="add_credential-instance_method">
|
672
|
+
|
673
|
+
- (<tt>Object</tt>) <strong>add_credential</strong>(cred)
|
674
|
+
|
675
|
+
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
</h3><div class="docstring">
|
680
|
+
<div class="discussion">
|
681
|
+
|
682
|
+
<p>Provides a simple mechanism for adding credentials to the credentials array
|
683
|
+
of Options.</p>
|
684
|
+
|
685
|
+
|
686
|
+
</div>
|
687
|
+
</div>
|
688
|
+
<div class="tags">
|
689
|
+
<p class="tag_title">Parameters:</p>
|
690
|
+
<ul class="param">
|
691
|
+
|
692
|
+
<li>
|
693
|
+
|
694
|
+
<span class='name'>cred</span>
|
695
|
+
|
696
|
+
|
697
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
|
698
|
+
|
699
|
+
|
700
|
+
|
701
|
+
—
|
702
|
+
<div class='inline'>
|
703
|
+
<p>a credential hash. Values include <tt>:user</tt>, <tt>:password</tt>, and
|
704
|
+
<tt>:connection_types</tt>. <tt>:user</tt> is mandatory, and
|
705
|
+
<tt>:connection_types</tt> should be an Array.</p>
|
706
|
+
</div>
|
707
|
+
|
708
|
+
</li>
|
709
|
+
|
710
|
+
</ul>
|
711
|
+
|
712
|
+
<p class="tag_title">Raises:</p>
|
713
|
+
<ul class="raise">
|
714
|
+
|
715
|
+
<li>
|
716
|
+
|
717
|
+
|
718
|
+
<span class='type'></span>
|
719
|
+
|
720
|
+
|
721
|
+
|
722
|
+
|
723
|
+
<div class='inline'>
|
724
|
+
<p>ArgumentError when invalid credentials or connection_types are supplied</p>
|
725
|
+
</div>
|
726
|
+
|
727
|
+
</li>
|
728
|
+
|
729
|
+
</ul>
|
730
|
+
|
731
|
+
</div><table class="source_code">
|
732
|
+
<tr>
|
733
|
+
<td>
|
734
|
+
<pre class="lines">
|
735
|
+
|
736
|
+
|
737
|
+
72
|
738
|
+
73
|
739
|
+
74
|
740
|
+
75
|
741
|
+
76
|
742
|
+
77
|
743
|
+
78
|
744
|
+
79
|
745
|
+
80
|
746
|
+
81
|
747
|
+
82
|
748
|
+
83
|
749
|
+
84</pre>
|
750
|
+
</td>
|
751
|
+
<td>
|
752
|
+
<pre class="code"><span class="info file"># File 'lib/boris/options.rb', line 72</span>
|
753
|
+
|
754
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add_credential'>add_credential</span><span class='lparen'>(</span><span class='id identifier rubyid_cred'>cred</span><span class='rparen'>)</span>
|
755
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>invalid credential supplied (must be Hash)</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_cred'>cred</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span>
|
756
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>username required</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_cred'>cred</span><span class='lbracket'>[</span><span class='symbol'>:user</span><span class='rbracket'>]</span>
|
757
|
+
|
758
|
+
<span class='id identifier rubyid_cred'>cred</span><span class='lbracket'>[</span><span class='symbol'>:connection_types</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='const'>VALID_CONNECTION_TYPES</span>
|
759
|
+
|
760
|
+
<span class='id identifier rubyid_invalid_options'>invalid_options</span> <span class='op'>=</span> <span class='id identifier rubyid_cred'>cred</span><span class='lbracket'>[</span><span class='symbol'>:connection_types</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='const'>VALID_CONNECTION_TYPES</span>
|
761
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_invalid_options'>invalid_options</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
762
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>invalid connection method specified (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_invalid_options'>invalid_options</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>, </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
763
|
+
<span class='kw'>end</span>
|
764
|
+
|
765
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:credentials</span><span class='rbracket'>]</span> <span class='op'><<</span> <span class='id identifier rubyid_cred'>cred</span> <span class='kw'>unless</span> <span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:credentials</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_cred'>cred</span><span class='rparen'>)</span>
|
766
|
+
<span class='kw'>end</span></pre>
|
767
|
+
</td>
|
768
|
+
</tr>
|
769
|
+
</table>
|
770
|
+
</div>
|
771
|
+
|
772
|
+
</div>
|
773
|
+
|
774
|
+
</div>
|
775
|
+
|
776
|
+
<div id="footer">
|
777
|
+
Generated on Sun Feb 3 16:32:42 2013 by
|
778
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
779
|
+
0.8.3 (ruby-1.9.3).
|
780
|
+
</div>
|
781
|
+
|
782
|
+
</body>
|
783
|
+
</html>
|