1442 lines
77 KiB
HTML
1442 lines
77 KiB
HTML
|
|
<!DOCTYPE html>
|
|||
|
|
<html>
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8">
|
|||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|||
|
|
<title>
|
|||
|
|
Module: Msf::DBManager::ModuleCache
|
|||
|
|
|
|||
|
|
— 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::DBManager::ModuleCache";
|
|||
|
|
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="../DBManager.html" title="Msf::DBManager (class)">DBManager</a></span></span>
|
|||
|
|
»
|
|||
|
|
<span class="title">ModuleCache</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::DBManager::ModuleCache
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h1>
|
|||
|
|
<div class="box_info">
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<dl>
|
|||
|
|
<dt>Included in:</dt>
|
|||
|
|
<dd><span class='object_link'><a href="../DBManager.html" title="Msf::DBManager (class)">Msf::DBManager</a></span></dd>
|
|||
|
|
</dl>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<dl>
|
|||
|
|
<dt>Defined in:</dt>
|
|||
|
|
<dd>lib/msf/core/db_manager/module_cache.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="#modules_cached-instance_method" title="#modules_cached (instance method)">#<strong>modules_cached</strong> ⇒ Object </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Flag to indicate that modules are cached.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#modules_caching-instance_method" title="#modules_caching (instance method)">#<strong>modules_caching</strong> ⇒ Object </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Flag to indicate that the module cacher is running.</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="#match_values-instance_method" title="#match_values (instance method)">#<strong>match_values</strong>(values) ⇒ Array<String> </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Wraps values in <tt>‘%’</tt> for Arel::Prediciation#matches_any and other match* methods that map to SQL <tt>‘LIKE’</tt> or <tt>‘ILIKE’</tt>.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#module_to_details_hash-instance_method" title="#module_to_details_hash (instance method)">#<strong>module_to_details_hash</strong>(m, with_mixins: true) ⇒ Object </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'></div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#purge_all_module_details-instance_method" title="#purge_all_module_details (instance method)">#<strong>purge_all_module_details</strong> ⇒ void </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Destroys all Mdm::Module::Details in the database.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#remove_module_details-instance_method" title="#remove_module_details (instance method)">#<strong>remove_module_details</strong>(mtype, refname) ⇒ void </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Destroys Mdm::Module::Detail if one exists for the given Mdm::Module::Detail#mtype and Mdm::Module::Detail#refname.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#search_modules-instance_method" title="#search_modules (instance method)">#<strong>search_modules</strong>(search_string) ⇒ [], ActiveRecord::Relation </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>This provides a standard set of search filters for every module.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#update_all_module_details-instance_method" title="#update_all_module_details (instance method)">#<strong>update_all_module_details</strong> ⇒ void </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Destroys the old Mdm::Module::Detail and creates a new Mdm::Module::Detail for any module with an Mdm::Module::Detail where the modification time of the Mdm::Module::Detail#file differs from the Mdm::Module::Detail#mtime.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#update_module_details-instance_method" title="#update_module_details (instance method)">#<strong>update_module_details</strong>(module_instance) ⇒ void </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Creates an Mdm::Module::Detail from a module instance.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div id="instance_attr_details" class="attr_details">
|
|||
|
|
<h2>Instance Attribute Details</h2>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span id="modules_cached=-instance_method"></span>
|
|||
|
|
<div class="method_details first">
|
|||
|
|
<h3 class="signature first" id="modules_cached-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>modules_cached</strong> ⇒ <tt>Object</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Flag to indicate that modules are cached</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
13
|
|||
|
|
14
|
|||
|
|
15</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/db_manager/module_cache.rb', line 13</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_modules_cached'>modules_cached</span>
|
|||
|
|
<span class='ivar'>@modules_cached</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span id="modules_caching=-instance_method"></span>
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="modules_caching-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>modules_caching</strong> ⇒ <tt>Object</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Flag to indicate that the module cacher is running</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
16
|
|||
|
|
17
|
|||
|
|
18</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/db_manager/module_cache.rb', line 16</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_modules_caching'>modules_caching</span>
|
|||
|
|
<span class='ivar'>@modules_caching</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="match_values-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>match_values</strong>(values) ⇒ <tt>Array<String></tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Wraps values in <tt>‘%’</tt> for Arel::Prediciation#matches_any and other match* methods that map to SQL <tt>‘LIKE’</tt> or <tt>‘ILIKE’</tt></p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
<p class="tag_title">Parameters:</p>
|
|||
|
|
<ul class="param">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
<span class='name'>values</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>Set<String></tt>, <tt>#each</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>a list of strings.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
<p class="tag_title">Returns:</p>
|
|||
|
|
<ul class="return">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>Array<String></tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>strings wrapped like %<string>%</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
27
|
|||
|
|
28
|
|||
|
|
29</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/db_manager/module_cache.rb', line 27</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_match_values'>match_values</span><span class='lparen'>(</span><span class='id identifier rubyid_values'>values</span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'>%</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="module_to_details_hash-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>module_to_details_hash</strong>(m, with_mixins: true) ⇒ <tt>Object</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
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
|
|||
|
|
61
|
|||
|
|
62
|
|||
|
|
63
|
|||
|
|
64
|
|||
|
|
65
|
|||
|
|
66
|
|||
|
|
67
|
|||
|
|
68
|
|||
|
|
69
|
|||
|
|
70
|
|||
|
|
71
|
|||
|
|
72
|
|||
|
|
73
|
|||
|
|
74
|
|||
|
|
75
|
|||
|
|
76
|
|||
|
|
77
|
|||
|
|
78
|
|||
|
|
79
|
|||
|
|
80
|
|||
|
|
81
|
|||
|
|
82
|
|||
|
|
83
|
|||
|
|
84
|
|||
|
|
85
|
|||
|
|
86
|
|||
|
|
87
|
|||
|
|
88
|
|||
|
|
89
|
|||
|
|
90
|
|||
|
|
91
|
|||
|
|
92
|
|||
|
|
93
|
|||
|
|
94
|
|||
|
|
95
|
|||
|
|
96
|
|||
|
|
97
|
|||
|
|
98
|
|||
|
|
99
|
|||
|
|
100
|
|||
|
|
101
|
|||
|
|
102
|
|||
|
|
103
|
|||
|
|
104
|
|||
|
|
105
|
|||
|
|
106
|
|||
|
|
107
|
|||
|
|
108
|
|||
|
|
109
|
|||
|
|
110
|
|||
|
|
111
|
|||
|
|
112
|
|||
|
|
113
|
|||
|
|
114
|
|||
|
|
115
|
|||
|
|
116
|
|||
|
|
117
|
|||
|
|
118</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/db_manager/module_cache.rb', line 31</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_module_to_details_hash'>module_to_details_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_m'>m</span><span class='comma'>,</span> <span class='label'>with_mixins:</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|||
|
|
<span class='id identifier rubyid_bits'>bits</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:mtime</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_mtime'>mtime</span><span class='lparen'>(</span><span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_file_path'>file_path</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:file</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_file_path'>file_path</span>
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:mtype</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span>
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:refname</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_refname'>refname</span>
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:fullname</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_fullname'>fullname</span>
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:rank</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_rank'>rank</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:license</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_license'>license</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:description</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_description'>description</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_arch'>arch</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_bits'>bits</span> <span class='op'><<</span> <span class='lbracket'>[</span> <span class='symbol'>:arch</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:name</span> <span class='op'>=></span> <span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='rbrace'>}</span> <span class='rbracket'>]</span>
|
|||
|
|
<span class='rbrace'>}</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_platform'>platform</span><span class='period'>.</span><span class='id identifier rubyid_platforms'>platforms</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_bits'>bits</span> <span class='op'><<</span> <span class='lbracket'>[</span> <span class='symbol'>:platform</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:name</span> <span class='op'>=></span> <span class='id identifier rubyid_x'>x</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_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='rbrace'>}</span> <span class='rbracket'>]</span>
|
|||
|
|
<span class='rbrace'>}</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_author'>author</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_bits'>bits</span> <span class='op'><<</span> <span class='lbracket'>[</span> <span class='symbol'>:author</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:name</span> <span class='op'>=></span> <span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='rbrace'>}</span> <span class='rbracket'>]</span>
|
|||
|
|
<span class='rbrace'>}</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_references'>references</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_bits'>bits</span> <span class='op'><<</span> <span class='lbracket'>[</span> <span class='symbol'>:ref</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:name</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_ctx_id'>ctx_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_ctx_val'>ctx_val</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_join'><span class='object_link'><a href="../../top-level-namespace.html#join-instance_method" title="#join (method)">join</a></span></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='rbracket'>]</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:privileged</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_privileged?'>privileged?</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_disclosure_date'>disclosure_date</span>
|
|||
|
|
<span class='kw'>begin</span>
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:disclosure_date</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_disclosure_date'>disclosure_date</span><span class='period'>.</span><span class='id identifier rubyid_to_datetime'>to_datetime</span><span class='period'>.</span><span class='id identifier rubyid_to_time'>to_time</span>
|
|||
|
|
<span class='kw'>rescue</span> <span class='op'>::</span><span class='const'>Exception</span>
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:disclosure_date</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>exploit</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_targets'>targets</span><span class='period'>.</span><span class='id identifier rubyid_each_index'>each_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_bits'>bits</span> <span class='op'><<</span> <span class='lbracket'>[</span> <span class='symbol'>:target</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:index</span> <span class='op'>=></span> <span class='id identifier rubyid_i'>i</span><span class='comma'>,</span> <span class='symbol'>:name</span> <span class='op'>=></span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_targets'>targets</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='rbrace'>}</span> <span class='rbracket'>]</span>
|
|||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_targets'>targets</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_platform'>platform</span>
|
|||
|
|
<span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_targets'>targets</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_platform'>platform</span><span class='period'>.</span><span class='id identifier rubyid_platforms'>platforms</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_name'>name</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_bits'>bits</span> <span class='op'><<</span> <span class='lbracket'>[</span> <span class='symbol'>:platform</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:name</span> <span class='op'>=></span> <span class='id identifier rubyid_name'>name</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_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='rbrace'>}</span> <span class='rbracket'>]</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_targets'>targets</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_arch'>arch</span>
|
|||
|
|
<span class='id identifier rubyid_bits'>bits</span> <span class='op'><<</span> <span class='lbracket'>[</span> <span class='symbol'>:arch</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:name</span> <span class='op'>=></span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_targets'>targets</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_arch'>arch</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='rbrace'>}</span> <span class='rbracket'>]</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_default_target'>default_target</span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:default_target</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_default_target'>default_target</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='comment'># Some modules are a combination, which means they are actually aggressive
|
|||
|
|
</span> <span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:stance</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_stance'>stance</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>aggressive</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>aggressive</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>passive</span><span class='tstring_end'>"</span></span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_with_mixins'>with_mixins</span>
|
|||
|
|
<span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_mixins'>mixins</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_x'>x</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_bits'>bits</span> <span class='op'><<</span> <span class='lbracket'>[</span> <span class='symbol'>:mixin</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:name</span> <span class='op'>=></span> <span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='rbrace'>}</span> <span class='rbracket'>]</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>auxiliary</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_actions'>actions</span><span class='period'>.</span><span class='id identifier rubyid_each_index'>each_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_bits'>bits</span> <span class='op'><<</span> <span class='lbracket'>[</span> <span class='symbol'>:action</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:name</span> <span class='op'>=></span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_actions'>actions</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='rbrace'>}</span> <span class='rbracket'>]</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_default_action'>default_action</span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:default_action</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_default_action'>default_action</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:stance</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_passive?'>passive?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>passive</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>aggressive</span><span class='tstring_end'>"</span></span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='symbol'>:bits</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_bits'>bits</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_res'>res</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="purge_all_module_details-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>purge_all_module_details</strong> ⇒ <tt>void</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<div class="note notetag">
|
|||
|
|
<strong>Note:</strong>
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>Does nothing unless <span class='object_link'><a href="Migration.html#migrated-instance_method" title="Msf::DBManager::Migration#migrated (method)">Msf::DBManager::Migration#migrated</a></span> is <code>true</code> and <span class='object_link'><a href="#modules_caching-instance_method" title="Msf::DBManager::ModuleCache#modules_caching (method)">#modules_caching</a></span> is <code>false</code>.</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
|||
|
|
<p>Destroys all Mdm::Module::Details in the database.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
126
|
|||
|
|
127
|
|||
|
|
128
|
|||
|
|
129
|
|||
|
|
130
|
|||
|
|
131
|
|||
|
|
132
|
|||
|
|
133</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/db_manager/module_cache.rb', line 126</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_purge_all_module_details'>purge_all_module_details</span>
|
|||
|
|
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_migrated'>migrated</span>
|
|||
|
|
<span class='kw'>return</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_modules_caching'>modules_caching</span>
|
|||
|
|
|
|||
|
|
<span class='op'>::</span><span class='const'><span class='object_link'><a href="../../ApplicationRecord.html" title="ApplicationRecord (class)">ApplicationRecord</a></span></span><span class='period'>.</span><span class='id identifier rubyid_connection_pool'>connection_pool</span><span class='period'>.</span><span class='id identifier rubyid_with_connection'>with_connection</span> <span class='kw'>do</span>
|
|||
|
|
<span class='const'>Mdm</span><span class='op'>::</span><span class='const'>Module</span><span class='op'>::</span><span class='const'>Detail</span><span class='period'>.</span><span class='id identifier rubyid_destroy_all'>destroy_all</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="remove_module_details-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>remove_module_details</strong>(mtype, refname) ⇒ <tt>void</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
|||
|
|
<p>Destroys Mdm::Module::Detail if one exists for the given Mdm::Module::Detail#mtype and Mdm::Module::Detail#refname.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
<p class="tag_title">Parameters:</p>
|
|||
|
|
<ul class="param">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
<span class='name'>mtype</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>module type.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
<span class='name'>refname</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>module reference name.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
141
|
|||
|
|
142
|
|||
|
|
143
|
|||
|
|
144
|
|||
|
|
145
|
|||
|
|
146
|
|||
|
|
147</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/db_manager/module_cache.rb', line 141</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_remove_module_details'>remove_module_details</span><span class='lparen'>(</span><span class='id identifier rubyid_mtype'>mtype</span><span class='comma'>,</span> <span class='id identifier rubyid_refname'>refname</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>return</span> <span class='kw'>if</span> <span class='kw'>not</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_migrated'>migrated</span>
|
|||
|
|
|
|||
|
|
<span class='const'><span class='object_link'><a href="../../ApplicationRecord.html" title="ApplicationRecord (class)">ApplicationRecord</a></span></span><span class='period'>.</span><span class='id identifier rubyid_connection_pool'>connection_pool</span><span class='period'>.</span><span class='id identifier rubyid_with_connection'>with_connection</span> <span class='kw'>do</span>
|
|||
|
|
<span class='const'>Mdm</span><span class='op'>::</span><span class='const'>Module</span><span class='op'>::</span><span class='const'>Detail</span><span class='period'>.</span><span class='id identifier rubyid_where'>where</span><span class='lparen'>(</span><span class='symbol'>:mtype</span> <span class='op'>=></span> <span class='id identifier rubyid_mtype'>mtype</span><span class='comma'>,</span> <span class='symbol'>:refname</span> <span class='op'>=></span> <span class='id identifier rubyid_refname'>refname</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_destroy_all'>destroy_all</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="search_modules-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>search_modules</strong>(search_string) ⇒ <tt>[]</tt>, <tt>ActiveRecord::Relation</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>This provides a standard set of search filters for every module.</p>
|
|||
|
|
|
|||
|
|
<p>Supported keywords with the format <keyword>:<search_value>:</p>
|
|||
|
|
<dl class="rdoc-list note-list"><dt><code>author</code></dt>
|
|||
|
|
<dd>
|
|||
|
|
<p>Matches modules with the given author email or name.</p>
|
|||
|
|
</dd><dt><code>bid</code></dt>
|
|||
|
|
<dd>
|
|||
|
|
<p>Matches modules with the given Bugtraq ID.</p>
|
|||
|
|
</dd><dt><code>cve</code></dt>
|
|||
|
|
<dd>
|
|||
|
|
<p>Matches modules with the given CVE ID.</p>
|
|||
|
|
</dd><dt><code>edb</code></dt>
|
|||
|
|
<dd>
|
|||
|
|
<p>Matches modules with the given Exploit-DB ID.</p>
|
|||
|
|
</dd><dt><code>name</code></dt>
|
|||
|
|
<dd>
|
|||
|
|
<p>Matches modules with the given full name or name.</p>
|
|||
|
|
</dd><dt><code>os</code>, <code>platform</code></dt>
|
|||
|
|
<dd>
|
|||
|
|
<p>Matches modules with the given platform or target name.</p>
|
|||
|
|
</dd><dt><code>ref</code></dt>
|
|||
|
|
<dd>
|
|||
|
|
<p>Matches modules with the given reference ID.</p>
|
|||
|
|
</dd><dt><code>type</code></dt>
|
|||
|
|
<dd>
|
|||
|
|
<p>Matches modules with the given type.</p>
|
|||
|
|
</dd></dl>
|
|||
|
|
|
|||
|
|
<p>Any text not associated with a keyword is matched against the description, the full name, and the name of the module; the name of the module actions; the name of the module archs; the name of the module authors; the name of module platform; the module refs; or the module target.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
<p class="tag_title">Parameters:</p>
|
|||
|
|
<ul class="param">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
<span class='name'>search_string</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>a string of space separated keyword pairs or free form text.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
<p class="tag_title">Returns:</p>
|
|||
|
|
<ul class="return">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>[]</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>if search_string is <code>nil</code></p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>ActiveRecord::Relation</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>module details that matched <code>search_string</code></p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
171
|
|||
|
|
172
|
|||
|
|
173
|
|||
|
|
174
|
|||
|
|
175
|
|||
|
|
176
|
|||
|
|
177
|
|||
|
|
178
|
|||
|
|
179
|
|||
|
|
180
|
|||
|
|
181
|
|||
|
|
182
|
|||
|
|
183
|
|||
|
|
184
|
|||
|
|
185
|
|||
|
|
186
|
|||
|
|
187
|
|||
|
|
188
|
|||
|
|
189
|
|||
|
|
190
|
|||
|
|
191
|
|||
|
|
192
|
|||
|
|
193
|
|||
|
|
194
|
|||
|
|
195
|
|||
|
|
196
|
|||
|
|
197
|
|||
|
|
198
|
|||
|
|
199
|
|||
|
|
200
|
|||
|
|
201
|
|||
|
|
202
|
|||
|
|
203
|
|||
|
|
204
|
|||
|
|
205
|
|||
|
|
206
|
|||
|
|
207
|
|||
|
|
208
|
|||
|
|
209
|
|||
|
|
210
|
|||
|
|
211
|
|||
|
|
212
|
|||
|
|
213
|
|||
|
|
214
|
|||
|
|
215
|
|||
|
|
216
|
|||
|
|
217
|
|||
|
|
218
|
|||
|
|
219
|
|||
|
|
220
|
|||
|
|
221
|
|||
|
|
222
|
|||
|
|
223
|
|||
|
|
224
|
|||
|
|
225
|
|||
|
|
226
|
|||
|
|
227
|
|||
|
|
228
|
|||
|
|
229
|
|||
|
|
230
|
|||
|
|
231
|
|||
|
|
232
|
|||
|
|
233
|
|||
|
|
234
|
|||
|
|
235
|
|||
|
|
236
|
|||
|
|
237
|
|||
|
|
238
|
|||
|
|
239
|
|||
|
|
240
|
|||
|
|
241
|
|||
|
|
242
|
|||
|
|
243
|
|||
|
|
244
|
|||
|
|
245
|
|||
|
|
246
|
|||
|
|
247
|
|||
|
|
248</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/db_manager/module_cache.rb', line 171</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_search_modules'>search_modules</span><span class='lparen'>(</span><span class='id identifier rubyid_search_string'>search_string</span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_search_string'>search_string</span> <span class='op'>||=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
|||
|
|
<span class='id identifier rubyid_search_string'>search_string</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span>
|
|||
|
|
|
|||
|
|
<span class='comment'># Split search terms by space, but allow quoted strings
|
|||
|
|
</span> <span class='id identifier rubyid_terms'>terms</span> <span class='op'>=</span> <span class='const'>Shellwords</span><span class='period'>.</span><span class='id identifier rubyid_shellwords'>shellwords</span><span class='lparen'>(</span><span class='id identifier rubyid_search_string'>search_string</span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_terms'>terms</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='comment'># All terms are either included or excluded
|
|||
|
|
</span> <span class='id identifier rubyid_value_set_by_keyword'>value_set_by_keyword</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='id identifier rubyid_keyword'>keyword</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_keyword'>keyword</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|||
|
|
<span class='rbrace'>}</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_terms'>terms</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_term'>term</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_keyword'>keyword</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_term'>term</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='comma'>,</span> <span class='int'>2</span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span>
|
|||
|
|
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_keyword'>keyword</span>
|
|||
|
|
<span class='id identifier rubyid_keyword'>keyword</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>text</span><span class='tstring_end'>'</span></span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
|||
|
|
<span class='id identifier rubyid_keyword'>keyword</span><span class='period'>.</span><span class='id identifier rubyid_downcase!'>downcase!</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_value_set'>value_set</span> <span class='op'>=</span> <span class='id identifier rubyid_value_set_by_keyword'>value_set_by_keyword</span><span class='lbracket'>[</span><span class='id identifier rubyid_keyword'>keyword</span><span class='rbracket'>]</span>
|
|||
|
|
<span class='id identifier rubyid_value_set'>value_set</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='id identifier rubyid_value'>value</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='const'><span class='object_link'><a href="../../ApplicationRecord.html" title="ApplicationRecord (class)">ApplicationRecord</a></span></span><span class='period'>.</span><span class='id identifier rubyid_connection_pool'>connection_pool</span><span class='period'>.</span><span class='id identifier rubyid_with_connection'>with_connection</span> <span class='kw'>do</span>
|
|||
|
|
<span class='ivar'>@query</span> <span class='op'>=</span> <span class='const'>Mdm</span><span class='op'>::</span><span class='const'>Module</span><span class='op'>::</span><span class='const'>Detail</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span>
|
|||
|
|
|
|||
|
|
<span class='ivar'>@archs</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|||
|
|
<span class='ivar'>@authors</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|||
|
|
<span class='ivar'>@names</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|||
|
|
<span class='ivar'>@os</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|||
|
|
<span class='ivar'>@refs</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|||
|
|
<span class='ivar'>@text</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|||
|
|
<span class='ivar'>@types</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_value_set_by_keyword'>value_set_by_keyword</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_keyword'>keyword</span><span class='comma'>,</span> <span class='id identifier rubyid_value_set'>value_set</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_formatted_values'>formatted_values</span> <span class='op'>=</span> <span class='id identifier rubyid_match_values'>match_values</span><span class='lparen'>(</span><span class='id identifier rubyid_value_set'>value_set</span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>case</span> <span class='id identifier rubyid_keyword'>keyword</span>
|
|||
|
|
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>arch</span><span class='tstring_end'>'</span></span>
|
|||
|
|
<span class='ivar'>@archs</span> <span class='op'><<</span> <span class='id identifier rubyid_formatted_values'>formatted_values</span>
|
|||
|
|
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>author</span><span class='tstring_end'>'</span></span>
|
|||
|
|
<span class='ivar'>@authors</span> <span class='op'><<</span> <span class='id identifier rubyid_formatted_values'>formatted_values</span>
|
|||
|
|
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>name</span><span class='tstring_end'>'</span></span>
|
|||
|
|
<span class='ivar'>@names</span> <span class='op'><<</span> <span class='id identifier rubyid_formatted_values'>formatted_values</span>
|
|||
|
|
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>os</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>platform</span><span class='tstring_end'>'</span></span>
|
|||
|
|
<span class='ivar'>@os</span> <span class='op'><<</span> <span class='id identifier rubyid_formatted_values'>formatted_values</span>
|
|||
|
|
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ref</span><span class='tstring_end'>'</span></span>
|
|||
|
|
<span class='ivar'>@refs</span> <span class='op'><<</span> <span class='id identifier rubyid_formatted_values'>formatted_values</span>
|
|||
|
|
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>cve</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>bid</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>edb</span><span class='tstring_end'>'</span></span>
|
|||
|
|
<span class='id identifier rubyid_formatted_values'>formatted_values</span> <span class='op'>=</span> <span class='id identifier rubyid_value_set'>value_set</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_prefix'>prefix</span> <span class='op'>=</span> <span class='id identifier rubyid_keyword'>keyword</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span>
|
|||
|
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_prefix'>prefix</span><span class='embexpr_end'>}</span><span class='tstring_content'>-%</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'>%</span><span class='tstring_end'>"</span></span>
|
|||
|
|
<span class='rbrace'>}</span>
|
|||
|
|
<span class='ivar'>@refs</span> <span class='op'><<</span> <span class='id identifier rubyid_formatted_values'>formatted_values</span>
|
|||
|
|
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>text</span><span class='tstring_end'>'</span></span>
|
|||
|
|
<span class='ivar'>@text</span> <span class='op'><<</span> <span class='id identifier rubyid_formatted_values'>formatted_values</span>
|
|||
|
|
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>type</span><span class='tstring_end'>'</span></span>
|
|||
|
|
<span class='ivar'>@types</span> <span class='op'><<</span> <span class='id identifier rubyid_formatted_values'>formatted_values</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='ivar'>@query</span> <span class='op'>=</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_module_arch'>module_arch</span><span class='lparen'>(</span> <span class='ivar'>@archs</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span> <span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@archs</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
|||
|
|
<span class='ivar'>@query</span> <span class='op'>=</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_module_author'>module_author</span><span class='lparen'>(</span> <span class='ivar'>@authors</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span> <span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@authors</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
|||
|
|
<span class='ivar'>@query</span> <span class='op'>=</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_module_name'>module_name</span><span class='lparen'>(</span> <span class='ivar'>@names</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span> <span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@names</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
|||
|
|
<span class='ivar'>@query</span> <span class='op'>=</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_module_os_or_platform'>module_os_or_platform</span><span class='lparen'>(</span> <span class='ivar'>@os</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span> <span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@os</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
|||
|
|
<span class='ivar'>@query</span> <span class='op'>=</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_module_text'>module_text</span><span class='lparen'>(</span> <span class='ivar'>@text</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span> <span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@text</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
|||
|
|
<span class='ivar'>@query</span> <span class='op'>=</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_module_type'>module_type</span><span class='lparen'>(</span> <span class='ivar'>@types</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span> <span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@types</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
|||
|
|
<span class='ivar'>@query</span> <span class='op'>=</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_module_ref'>module_ref</span><span class='lparen'>(</span> <span class='ivar'>@refs</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span> <span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@refs</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
|||
|
|
|
|||
|
|
<span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="update_all_module_details-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>update_all_module_details</strong> ⇒ <tt>void</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
|||
|
|
<p>Destroys the old Mdm::Module::Detail and creates a new Mdm::Module::Detail for any module with an Mdm::Module::Detail where the modification time of the Mdm::Module::Detail#file differs from the Mdm::Module::Detail#mtime. If the Mdm::Module::Detail#file no only exists on disk, then the Mdm::Module::Detail is just destroyed without a new one being created.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
257
|
|||
|
|
258
|
|||
|
|
259
|
|||
|
|
260
|
|||
|
|
261
|
|||
|
|
262
|
|||
|
|
263
|
|||
|
|
264
|
|||
|
|
265
|
|||
|
|
266
|
|||
|
|
267
|
|||
|
|
268
|
|||
|
|
269
|
|||
|
|
270
|
|||
|
|
271
|
|||
|
|
272
|
|||
|
|
273
|
|||
|
|
274
|
|||
|
|
275
|
|||
|
|
276
|
|||
|
|
277
|
|||
|
|
278
|
|||
|
|
279
|
|||
|
|
280
|
|||
|
|
281
|
|||
|
|
282
|
|||
|
|
283
|
|||
|
|
284
|
|||
|
|
285
|
|||
|
|
286
|
|||
|
|
287
|
|||
|
|
288
|
|||
|
|
289
|
|||
|
|
290
|
|||
|
|
291
|
|||
|
|
292
|
|||
|
|
293
|
|||
|
|
294
|
|||
|
|
295
|
|||
|
|
296
|
|||
|
|
297
|
|||
|
|
298
|
|||
|
|
299
|
|||
|
|
300
|
|||
|
|
301
|
|||
|
|
302
|
|||
|
|
303
|
|||
|
|
304
|
|||
|
|
305
|
|||
|
|
306
|
|||
|
|
307
|
|||
|
|
308
|
|||
|
|
309
|
|||
|
|
310
|
|||
|
|
311
|
|||
|
|
312
|
|||
|
|
313
|
|||
|
|
314
|
|||
|
|
315
|
|||
|
|
316
|
|||
|
|
317
|
|||
|
|
318
|
|||
|
|
319
|
|||
|
|
320
|
|||
|
|
321
|
|||
|
|
322
|
|||
|
|
323</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/db_manager/module_cache.rb', line 257</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_update_all_module_details'>update_all_module_details</span>
|
|||
|
|
<span class='kw'>return</span> <span class='kw'>if</span> <span class='kw'>not</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_migrated'>migrated</span>
|
|||
|
|
<span class='kw'>return</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_modules_caching'>modules_caching</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_cache_thread'>cache_thread</span> <span class='op'>=</span> <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_modules_cached'>modules_cached</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|||
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_modules_caching'>modules_caching</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|||
|
|
|
|||
|
|
<span class='const'><span class='object_link'><a href="../../ApplicationRecord.html" title="ApplicationRecord (class)">ApplicationRecord</a></span></span><span class='period'>.</span><span class='id identifier rubyid_connection_pool'>connection_pool</span><span class='period'>.</span><span class='id identifier rubyid_with_connection'>with_connection</span> <span class='kw'>do</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_refresh'>refresh</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|||
|
|
<span class='id identifier rubyid_skip_reference_name_set_by_module_type'>skip_reference_name_set_by_module_type</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='id identifier rubyid_module_type'>module_type</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_module_type'>module_type</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|||
|
|
<span class='rbrace'>}</span>
|
|||
|
|
|
|||
|
|
<span class='const'>Mdm</span><span class='op'>::</span><span class='const'>Module</span><span class='op'>::</span><span class='const'>Detail</span><span class='period'>.</span><span class='id identifier rubyid_find_each'>find_each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_md'>md</span><span class='op'>|</span>
|
|||
|
|
<span class='kw'>unless</span> <span class='id identifier rubyid_md'>md</span><span class='period'>.</span><span class='id identifier rubyid_ready'>ready</span>
|
|||
|
|
<span class='id identifier rubyid_refresh'>refresh</span> <span class='op'><<</span> <span class='id identifier rubyid_md'>md</span>
|
|||
|
|
<span class='kw'>next</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>unless</span> <span class='id identifier rubyid_md'>md</span><span class='period'>.</span><span class='id identifier rubyid_file'>file</span> <span class='kw'>and</span> <span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_md'>md</span><span class='period'>.</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_refresh'>refresh</span> <span class='op'><<</span> <span class='id identifier rubyid_md'>md</span>
|
|||
|
|
<span class='kw'>next</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>if</span> <span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_mtime'>mtime</span><span class='lparen'>(</span><span class='id identifier rubyid_md'>md</span><span class='period'>.</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>!=</span> <span class='id identifier rubyid_md'>md</span><span class='period'>.</span><span class='id identifier rubyid_mtime'>mtime</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
|||
|
|
<span class='id identifier rubyid_refresh'>refresh</span> <span class='op'><<</span> <span class='id identifier rubyid_md'>md</span>
|
|||
|
|
<span class='kw'>next</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_skip_reference_name_set'>skip_reference_name_set</span> <span class='op'>=</span> <span class='id identifier rubyid_skip_reference_name_set_by_module_type'>skip_reference_name_set_by_module_type</span><span class='lbracket'>[</span><span class='id identifier rubyid_md'>md</span><span class='period'>.</span><span class='id identifier rubyid_mtype'>mtype</span><span class='rbracket'>]</span>
|
|||
|
|
<span class='id identifier rubyid_skip_reference_name_set'>skip_reference_name_set</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='id identifier rubyid_md'>md</span><span class='period'>.</span><span class='id identifier rubyid_refname'>refname</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_refresh'>refresh</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_md'>md</span><span class='op'>|</span> <span class='id identifier rubyid_md'>md</span><span class='period'>.</span><span class='id identifier rubyid_destroy'>destroy</span> <span class='rbrace'>}</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_new_modules'>new_modules</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|||
|
|
<span class='lbracket'>[</span>
|
|||
|
|
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>exploit</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_exploits'>exploits</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
|||
|
|
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>auxiliary</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_auxiliary'>auxiliary</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
|||
|
|
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>post</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
|||
|
|
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>payload</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_payloads'>payloads</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
|||
|
|
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>encoder</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_encoders'>encoders</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
|||
|
|
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>nop</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_nops'>nops</span><span class='rbracket'>]</span>
|
|||
|
|
<span class='rbracket'>]</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_mt'>mt</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_skip_reference_name_set'>skip_reference_name_set</span> <span class='op'>=</span> <span class='id identifier rubyid_skip_reference_name_set_by_module_type'>skip_reference_name_set_by_module_type</span><span class='lbracket'>[</span><span class='id identifier rubyid_mt'>mt</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbracket'>]</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_mt'>mt</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</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_mn'>mn</span><span class='op'>|</span>
|
|||
|
|
<span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_skip_reference_name_set'>skip_reference_name_set</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_mn'>mn</span>
|
|||
|
|
<span class='id identifier rubyid_obj'>obj</span> <span class='op'>=</span> <span class='id identifier rubyid_mt'>mt</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_mn'>mn</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>next</span> <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_obj'>obj</span>
|
|||
|
|
<span class='id identifier rubyid_new_modules'>new_modules</span> <span class='op'><<=</span> <span class='id identifier rubyid_obj'>obj</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_insert_all'>insert_all</span><span class='lparen'>(</span><span class='id identifier rubyid_new_modules'>new_modules</span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_cache_initialized'>cache_initialized</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='comment'># in reverse order of section before with_connection block
|
|||
|
|
</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_modules_caching'>modules_caching</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|||
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_modules_cached'>modules_cached</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|||
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_cache_thread'>cache_thread</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="update_module_details-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>update_module_details</strong>(module_instance) ⇒ <tt>void</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
|||
|
|
<p>Creates an Mdm::Module::Detail from a module instance.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
<p class="tag_title">Parameters:</p>
|
|||
|
|
<ul class="param">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
<span class='name'>module_instance</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt><span class='object_link'><a href="../Module.html" title="Msf::Module (class)">Msf::Module</a></span></tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>a metasploit module instance.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
<p class="tag_title">Raises:</p>
|
|||
|
|
<ul class="raise">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>ActiveRecord::RecordInvalid</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>if Hash from <span class='object_link'><a href="#module_to_details_hash-instance_method" title="Msf::DBManager::ModuleCache#module_to_details_hash (method)">#module_to_details_hash</a></span> is invalid attributes for Mdm::Module::Detail.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
331
|
|||
|
|
332
|
|||
|
|
333
|
|||
|
|
334
|
|||
|
|
335
|
|||
|
|
336
|
|||
|
|
337
|
|||
|
|
338
|
|||
|
|
339
|
|||
|
|
340
|
|||
|
|
341
|
|||
|
|
342
|
|||
|
|
343
|
|||
|
|
344
|
|||
|
|
345
|
|||
|
|
346
|
|||
|
|
347
|
|||
|
|
348
|
|||
|
|
349
|
|||
|
|
350
|
|||
|
|
351
|
|||
|
|
352
|
|||
|
|
353
|
|||
|
|
354
|
|||
|
|
355
|
|||
|
|
356
|
|||
|
|
357
|
|||
|
|
358
|
|||
|
|
359
|
|||
|
|
360
|
|||
|
|
361</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/db_manager/module_cache.rb', line 331</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_update_module_details'>update_module_details</span><span class='lparen'>(</span><span class='id identifier rubyid_module_instance'>module_instance</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>return</span> <span class='kw'>if</span> <span class='kw'>not</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_migrated'>migrated</span>
|
|||
|
|
|
|||
|
|
<span class='const'><span class='object_link'><a href="../../ApplicationRecord.html" title="ApplicationRecord (class)">ApplicationRecord</a></span></span><span class='period'>.</span><span class='id identifier rubyid_connection_pool'>connection_pool</span><span class='period'>.</span><span class='id identifier rubyid_with_connection'>with_connection</span> <span class='kw'>do</span>
|
|||
|
|
<span class='id identifier rubyid_info'>info</span> <span class='op'>=</span> <span class='id identifier rubyid_module_to_details_hash'>module_to_details_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_module_instance'>module_instance</span><span class='comma'>,</span> <span class='label'>with_mixins:</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_bits'>bits</span> <span class='op'>=</span> <span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:bits</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|||
|
|
<span class='id identifier rubyid_module_detail'>module_detail</span> <span class='op'>=</span> <span class='const'>Mdm</span><span class='op'>::</span><span class='const'>Module</span><span class='op'>::</span><span class='const'>Detail</span><span class='period'>.</span><span class='id identifier rubyid_create!'>create!</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_bits'>bits</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_args'>args</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_otype'>otype</span><span class='comma'>,</span> <span class='id identifier rubyid_vals'>vals</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>case</span> <span class='id identifier rubyid_otype'>otype</span>
|
|||
|
|
<span class='kw'>when</span> <span class='symbol'>:action</span>
|
|||
|
|
<span class='id identifier rubyid_module_detail'>module_detail</span><span class='period'>.</span><span class='id identifier rubyid_add_action'>add_action</span><span class='lparen'>(</span><span class='id identifier rubyid_vals'>vals</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>when</span> <span class='symbol'>:arch</span>
|
|||
|
|
<span class='id identifier rubyid_module_detail'>module_detail</span><span class='period'>.</span><span class='id identifier rubyid_add_arch'>add_arch</span><span class='lparen'>(</span><span class='id identifier rubyid_vals'>vals</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>when</span> <span class='symbol'>:author</span>
|
|||
|
|
<span class='id identifier rubyid_module_detail'>module_detail</span><span class='period'>.</span><span class='id identifier rubyid_add_author'>add_author</span><span class='lparen'>(</span><span class='id identifier rubyid_vals'>vals</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_vals'>vals</span><span class='lbracket'>[</span><span class='symbol'>:email</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>when</span> <span class='symbol'>:platform</span>
|
|||
|
|
<span class='id identifier rubyid_module_detail'>module_detail</span><span class='period'>.</span><span class='id identifier rubyid_add_platform'>add_platform</span><span class='lparen'>(</span><span class='id identifier rubyid_vals'>vals</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>when</span> <span class='symbol'>:ref</span>
|
|||
|
|
<span class='id identifier rubyid_module_detail'>module_detail</span><span class='period'>.</span><span class='id identifier rubyid_add_ref'>add_ref</span><span class='lparen'>(</span><span class='id identifier rubyid_vals'>vals</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>when</span> <span class='symbol'>:target</span>
|
|||
|
|
<span class='id identifier rubyid_module_detail'>module_detail</span><span class='period'>.</span><span class='id identifier rubyid_add_target'>add_target</span><span class='lparen'>(</span><span class='id identifier rubyid_vals'>vals</span><span class='lbracket'>[</span><span class='symbol'>:index</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_vals'>vals</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_module_detail'>module_detail</span><span class='period'>.</span><span class='id identifier rubyid_ready'>ready</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|||
|
|
<span class='id identifier rubyid_module_detail'>module_detail</span><span class='period'>.</span><span class='id identifier rubyid_save!'>save!</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div id="footer">
|
|||
|
|
Generated on Fri May 8 17:01:47 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>
|