doc/rdocs/Rcmd/DB.html in rcmd-1.6.2 vs doc/rdocs/Rcmd/DB.html in rcmd-1.6.3

- old
+ new

@@ -106,22 +106,12 @@ <p>Backend Databases:</p> <ul><li> <p>sqlite3</p> </li><li> -<p>mysql</p> +<p>mysql2</p> </li><li> -<p>frontbase</p> -</li><li> -<p>firebird</p> -</li><li> -<p>db2</p> -</li><li> -<p>openbase</p> -</li><li> -<p>oracle</p> -</li><li> <p>postgresql</p> </li></ul> <p>This is achieved in the <a href="DB.html#method-c-db_connect">::db_connect</a> method, which matches @@ -175,11 +165,11 @@ <div class="method-source-code" id="create_config-source"> - <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 84</span> + <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 79</span> <span class="ruby-keyword">def</span> <span class="ruby-constant">DB</span>.<span class="ruby-identifier">create_config</span> <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Function: #{@config_dir}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-ivar">@config_dir</span>) <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-ivar">@config_dir</span>) <span class="ruby-keyword">end</span> @@ -220,33 +210,14 @@ <div class="method-source-code" id="db_connect-source"> - <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 162</span> + <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 157</span> <span class="ruby-keyword">def</span> <span class="ruby-constant">DB</span>.<span class="ruby-identifier">db_connect</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">load_config</span> - - <span class="ruby-keyword">case</span> <span class="ruby-ivar">@conf</span>[<span class="ruby-value">:adapter</span>].<span class="ruby-identifier">downcase</span> - <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;sqlite3&quot;</span> - <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;sqlite3&quot;</span> - <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;mysql&quot;</span> - <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;mysql&quot;</span> - <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;frontbase&quot;</span> - <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;ruby-frontbase&quot;</span> - <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;firebird&quot;</span> - <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;fireruby&quot;</span> - <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;db2&quot;</span> - <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;ruby-db2&quot;</span> - <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;openbase&quot;</span> - <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;openbase&quot;</span> - <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;oracle&quot;</span> - <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;ruby-oci8&quot;</span> - <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;postgresql&quot;</span> - <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;ruby-postgres&quot;</span> - <span class="ruby-keyword">end</span> - + <span class="ruby-keyword">if</span> <span class="ruby-ivar">@conf</span>[<span class="ruby-value">:adapter</span>].<span class="ruby-identifier">downcase</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;sqlite3&quot;</span> <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">establish_connection</span>(<span class="ruby-value">:adapter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@conf</span>[<span class="ruby-value">:adapter</span>].<span class="ruby-identifier">downcase</span>, <span class="ruby-value">:database</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@conf</span>[<span class="ruby-value">:database</span>]) <span class="ruby-keyword">else</span> <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">establish_connection</span>( @@ -288,11 +259,11 @@ <div class="method-source-code" id="load_config-source"> - <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 121</span> + <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 116</span> <span class="ruby-keyword">def</span> <span class="ruby-constant">DB</span>.<span class="ruby-identifier">load_config</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-ivar">@config_file</span>) <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>, <span class="ruby-node">&quot;No database configuration file found: #{@config_file}&quot;</span> <span class="ruby-keyword">end</span> @@ -354,11 +325,11 @@ <div class="method-source-code" id="override_config_file-source"> - <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 79</span> + <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 74</span> <span class="ruby-keyword">def</span> <span class="ruby-constant">DB</span>.<span class="ruby-identifier">override_config_file</span>(<span class="ruby-identifier">path</span>) <span class="ruby-ivar">@config_file</span> = <span class="ruby-identifier">path</span> <span class="ruby-keyword">end</span></pre> </div> @@ -387,11 +358,11 @@ <div class="method-source-code" id="query_by_hostname-source"> - <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 98</span> + <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 93</span> <span class="ruby-keyword">def</span> <span class="ruby-constant">DB</span>.<span class="ruby-identifier">query_by_hostname</span>(<span class="ruby-identifier">term</span>) <span class="ruby-keyword">return</span> <span class="ruby-identifier">where</span>(<span class="ruby-node">&quot;#{@conf[:host_field]} LIKE ?&quot;</span>, <span class="ruby-identifier">term</span> ).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-identifier">r</span>[<span class="ruby-ivar">@conf</span>[<span class="ruby-value">:host_field</span>]] } <span class="ruby-keyword">end</span></pre> </div> @@ -420,11 +391,11 @@ <div class="method-source-code" id="query_by_os-source"> - <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 103</span> + <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 98</span> <span class="ruby-keyword">def</span> <span class="ruby-constant">DB</span>.<span class="ruby-identifier">query_by_os</span>(<span class="ruby-identifier">term</span>) <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@db_os_queries</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>, <span class="ruby-string">&quot;OS based queries not supported in the configuration supplied&quot;</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">return</span> <span class="ruby-identifier">where</span>(<span class="ruby-ivar">@conf</span>[<span class="ruby-value">:os_field</span>] =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">term</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-identifier">r</span>[<span class="ruby-ivar">@conf</span>[<span class="ruby-value">:host_field</span>]] } @@ -456,10 +427,10 @@ <div class="method-source-code" id="query_by_type-source"> - <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 111</span> + <pre><span class="ruby-comment"># File lib/rcmd/db.rb, line 106</span> <span class="ruby-keyword">def</span> <span class="ruby-constant">DB</span>.<span class="ruby-identifier">query_by_type</span>(<span class="ruby-identifier">term</span>) <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@db_type_queries</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>, <span class="ruby-string">&quot;Type queries not supported in the configuration supplied&quot;</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">return</span> <span class="ruby-identifier">where</span>(<span class="ruby-ivar">@conf</span>[<span class="ruby-value">:type_field</span>] =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">term</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-identifier">r</span>[<span class="ruby-ivar">@conf</span>[<span class="ruby-value">:host_field</span>]] }