430 lines
15 KiB
HTML
430 lines
15 KiB
HTML
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<meta charset="utf-8">
|
||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
|
<title>
|
||
|
|
Module: Msf::Simple::Framework::ModulePaths
|
||
|
|
|
||
|
|
— Documentation by YARD 0.9.37
|
||
|
|
|
||
|
|
</title>
|
||
|
|
|
||
|
|
<link rel="stylesheet" href="../../../css/style.css" type="text/css" />
|
||
|
|
|
||
|
|
<link rel="stylesheet" href="../../../css/common.css" type="text/css" />
|
||
|
|
|
||
|
|
<script type="text/javascript">
|
||
|
|
pathId = "Msf::Simple::Framework::ModulePaths";
|
||
|
|
relpath = '../../../';
|
||
|
|
</script>
|
||
|
|
|
||
|
|
|
||
|
|
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||
|
|
|
||
|
|
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||
|
|
|
||
|
|
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div class="nav_wrap">
|
||
|
|
<iframe id="nav" src="../../../class_list.html?1"></iframe>
|
||
|
|
<div id="resizer"></div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div id="main" tabindex="-1">
|
||
|
|
<div id="header">
|
||
|
|
<div id="menu">
|
||
|
|
|
||
|
|
<a href="../../../_index.html">Index (M)</a> »
|
||
|
|
<span class='title'><span class='object_link'><a href="../../../Msf.html" title="Msf (module)">Msf</a></span></span> » <span class='title'><span class='object_link'><a href="../../Simple.html" title="Msf::Simple (module)">Simple</a></span></span> » <span class='title'><span class='object_link'><a href="../Framework.html" title="Msf::Simple::Framework (module)">Framework</a></span></span>
|
||
|
|
»
|
||
|
|
<span class="title">ModulePaths</span>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div id="search">
|
||
|
|
|
||
|
|
<a class="full_list_link" id="class_list_link"
|
||
|
|
href="../../../class_list.html">
|
||
|
|
|
||
|
|
<svg width="24" height="24">
|
||
|
|
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
||
|
|
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
||
|
|
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
||
|
|
</svg>
|
||
|
|
</a>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
<div class="clear"></div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div id="content"><h1>Module: Msf::Simple::Framework::ModulePaths
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h1>
|
||
|
|
<div class="box_info">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<dl>
|
||
|
|
<dt>Included in:</dt>
|
||
|
|
<dd><span class='object_link'><a href="../Framework.html" title="Msf::Simple::Framework (module)">Msf::Simple::Framework</a></span></dd>
|
||
|
|
</dl>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<dl>
|
||
|
|
<dt>Defined in:</dt>
|
||
|
|
<dd>lib/msf/base/simple/framework/module_paths.rb</dd>
|
||
|
|
</dl>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
||
|
|
<ul class="summary">
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#configured_module_paths-instance_method" title="#configured_module_paths (instance method)">#<strong>configured_module_paths</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns the value of attribute configured_module_paths.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#module_paths_inited-instance_method" title="#module_paths_inited (instance method)">#<strong>module_paths_inited</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns the value of attribute module_paths_inited.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<h2>
|
||
|
|
Instance Method Summary
|
||
|
|
<small><a href="#" class="summary_toggle">collapse</a></small>
|
||
|
|
</h2>
|
||
|
|
|
||
|
|
<ul class="summary">
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#init_module_paths-instance_method" title="#init_module_paths (instance method)">#<strong>init_module_paths</strong>(opts = {}) ⇒ void </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Initialize the module paths.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<div id="instance_attr_details" class="attr_details">
|
||
|
|
<h2>Instance Attribute Details</h2>
|
||
|
|
|
||
|
|
|
||
|
|
<span id="configured_module_paths=-instance_method"></span>
|
||
|
|
<div class="method_details first">
|
||
|
|
<h3 class="signature first" id="configured_module_paths-instance_method">
|
||
|
|
|
||
|
|
#<strong>configured_module_paths</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns the value of attribute configured_module_paths.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
8
|
||
|
|
9
|
||
|
|
10</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/base/simple/framework/module_paths.rb', line 8</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_configured_module_paths'>configured_module_paths</span>
|
||
|
|
<span class='ivar'>@configured_module_paths</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
<span id="module_paths_inited=-instance_method"></span>
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="module_paths_inited-instance_method">
|
||
|
|
|
||
|
|
#<strong>module_paths_inited</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns the value of attribute module_paths_inited.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
9
|
||
|
|
10
|
||
|
|
11</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/base/simple/framework/module_paths.rb', line 9</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_module_paths_inited'>module_paths_inited</span>
|
||
|
|
<span class='ivar'>@module_paths_inited</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
<div id="instance_method_details" class="method_details_list">
|
||
|
|
<h2>Instance Method Details</h2>
|
||
|
|
|
||
|
|
|
||
|
|
<div class="method_details first">
|
||
|
|
<h3 class="signature first" id="init_module_paths-instance_method">
|
||
|
|
|
||
|
|
#<strong>init_module_paths</strong>(opts = {}) ⇒ <tt>void</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
||
|
|
<p>Initialize the module paths</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
14
|
||
|
|
15
|
||
|
|
16
|
||
|
|
17
|
||
|
|
18
|
||
|
|
19
|
||
|
|
20
|
||
|
|
21
|
||
|
|
22
|
||
|
|
23
|
||
|
|
24
|
||
|
|
25
|
||
|
|
26
|
||
|
|
27
|
||
|
|
28
|
||
|
|
29
|
||
|
|
30
|
||
|
|
31
|
||
|
|
32
|
||
|
|
33
|
||
|
|
34
|
||
|
|
35
|
||
|
|
36
|
||
|
|
37
|
||
|
|
38
|
||
|
|
39
|
||
|
|
40
|
||
|
|
41
|
||
|
|
42
|
||
|
|
43
|
||
|
|
44
|
||
|
|
45
|
||
|
|
46
|
||
|
|
47
|
||
|
|
48
|
||
|
|
49
|
||
|
|
50
|
||
|
|
51
|
||
|
|
52
|
||
|
|
53
|
||
|
|
54
|
||
|
|
55
|
||
|
|
56
|
||
|
|
57
|
||
|
|
58
|
||
|
|
59
|
||
|
|
60</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/base/simple/framework/module_paths.rb', line 14</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_init_module_paths'>init_module_paths</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>if</span> <span class='ivar'>@module_paths_inited</span>
|
||
|
|
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Module paths already initialized. To add more module paths call `modules.add_module_path`</span><span class='tstring_end'>'</span></span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
|
||
|
|
<span class='ivar'>@configured_module_paths</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
||
|
|
<span class='id identifier rubyid_extract_engine_module_paths'>extract_engine_module_paths</span><span class='lparen'>(</span><span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_application'>application</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span>
|
||
|
|
<span class='ivar'>@configured_module_paths</span> <span class='op'><<</span> <span class='id identifier rubyid_path'>path</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
|
||
|
|
<span class='kw'>if</span> <span class='const'><span class='object_link'><a href="../../../Msf.html" title="Msf (module)">Msf</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Config.html" title="Msf::Config (class)">Config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_user_module_directory'><span class='object_link'><a href="../../Config.html#user_module_directory-class_method" title="Msf::Config.user_module_directory (method)">user_module_directory</a></span></span>
|
||
|
|
<span class='ivar'>@configured_module_paths</span> <span class='op'><<</span> <span class='const'><span class='object_link'><a href="../../../Msf.html" title="Msf (module)">Msf</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Config.html" title="Msf::Config (class)">Config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_user_module_directory'><span class='object_link'><a href="../../Config.html#user_module_directory-class_method" title="Msf::Config.user_module_directory (method)">user_module_directory</a></span></span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
|
||
|
|
<span class='op'>::</span><span class='const'>Rails</span><span class='op'>::</span><span class='const'>Engine</span><span class='period'>.</span><span class='id identifier rubyid_subclasses'>subclasses</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:instance</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_engine'>engine</span><span class='op'>|</span>
|
||
|
|
<span class='id identifier rubyid_extract_engine_module_paths'>extract_engine_module_paths</span><span class='lparen'>(</span><span class='id identifier rubyid_engine'>engine</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span>
|
||
|
|
<span class='ivar'>@configured_module_paths</span> <span class='op'><<</span> <span class='id identifier rubyid_path'>path</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
|
||
|
|
<span class='comment'># If additional module paths have been defined globally, then load them.
|
||
|
|
</span> <span class='comment'># They should be separated by semi-colons.
|
||
|
|
</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_datastore'>datastore</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>MsfModulePaths</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</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='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span>
|
||
|
|
<span class='ivar'>@configured_module_paths</span> <span class='op'><<</span> <span class='id identifier rubyid_path'>path</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
|
||
|
|
<span class='comment'># If the caller had additional paths to search, load them.
|
||
|
|
</span> <span class='comment'># They should be separated by semi-colons.
|
||
|
|
</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:module_paths</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</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='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span>
|
||
|
|
<span class='ivar'>@configured_module_paths</span> <span class='op'><<</span> <span class='id identifier rubyid_path'>path</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
|
||
|
|
<span class='comment'># Remove any duplicate paths
|
||
|
|
</span> <span class='ivar'>@configured_module_paths</span><span class='period'>.</span><span class='id identifier rubyid_uniq!'>uniq!</span>
|
||
|
|
<span class='comment'># return early if we're deferring module loading
|
||
|
|
</span> <span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:defer_module_loads</span><span class='rparen'>)</span>
|
||
|
|
|
||
|
|
<span class='comment'># Update the module cache from the database
|
||
|
|
</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_modules'>modules</span><span class='period'>.</span><span class='id identifier rubyid_refresh_cache_from_database'>refresh_cache_from_database</span><span class='lparen'>(</span><span class='ivar'>@configured_module_paths</span><span class='rparen'>)</span>
|
||
|
|
|
||
|
|
<span class='comment'># Load each of the module paths
|
||
|
|
</span> <span class='ivar'>@configured_module_paths</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span>
|
||
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_modules'>modules</span><span class='period'>.</span><span class='id identifier rubyid_add_module_path'>add_module_path</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='comma'>,</span> <span class='label'>recalculate:</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
|
||
|
|
<span class='ivar'>@module_paths_inited</span> <span class='op'>=</span> <span class='kw'>true</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div id="footer">
|
||
|
|
Generated on Fri May 8 17:02:12 2026 by
|
||
|
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||
|
|
0.9.37 (ruby-3.1.5).
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
</html>
|