/usr/share/debci/public/doc/file.RUBYAPI.html is in debci 1.5.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 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 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
File: RUBYAPI
— Documentation by YARD 0.9.7
</title>
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
pathId = "RUBYAPI";
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="file_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</a> »
<span class="title">File: RUBYAPI</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"><div id='filecontents'>
<h1 id="label-The+debci+Ruby+API">The debci Ruby API</h1>
<p>The main entry point of the API is the <span class='object_link'><a href="Debci/Repository.html" title="Debci::Repository (class)">Debci::Repository</a></span> class. It will
allow you to find objects representing specific packages, and from there to
test run results.</p>
<h2 id="label-Accessing+packages">Accessing packages</h2>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>debci</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_repository'>repository</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Debci.html" title="Debci (module)">Debci</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Debci/Repository.html" title="Debci::Repository (class)">Repository</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Debci/Repository.html#initialize-instance_method" title="Debci::Repository#initialize (method)">new</a></span></span>
</code></pre>
<p>With a repository object, you can obtain <span class='object_link'><a href="Debci/Package.html" title="Debci::Package (class)">Debci::Package</a></span> objects:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_package'>package</span> <span class='op'>=</span> <span class='id identifier rubyid_repository'>repository</span><span class='period'>.</span><span class='id identifier rubyid_find_package'>find_package</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rails-3.2</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
</code></pre>
<h2 id="label-Obtaining+data+for+a+given+package">Obtaining data for a given package</h2>
<p>With a Debci::Package object, you can obtain the current status with the
<code>status</code> method. This method will return a table with
architectures on rows, suites on columns, and a status object in each cell.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_status_table'>status_table</span> <span class='op'>=</span> <span class='id identifier rubyid_package'>package</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span>
</code></pre>
<h3 id="label-Obtaining+package+suites+and+architectures">Obtaining package suites and architectures</h3>
<p>A Debci::Package object will give the suites and architectures it is
currently available on through the <code>suites</code> and
<code>architectures</code> methods.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_package'>package</span><span class='period'>.</span><span class='id identifier rubyid_suites'>suites</span>
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_package'>package</span><span class='period'>.</span><span class='id identifier rubyid_architectures'>architectures</span>
</code></pre>
<h3 id="label-Getting+package+news">Getting package news</h3>
<p>The <code>news</code> method will return a news feed for that package,
listing test runs where the package status changed from <code>pass</code>
to <code>fail</code> or the other way around.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_news'>news</span> <span class='op'>=</span> <span class='id identifier rubyid_package'>package</span><span class='period'>.</span><span class='id identifier rubyid_news'>news</span>
<span class='id identifier rubyid_news'>news</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_item'>item</span><span class='op'>|</span>
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_item'>item</span><span class='period'>.</span><span class='id identifier rubyid_headline'>headline</span>
<span class='kw'>end</span>
</code></pre>
<h3 id="label-Finding+package+failures+-28Overall+Status-29">Finding package failures (Overall Status)</h3>
<p>The <code>failures</code> method returns an array of suite/architectures
that the package is failing. If there are no failures, nothing is returned.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_failures'>failures</span> <span class='op'>=</span> <span class='id identifier rubyid_package'>package</span><span class='period'>.</span><span class='id identifier rubyid_failures'>failures</span>
<span class='kw'>if</span> <span class='id identifier rubyid_failures'>failures</span>
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_failures'>failures</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Passing everywhere</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
</code></pre>
<h3 id="label-Getting+test+history">Getting test history</h3>
<p>The <code>history</code> method obtains a package`s test history on a
specific suite and architecture. This method will return an array of
<span class='object_link'><a href="Debci/Status.html" title="Debci::Status (class)">Debci::Status</a></span> objects where each object represents one test entry.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_history'>history</span> <span class='op'>=</span> <span class='id identifier rubyid_package'>package</span><span class='period'>.</span><span class='id identifier rubyid_history'>history</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>unstable</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>amd64</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_package'>package</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_history'>history</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_entry'>entry</span><span class='op'>|</span>
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Version: </span><span class='tstring_end'>'</span></span> <span class='op'>+</span> <span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span>
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Date: </span><span class='tstring_end'>'</span></span> <span class='op'>+</span> <span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_date'>date</span>
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Status: </span><span class='tstring_end'>'</span></span> <span class='op'>+</span> <span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span>
<span class='kw'>end</span>
</code></pre>
<p>See the documentation for the <span class='object_link'><a href="Debci/Package.html" title="Debci::Package (class)">Debci::Package</a></span> class for more information.</p>
</div></div>
<div id="footer">
Generated by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.7 (ruby-2.3.3).
</div>
</div>
</body>
</html>
|