friendly-cukes 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/DETAILED_DESCRIPTION.md +235 -0
- data/Gemfile +17 -0
- data/LICENSE.txt +22 -0
- data/README.md +108 -0
- data/Rakefile +2 -0
- data/bin/build-extractor +69 -0
- data/bin/friendly-cukes +48 -0
- data/friendly-cukes.gemspec +41 -0
- data/lib/friendly/build_extractor.rb +647 -0
- data/lib/friendly/cukes.rb +29 -0
- data/lib/friendly/cukes/framework/Gemfile +16 -0
- data/lib/friendly/cukes/framework/Gemfile.lock +113 -0
- data/lib/friendly/cukes/framework/Rakefile.rb +19 -0
- data/lib/friendly/cukes/framework/config/config.yml +87 -0
- data/lib/friendly/cukes/framework/config/cucumber.yml +49 -0
- data/lib/friendly/cukes/framework/coverage/.last_run.json +5 -0
- data/lib/friendly/cukes/framework/coverage/.resultset.json +3519 -0
- data/lib/friendly/cukes/framework/coverage/.resultset.json.lock +0 -0
- data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/jquery-1.3.2.min.js +19 -0
- data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/jquery.tablesorter.min.js +15 -0
- data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/print.css +12 -0
- data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/rcov.js +42 -0
- data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/screen.css +270 -0
- data/lib/friendly/cukes/framework/coverage/rcov/index.html +392 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-app_init-app_driver_rb.html +98 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-app_utils-data_file_names_rb.html +65 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-app_utils-page_utils_rb.html +533 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-generic-create_log_rb.html +521 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-generic-custom_html_report_rb.html +2522 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-generic-datetime_library_rb.html +296 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-generic-file_library_rb.html +995 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-generic-performance_report_rb.html +1613 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-generic-read_from_yml_rb.html +944 -0
- data/lib/friendly/cukes/framework/coverage/rcov/object_repository-desktop-gem_search_rb.html +773 -0
- data/lib/friendly/cukes/framework/coverage/rcov/object_repository-desktop-google_search_rb.html +230 -0
- data/lib/friendly/cukes/framework/coverage/rcov/object_repository-mobile-mobile_google_search_rb.html +230 -0
- data/lib/friendly/cukes/framework/coverage/rcov/step_definitions-desktop-gem_search_rb.html +188 -0
- data/lib/friendly/cukes/framework/coverage/rcov/step_definitions-desktop-google_search_steps_rb.html +167 -0
- data/lib/friendly/cukes/framework/coverage/rcov/step_definitions-mobile-mobile_google_search_steps_rb.html +167 -0
- data/lib/friendly/cukes/framework/coverage/rcov/support-browser_settings_rb.html +851 -0
- data/lib/friendly/cukes/framework/coverage/rcov/support-env_rb.html +242 -0
- data/lib/friendly/cukes/framework/coverage/rcov/support-hooks_rb.html +878 -0
- data/lib/friendly/cukes/framework/coverage/rcov/support-html_formatter_rb.html +230 -0
- data/lib/friendly/cukes/framework/features/desktop/google_search/google_search.feature +19 -0
- data/lib/friendly/cukes/framework/features/desktop/rubygems_search/gem_name_tc_04.yml +2 -0
- data/lib/friendly/cukes/framework/features/desktop/rubygems_search/gem_search.feature +37 -0
- data/lib/friendly/cukes/framework/features/desktop/test_data/gem_name.yml +2 -0
- data/lib/friendly/cukes/framework/features/mobile/google_search/mobile_google_search.feature +19 -0
- data/lib/friendly/cukes/framework/library/app_init/app_init.rb +13 -0
- data/lib/friendly/cukes/framework/library/app_utils/data_file_names.rb +2 -0
- data/lib/friendly/cukes/framework/library/app_utils/page_utils.rb +157 -0
- data/lib/friendly/cukes/framework/library/generic/app_logo_1.png +0 -0
- data/lib/friendly/cukes/framework/library/generic/create_log.rb +154 -0
- data/lib/friendly/cukes/framework/library/generic/custom_html_report.rb +852 -0
- data/lib/friendly/cukes/framework/library/generic/datetime_library.rb +79 -0
- data/lib/friendly/cukes/framework/library/generic/file_library.rb +311 -0
- data/lib/friendly/cukes/framework/library/generic/performance_report.rb +518 -0
- data/lib/friendly/cukes/framework/library/generic/read_from_yml.rb +294 -0
- data/lib/friendly/cukes/framework/object_repository/desktop/desktop_web_object_repo.rb +50 -0
- data/lib/friendly/cukes/framework/object_repository/mobile/mobile_web_object_repo.rb +22 -0
- data/lib/friendly/cukes/framework/page_objects/desktop/gem_search.rb +213 -0
- data/lib/friendly/cukes/framework/page_objects/desktop/google_search.rb +53 -0
- data/lib/friendly/cukes/framework/page_objects/mobile/mobile_google_search.rb +53 -0
- data/lib/friendly/cukes/framework/step_definitions/desktop/gem_search.rb +43 -0
- data/lib/friendly/cukes/framework/step_definitions/desktop/google_search_steps.rb +36 -0
- data/lib/friendly/cukes/framework/step_definitions/mobile/mobile_google_search_steps.rb +36 -0
- data/lib/friendly/cukes/framework/support/browser_settings.rb +264 -0
- data/lib/friendly/cukes/framework/support/env.rb +65 -0
- data/lib/friendly/cukes/framework/support/hooks.rb +274 -0
- data/lib/friendly/cukes/framework/support/html_formatter.rb +57 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/app_env.log +15 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/custom_report/detailed_report/app_logo_1.png +0 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/custom_report/detailed_report/desktop_gem_search.html +647 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/custom_report/detailed_report/desktop_google_search.html +590 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/custom_report/report_home.html +593 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/desktop_rubygems_search.log +84 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/report_21_05_2015-11_04_54.html +472 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/report_21_05_2015-11_04_54.json +299 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_37/app_env.log +15 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_37/desktop_google_search.log +22 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_37/report_21_05_2015-11_03_49.html +472 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_37/report_21_05_2015-11_03_49.json +155 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-17_28_10/app_env.log +15 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-17_28_10/mobile_google_search.log +22 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-17_28_10/report_21_05_2015-17_29_26.html +472 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-17_28_10/report_21_05_2015-17_29_26.json +143 -0
- data/lib/friendly/cukes/version.rb +61 -0
- metadata +309 -0
@@ -0,0 +1,944 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
|
3
|
+
<head>
|
4
|
+
<title>library/generic/read_from_yml.rb</title>
|
5
|
+
<link href="./assets/0.2.3/screen.css" media="all" rel="stylesheet" type="text/css" />
|
6
|
+
<link href="./assets/0.2.3/print.css" media="print" rel="stylesheet" type="text/css" />
|
7
|
+
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
|
8
|
+
<script type="text/javascript" src="./assets/0.2.3/rcov.js"></script>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<h1>Cukes C0 Coverage Information - Simploco - RCov</h1>
|
12
|
+
<h2>library/generic/read_from_yml.rb</h2>
|
13
|
+
|
14
|
+
<div class="report_table_wrapper">
|
15
|
+
<table class='report' id='report_table'>
|
16
|
+
<thead>
|
17
|
+
<tr>
|
18
|
+
<th class="left_align">Name</th>
|
19
|
+
<th class="right_align">Total Lines</th>
|
20
|
+
<th class="right_align">Lines of Code</th>
|
21
|
+
<th class="left_align">Total Coverage</th>
|
22
|
+
<th class="left_align">Code Coverage</th>
|
23
|
+
</tr>
|
24
|
+
</thead>
|
25
|
+
<tbody>
|
26
|
+
<tr>
|
27
|
+
<td class="left_align"><a href="library-generic-read_from_yml_rb.html">library/generic/read_from_yml.rb</a></td>
|
28
|
+
<td class='right_align'><tt>295</tt></td>
|
29
|
+
<td class='right_align'><tt>134</tt></td>
|
30
|
+
<td class="left_align"><div class="percent_graph_legend"><tt class=''>75.25%</tt></div>
|
31
|
+
<div class="percent_graph">
|
32
|
+
<div class="covered" style="width:75px"></div>
|
33
|
+
<div class="uncovered" style="width:25px"></div>
|
34
|
+
</div></td>
|
35
|
+
<td class="left_align"><div class="percent_graph_legend"><tt class=''>45.52%</tt></div>
|
36
|
+
<div class="percent_graph">
|
37
|
+
<div class="covered" style="width:46px"></div>
|
38
|
+
<div class="uncovered" style="width:54px"></div>
|
39
|
+
</div></td>
|
40
|
+
</tr>
|
41
|
+
</tbody>
|
42
|
+
</table>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<h3>Key</h3>
|
46
|
+
|
47
|
+
<div class="key"><pre><span class='marked'>Code reported as executed by Ruby looks like this...</span><span class='marked1'>and this: this line is also marked as covered.</span><span class='inferred'>Lines considered as run by rcov, but not reported by Ruby, look like this,</span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).</span><span class='uncovered'>Finally, here's a line marked as not executed.</span></pre></div>
|
48
|
+
|
49
|
+
<h3>Coverage Details</h3>
|
50
|
+
|
51
|
+
<table class="details">
|
52
|
+
<tbody>
|
53
|
+
<tr class="inferred">
|
54
|
+
<td><pre><a name="line2">2</a> =begin</pre></td>
|
55
|
+
</tr>
|
56
|
+
<tr class="inferred">
|
57
|
+
<td><pre><a name="line3">3</a> *Name : Read_From_YML</pre></td>
|
58
|
+
</tr>
|
59
|
+
<tr class="inferred">
|
60
|
+
<td><pre><a name="line4">4</a> *Description : class definition for reading data value from yml file</pre></td>
|
61
|
+
</tr>
|
62
|
+
<tr class="inferred">
|
63
|
+
<td><pre><a name="line5">5</a> *Author : Chandra sekaran</pre></td>
|
64
|
+
</tr>
|
65
|
+
<tr class="inferred">
|
66
|
+
<td><pre><a name="line6">6</a> *Creation Date : 23/08/2014</pre></td>
|
67
|
+
</tr>
|
68
|
+
<tr class="inferred">
|
69
|
+
<td><pre><a name="line7">7</a> *Updation Date :</pre></td>
|
70
|
+
</tr>
|
71
|
+
<tr class="inferred">
|
72
|
+
<td><pre><a name="line8">8</a> =end</pre></td>
|
73
|
+
</tr>
|
74
|
+
<tr class="inferred">
|
75
|
+
<td><pre><a name="line9">9</a> </pre></td>
|
76
|
+
</tr>
|
77
|
+
<tr class="marked">
|
78
|
+
<td><pre><a name="line10">10</a> module CUKES</pre></td>
|
79
|
+
</tr>
|
80
|
+
<tr class="marked">
|
81
|
+
<td><pre><a name="line11">11</a> class Read_From_YML</pre></td>
|
82
|
+
</tr>
|
83
|
+
<tr class="marked">
|
84
|
+
<td><pre><a name="line12">12</a> include FileLibrary # module that define methods for all file manipulations</pre></td>
|
85
|
+
</tr>
|
86
|
+
<tr class="inferred">
|
87
|
+
<td><pre><a name="line13">13</a> </pre></td>
|
88
|
+
</tr>
|
89
|
+
<tr class="inferred">
|
90
|
+
<td><pre><a name="line14">14</a> # Description : opens the yml file</pre></td>
|
91
|
+
</tr>
|
92
|
+
<tr class="inferred">
|
93
|
+
<td><pre><a name="line15">15</a> # Author : Chandra sekaran</pre></td>
|
94
|
+
</tr>
|
95
|
+
<tr class="inferred">
|
96
|
+
<td><pre><a name="line16">16</a> # Arguments :</pre></td>
|
97
|
+
</tr>
|
98
|
+
<tr class="inferred">
|
99
|
+
<td><pre><a name="line17">17</a> # str_file_path : relative path of the yml file</pre></td>
|
100
|
+
</tr>
|
101
|
+
<tr class="inferred">
|
102
|
+
<td><pre><a name="line18">18</a> #</pre></td>
|
103
|
+
</tr>
|
104
|
+
<tr class="marked">
|
105
|
+
<td><pre><a name="line19">19</a> def initialize(str_file_path = "")</pre></td>
|
106
|
+
</tr>
|
107
|
+
<tr class="marked">
|
108
|
+
<td><pre><a name="line20">20</a> raise "Exception : ReadFromYML instance cannot be created with filename" if str_file_path.nil?</pre></td>
|
109
|
+
</tr>
|
110
|
+
<tr class="marked">
|
111
|
+
<td><pre><a name="line21">21</a> raise "Exception : file does not exists #{str_file_path}" if !is_file_exists(str_file_path)</pre></td>
|
112
|
+
</tr>
|
113
|
+
<tr class="marked">
|
114
|
+
<td><pre><a name="line22">22</a> @yml = open_yml_file(str_file_path)</pre></td>
|
115
|
+
</tr>
|
116
|
+
<tr class="marked">
|
117
|
+
<td><pre><a name="line23">23</a> @yml_file_path = str_file_path</pre></td>
|
118
|
+
</tr>
|
119
|
+
<tr class="inferred">
|
120
|
+
<td><pre><a name="line24">24</a> rescue Exception => ex</pre></td>
|
121
|
+
</tr>
|
122
|
+
<tr class="uncovered">
|
123
|
+
<td><pre><a name="line25">25</a> $log.error("Error in opening file '#{str_file_path}' : #{ex}")</pre></td>
|
124
|
+
</tr>
|
125
|
+
<tr class="uncovered">
|
126
|
+
<td><pre><a name="line26">26</a> exit</pre></td>
|
127
|
+
</tr>
|
128
|
+
<tr class="inferred">
|
129
|
+
<td><pre><a name="line27">27</a> end</pre></td>
|
130
|
+
</tr>
|
131
|
+
<tr class="inferred">
|
132
|
+
<td><pre><a name="line28">28</a> </pre></td>
|
133
|
+
</tr>
|
134
|
+
<tr class="inferred">
|
135
|
+
<td><pre><a name="line29">29</a> # Description : returns the value for the given input ypath</pre></td>
|
136
|
+
</tr>
|
137
|
+
<tr class="inferred">
|
138
|
+
<td><pre><a name="line30">30</a> # Author : Chandra sekaran</pre></td>
|
139
|
+
</tr>
|
140
|
+
<tr class="inferred">
|
141
|
+
<td><pre><a name="line31">31</a> # Arguments :</pre></td>
|
142
|
+
</tr>
|
143
|
+
<tr class="inferred">
|
144
|
+
<td><pre><a name="line32">32</a> # str_ypath : ypath of the key element</pre></td>
|
145
|
+
</tr>
|
146
|
+
<tr class="inferred">
|
147
|
+
<td><pre><a name="line33">33</a> # Return value :</pre></td>
|
148
|
+
</tr>
|
149
|
+
<tr class="inferred">
|
150
|
+
<td><pre><a name="line34">34</a> # req_val : value of the key element</pre></td>
|
151
|
+
</tr>
|
152
|
+
<tr class="inferred">
|
153
|
+
<td><pre><a name="line35">35</a> #</pre></td>
|
154
|
+
</tr>
|
155
|
+
<tr class="marked">
|
156
|
+
<td><pre><a name="line36">36</a> def get_value(str_ypath = "")</pre></td>
|
157
|
+
</tr>
|
158
|
+
<tr class="marked">
|
159
|
+
<td><pre><a name="line37">37</a> raise "Exception : ReadFromYML - ypath cannot be empty" if str_ypath.nil?</pre></td>
|
160
|
+
</tr>
|
161
|
+
<tr class="marked">
|
162
|
+
<td><pre><a name="line38">38</a> req_val = traverse_yml(str_ypath)</pre></td>
|
163
|
+
</tr>
|
164
|
+
<tr class="marked">
|
165
|
+
<td><pre><a name="line39">39</a> return req_val</pre></td>
|
166
|
+
</tr>
|
167
|
+
<tr class="inferred">
|
168
|
+
<td><pre><a name="line40">40</a> rescue Exception => ex</pre></td>
|
169
|
+
</tr>
|
170
|
+
<tr class="uncovered">
|
171
|
+
<td><pre><a name="line41">41</a> $log.error("Error in getting value for ypath '#{str_ypath}' : #{ex}")</pre></td>
|
172
|
+
</tr>
|
173
|
+
<tr class="uncovered">
|
174
|
+
<td><pre><a name="line42">42</a> exit</pre></td>
|
175
|
+
</tr>
|
176
|
+
<tr class="inferred">
|
177
|
+
<td><pre><a name="line43">43</a> end</pre></td>
|
178
|
+
</tr>
|
179
|
+
<tr class="inferred">
|
180
|
+
<td><pre><a name="line44">44</a> </pre></td>
|
181
|
+
</tr>
|
182
|
+
<tr class="inferred">
|
183
|
+
<td><pre><a name="line45">45</a> # Description : returns the hash value for the given unique key</pre></td>
|
184
|
+
</tr>
|
185
|
+
<tr class="inferred">
|
186
|
+
<td><pre><a name="line46">46</a> # Author : Chandra sekaran</pre></td>
|
187
|
+
</tr>
|
188
|
+
<tr class="inferred">
|
189
|
+
<td><pre><a name="line47">47</a> # Arguments :</pre></td>
|
190
|
+
</tr>
|
191
|
+
<tr class="inferred">
|
192
|
+
<td><pre><a name="line48">48</a> # str_key : name of the unique key</pre></td>
|
193
|
+
</tr>
|
194
|
+
<tr class="inferred">
|
195
|
+
<td><pre><a name="line49">49</a> # Return value :</pre></td>
|
196
|
+
</tr>
|
197
|
+
<tr class="inferred">
|
198
|
+
<td><pre><a name="line50">50</a> # @req_hash : hash value of the unique key element</pre></td>
|
199
|
+
</tr>
|
200
|
+
<tr class="inferred">
|
201
|
+
<td><pre><a name="line51">51</a> #</pre></td>
|
202
|
+
</tr>
|
203
|
+
<tr class="marked">
|
204
|
+
<td><pre><a name="line52">52</a> def get_values(str_key)</pre></td>
|
205
|
+
</tr>
|
206
|
+
<tr class="uncovered">
|
207
|
+
<td><pre><a name="line53">53</a> raise "Exception : ReadFromYML - key cannot be empty" if str_key.nil?</pre></td>
|
208
|
+
</tr>
|
209
|
+
<tr class="uncovered">
|
210
|
+
<td><pre><a name="line54">54</a> @yml.each do |key, value|</pre></td>
|
211
|
+
</tr>
|
212
|
+
<tr class="uncovered">
|
213
|
+
<td><pre><a name="line55">55</a> @req_hash = ''</pre></td>
|
214
|
+
</tr>
|
215
|
+
<tr class="uncovered">
|
216
|
+
<td><pre><a name="line56">56</a> if key == str_key</pre></td>
|
217
|
+
</tr>
|
218
|
+
<tr class="uncovered">
|
219
|
+
<td><pre><a name="line57">57</a> @req_hash = value</pre></td>
|
220
|
+
</tr>
|
221
|
+
<tr class="uncovered">
|
222
|
+
<td><pre><a name="line58">58</a> break</pre></td>
|
223
|
+
</tr>
|
224
|
+
<tr class="inferred">
|
225
|
+
<td><pre><a name="line59">59</a> else</pre></td>
|
226
|
+
</tr>
|
227
|
+
<tr class="uncovered">
|
228
|
+
<td><pre><a name="line60">60</a> if value.size >= 1 and value.class.to_s == "Hash"</pre></td>
|
229
|
+
</tr>
|
230
|
+
<tr class="uncovered">
|
231
|
+
<td><pre><a name="line61">61</a> @req_hash = traverse_hash(value, str_key)</pre></td>
|
232
|
+
</tr>
|
233
|
+
<tr class="uncovered">
|
234
|
+
<td><pre><a name="line62">62</a> return @req_hash if @req_hash.class.to_s == "Hash"</pre></td>
|
235
|
+
</tr>
|
236
|
+
<tr class="inferred">
|
237
|
+
<td><pre><a name="line63">63</a> end</pre></td>
|
238
|
+
</tr>
|
239
|
+
<tr class="inferred">
|
240
|
+
<td><pre><a name="line64">64</a> end</pre></td>
|
241
|
+
</tr>
|
242
|
+
<tr class="inferred">
|
243
|
+
<td><pre><a name="line65">65</a> end</pre></td>
|
244
|
+
</tr>
|
245
|
+
<tr class="inferred">
|
246
|
+
<td><pre><a name="line66">66</a> rescue Exception => ex</pre></td>
|
247
|
+
</tr>
|
248
|
+
<tr class="uncovered">
|
249
|
+
<td><pre><a name="line67">67</a> $log.error("Error in getting value for '#{str_key}' : #{ex}")</pre></td>
|
250
|
+
</tr>
|
251
|
+
<tr class="uncovered">
|
252
|
+
<td><pre><a name="line68">68</a> exit</pre></td>
|
253
|
+
</tr>
|
254
|
+
<tr class="inferred">
|
255
|
+
<td><pre><a name="line69">69</a> end</pre></td>
|
256
|
+
</tr>
|
257
|
+
<tr class="inferred">
|
258
|
+
<td><pre><a name="line70">70</a> </pre></td>
|
259
|
+
</tr>
|
260
|
+
<tr class="inferred">
|
261
|
+
<td><pre><a name="line71">71</a> # Description : returns the hash from the given input hash that matches the given key</pre></td>
|
262
|
+
</tr>
|
263
|
+
<tr class="inferred">
|
264
|
+
<td><pre><a name="line72">72</a> # Author : Chandra sekaran</pre></td>
|
265
|
+
</tr>
|
266
|
+
<tr class="inferred">
|
267
|
+
<td><pre><a name="line73">73</a> # Arguments :</pre></td>
|
268
|
+
</tr>
|
269
|
+
<tr class="inferred">
|
270
|
+
<td><pre><a name="line74">74</a> # hash_val : hash element</pre></td>
|
271
|
+
</tr>
|
272
|
+
<tr class="inferred">
|
273
|
+
<td><pre><a name="line75">75</a> # req_key : key to be found inside the hash element</pre></td>
|
274
|
+
</tr>
|
275
|
+
<tr class="inferred">
|
276
|
+
<td><pre><a name="line76">76</a> # Return value :</pre></td>
|
277
|
+
</tr>
|
278
|
+
<tr class="inferred">
|
279
|
+
<td><pre><a name="line77">77</a> # @hash_value : value of the key element</pre></td>
|
280
|
+
</tr>
|
281
|
+
<tr class="inferred">
|
282
|
+
<td><pre><a name="line78">78</a> #</pre></td>
|
283
|
+
</tr>
|
284
|
+
<tr class="marked">
|
285
|
+
<td><pre><a name="line79">79</a> def traverse_hash(hash_val, req_key)</pre></td>
|
286
|
+
</tr>
|
287
|
+
<tr class="uncovered">
|
288
|
+
<td><pre><a name="line80">80</a> hash_val.each do |key, value|</pre></td>
|
289
|
+
</tr>
|
290
|
+
<tr class="uncovered">
|
291
|
+
<td><pre><a name="line81">81</a> traverse_hash(value, req_key) if !value.nil? and value.size >= 1 and value.class.to_s == "Hash"</pre></td>
|
292
|
+
</tr>
|
293
|
+
<tr class="uncovered">
|
294
|
+
<td><pre><a name="line82">82</a> if key == req_key</pre></td>
|
295
|
+
</tr>
|
296
|
+
<tr class="uncovered">
|
297
|
+
<td><pre><a name="line83">83</a> @hash_value = value</pre></td>
|
298
|
+
</tr>
|
299
|
+
<tr class="uncovered">
|
300
|
+
<td><pre><a name="line84">84</a> break</pre></td>
|
301
|
+
</tr>
|
302
|
+
<tr class="inferred">
|
303
|
+
<td><pre><a name="line85">85</a> end</pre></td>
|
304
|
+
</tr>
|
305
|
+
<tr class="inferred">
|
306
|
+
<td><pre><a name="line86">86</a> end</pre></td>
|
307
|
+
</tr>
|
308
|
+
<tr class="uncovered">
|
309
|
+
<td><pre><a name="line87">87</a> return @hash_value</pre></td>
|
310
|
+
</tr>
|
311
|
+
<tr class="inferred">
|
312
|
+
<td><pre><a name="line88">88</a> rescue Exception => ex</pre></td>
|
313
|
+
</tr>
|
314
|
+
<tr class="uncovered">
|
315
|
+
<td><pre><a name="line89">89</a> $log.error("Error in traversing hash '#{hash_val}' for '#{req_key}' : #{ex}")</pre></td>
|
316
|
+
</tr>
|
317
|
+
<tr class="uncovered">
|
318
|
+
<td><pre><a name="line90">90</a> exit</pre></td>
|
319
|
+
</tr>
|
320
|
+
<tr class="inferred">
|
321
|
+
<td><pre><a name="line91">91</a> end</pre></td>
|
322
|
+
</tr>
|
323
|
+
<tr class="inferred">
|
324
|
+
<td><pre><a name="line92">92</a> </pre></td>
|
325
|
+
</tr>
|
326
|
+
<tr class="inferred">
|
327
|
+
<td><pre><a name="line93">93</a> # Description : traverses the yml file and gets the value for the given input ypath</pre></td>
|
328
|
+
</tr>
|
329
|
+
<tr class="inferred">
|
330
|
+
<td><pre><a name="line94">94</a> # Author : Chandra sekaran</pre></td>
|
331
|
+
</tr>
|
332
|
+
<tr class="inferred">
|
333
|
+
<td><pre><a name="line95">95</a> # Arguments :</pre></td>
|
334
|
+
</tr>
|
335
|
+
<tr class="inferred">
|
336
|
+
<td><pre><a name="line96">96</a> # str_ypath : ypath of the key element</pre></td>
|
337
|
+
</tr>
|
338
|
+
<tr class="inferred">
|
339
|
+
<td><pre><a name="line97">97</a> # Return value :</pre></td>
|
340
|
+
</tr>
|
341
|
+
<tr class="inferred">
|
342
|
+
<td><pre><a name="line98">98</a> # str_value : value of the key element</pre></td>
|
343
|
+
</tr>
|
344
|
+
<tr class="inferred">
|
345
|
+
<td><pre><a name="line99">99</a> #</pre></td>
|
346
|
+
</tr>
|
347
|
+
<tr class="marked">
|
348
|
+
<td><pre><a name="line100">100</a> def traverse_yml(str_ypath)</pre></td>
|
349
|
+
</tr>
|
350
|
+
<tr class="marked">
|
351
|
+
<td><pre><a name="line101">101</a> str_value = ''</pre></td>
|
352
|
+
</tr>
|
353
|
+
<tr class="marked">
|
354
|
+
<td><pre><a name="line102">102</a> arr_key = str_ypath.split('/')</pre></td>
|
355
|
+
</tr>
|
356
|
+
<tr class="marked">
|
357
|
+
<td><pre><a name="line103">103</a> num_level = arr_key.size</pre></td>
|
358
|
+
</tr>
|
359
|
+
<tr class="inferred">
|
360
|
+
<td><pre><a name="line104">104</a> </pre></td>
|
361
|
+
</tr>
|
362
|
+
<tr class="marked">
|
363
|
+
<td><pre><a name="line105">105</a> case num_level</pre></td>
|
364
|
+
</tr>
|
365
|
+
<tr class="inferred">
|
366
|
+
<td><pre><a name="line106">106</a> when 1</pre></td>
|
367
|
+
</tr>
|
368
|
+
<tr class="uncovered">
|
369
|
+
<td><pre><a name="line107">107</a> str_value = @yml[arr_key[0]]</pre></td>
|
370
|
+
</tr>
|
371
|
+
<tr class="inferred">
|
372
|
+
<td><pre><a name="line108">108</a> when 2</pre></td>
|
373
|
+
</tr>
|
374
|
+
<tr class="marked">
|
375
|
+
<td><pre><a name="line109">109</a> str_value = @yml[arr_key[0]][arr_key[1]]</pre></td>
|
376
|
+
</tr>
|
377
|
+
<tr class="inferred">
|
378
|
+
<td><pre><a name="line110">110</a> when 3</pre></td>
|
379
|
+
</tr>
|
380
|
+
<tr class="uncovered">
|
381
|
+
<td><pre><a name="line111">111</a> str_value = @yml[arr_key[0]][arr_key[1]][arr_key[2]]</pre></td>
|
382
|
+
</tr>
|
383
|
+
<tr class="inferred">
|
384
|
+
<td><pre><a name="line112">112</a> when 4</pre></td>
|
385
|
+
</tr>
|
386
|
+
<tr class="marked">
|
387
|
+
<td><pre><a name="line113">113</a> str_value = @yml[arr_key[0]][arr_key[1]][arr_key[2]][arr_key[3]]</pre></td>
|
388
|
+
</tr>
|
389
|
+
<tr class="inferred">
|
390
|
+
<td><pre><a name="line114">114</a> when 5</pre></td>
|
391
|
+
</tr>
|
392
|
+
<tr class="marked">
|
393
|
+
<td><pre><a name="line115">115</a> str_value = @yml[arr_key[0]][arr_key[1]][arr_key[2]][arr_key[3]][arr_key[4]]</pre></td>
|
394
|
+
</tr>
|
395
|
+
<tr class="inferred">
|
396
|
+
<td><pre><a name="line116">116</a> when 6</pre></td>
|
397
|
+
</tr>
|
398
|
+
<tr class="uncovered">
|
399
|
+
<td><pre><a name="line117">117</a> str_value = @yml[arr_key[0]][arr_key[1]][arr_key[2]][arr_key[3]][arr_key[4]][arr_key[5]]</pre></td>
|
400
|
+
</tr>
|
401
|
+
<tr class="inferred">
|
402
|
+
<td><pre><a name="line118">118</a> when 7</pre></td>
|
403
|
+
</tr>
|
404
|
+
<tr class="uncovered">
|
405
|
+
<td><pre><a name="line119">119</a> str_value = @yml[arr_key[0]][arr_key[1]][arr_key[2]][arr_key[3]][arr_key[4]][arr_key[5]][arr_key[6]]</pre></td>
|
406
|
+
</tr>
|
407
|
+
<tr class="inferred">
|
408
|
+
<td><pre><a name="line120">120</a> else</pre></td>
|
409
|
+
</tr>
|
410
|
+
<tr class="uncovered">
|
411
|
+
<td><pre><a name="line121">121</a> raise "Given YML path cannot be traversed"</pre></td>
|
412
|
+
</tr>
|
413
|
+
<tr class="inferred">
|
414
|
+
<td><pre><a name="line122">122</a> end</pre></td>
|
415
|
+
</tr>
|
416
|
+
<tr class="marked">
|
417
|
+
<td><pre><a name="line123">123</a> return str_value</pre></td>
|
418
|
+
</tr>
|
419
|
+
<tr class="inferred">
|
420
|
+
<td><pre><a name="line124">124</a> rescue Exception => ex</pre></td>
|
421
|
+
</tr>
|
422
|
+
<tr class="uncovered">
|
423
|
+
<td><pre><a name="line125">125</a> $log.error("Error in traverse_yml '#{str_ypath}' : #{ex}")</pre></td>
|
424
|
+
</tr>
|
425
|
+
<tr class="uncovered">
|
426
|
+
<td><pre><a name="line126">126</a> exit</pre></td>
|
427
|
+
</tr>
|
428
|
+
<tr class="inferred">
|
429
|
+
<td><pre><a name="line127">127</a> end</pre></td>
|
430
|
+
</tr>
|
431
|
+
<tr class="inferred">
|
432
|
+
<td><pre><a name="line128">128</a> </pre></td>
|
433
|
+
</tr>
|
434
|
+
<tr class="inferred">
|
435
|
+
<td><pre><a name="line129">129</a> # Description : returns the profile name that is currently available</pre></td>
|
436
|
+
</tr>
|
437
|
+
<tr class="inferred">
|
438
|
+
<td><pre><a name="line130">130</a> # Author : Chandra sekaran</pre></td>
|
439
|
+
</tr>
|
440
|
+
<tr class="inferred">
|
441
|
+
<td><pre><a name="line131">131</a> # Arguments :</pre></td>
|
442
|
+
</tr>
|
443
|
+
<tr class="inferred">
|
444
|
+
<td><pre><a name="line132">132</a> # str_box : profile name whether development/test</pre></td>
|
445
|
+
</tr>
|
446
|
+
<tr class="inferred">
|
447
|
+
<td><pre><a name="line133">133</a> # Return value :</pre></td>
|
448
|
+
</tr>
|
449
|
+
<tr class="inferred">
|
450
|
+
<td><pre><a name="line134">134</a> # str_key : key name of the profile</pre></td>
|
451
|
+
</tr>
|
452
|
+
<tr class="inferred">
|
453
|
+
<td><pre><a name="line135">135</a> #</pre></td>
|
454
|
+
</tr>
|
455
|
+
<tr class="marked">
|
456
|
+
<td><pre><a name="line136">136</a> def get_specific_profile(str_box)</pre></td>
|
457
|
+
</tr>
|
458
|
+
<tr class="uncovered">
|
459
|
+
<td><pre><a name="line137">137</a> str_key = ""</pre></td>
|
460
|
+
</tr>
|
461
|
+
<tr class="inferred">
|
462
|
+
<td><pre><a name="line138">138</a> # iterates through the @yml content to find the BOX key and reads the value of :in_use key and returns the key</pre></td>
|
463
|
+
</tr>
|
464
|
+
<tr class="inferred">
|
465
|
+
<td><pre><a name="line139">139</a> # if its value is "no"</pre></td>
|
466
|
+
</tr>
|
467
|
+
<tr class="uncovered">
|
468
|
+
<td><pre><a name="line140">140</a> @yml.each do |key, value|</pre></td>
|
469
|
+
</tr>
|
470
|
+
<tr class="uncovered">
|
471
|
+
<td><pre><a name="line141">141</a> value.each do |k, v|</pre></td>
|
472
|
+
</tr>
|
473
|
+
<tr class="uncovered">
|
474
|
+
<td><pre><a name="line142">142</a> if k.downcase == BOX.downcase</pre></td>
|
475
|
+
</tr>
|
476
|
+
<tr class="uncovered">
|
477
|
+
<td><pre><a name="line143">143</a> v.each do |k1, v1|</pre></td>
|
478
|
+
</tr>
|
479
|
+
<tr class="uncovered">
|
480
|
+
<td><pre><a name="line144">144</a> if k1.downcase.include? str_box.downcase</pre></td>
|
481
|
+
</tr>
|
482
|
+
<tr class="uncovered">
|
483
|
+
<td><pre><a name="line145">145</a> v1.each do |k2, v2|</pre></td>
|
484
|
+
</tr>
|
485
|
+
<tr class="uncovered">
|
486
|
+
<td><pre><a name="line146">146</a> if k2.downcase.include? "in_use"</pre></td>
|
487
|
+
</tr>
|
488
|
+
<tr class="uncovered">
|
489
|
+
<td><pre><a name="line147">147</a> if v2.downcase == "no"</pre></td>
|
490
|
+
</tr>
|
491
|
+
<tr class="uncovered">
|
492
|
+
<td><pre><a name="line148">148</a> str_key = k1</pre></td>
|
493
|
+
</tr>
|
494
|
+
<tr class="uncovered">
|
495
|
+
<td><pre><a name="line149">149</a> set_value("application/#{BOX}/#{str_key}/in_use", "yes") # updates the key values to "yes"</pre></td>
|
496
|
+
</tr>
|
497
|
+
<tr class="uncovered">
|
498
|
+
<td><pre><a name="line150">150</a> change_execution_count("environment/parallel_execution_count", get_value("application/#{BOX}/#{str_key}/in_use"))</pre></td>
|
499
|
+
</tr>
|
500
|
+
<tr class="uncovered">
|
501
|
+
<td><pre><a name="line151">151</a> break</pre></td>
|
502
|
+
</tr>
|
503
|
+
<tr class="inferred">
|
504
|
+
<td><pre><a name="line152">152</a> end</pre></td>
|
505
|
+
</tr>
|
506
|
+
<tr class="inferred">
|
507
|
+
<td><pre><a name="line153">153</a> end</pre></td>
|
508
|
+
</tr>
|
509
|
+
<tr class="inferred">
|
510
|
+
<td><pre><a name="line154">154</a> end</pre></td>
|
511
|
+
</tr>
|
512
|
+
<tr class="uncovered">
|
513
|
+
<td><pre><a name="line155">155</a> break if str_key != ""</pre></td>
|
514
|
+
</tr>
|
515
|
+
<tr class="inferred">
|
516
|
+
<td><pre><a name="line156">156</a> end</pre></td>
|
517
|
+
</tr>
|
518
|
+
<tr class="uncovered">
|
519
|
+
<td><pre><a name="line157">157</a> break if str_key != ""</pre></td>
|
520
|
+
</tr>
|
521
|
+
<tr class="inferred">
|
522
|
+
<td><pre><a name="line158">158</a> end</pre></td>
|
523
|
+
</tr>
|
524
|
+
<tr class="uncovered">
|
525
|
+
<td><pre><a name="line159">159</a> break if str_key != ""</pre></td>
|
526
|
+
</tr>
|
527
|
+
<tr class="inferred">
|
528
|
+
<td><pre><a name="line160">160</a> end</pre></td>
|
529
|
+
</tr>
|
530
|
+
<tr class="uncovered">
|
531
|
+
<td><pre><a name="line161">161</a> break if str_key != ""</pre></td>
|
532
|
+
</tr>
|
533
|
+
<tr class="inferred">
|
534
|
+
<td><pre><a name="line162">162</a> end</pre></td>
|
535
|
+
</tr>
|
536
|
+
<tr class="uncovered">
|
537
|
+
<td><pre><a name="line163">163</a> break if str_key != ""</pre></td>
|
538
|
+
</tr>
|
539
|
+
<tr class="inferred">
|
540
|
+
<td><pre><a name="line164">164</a> end</pre></td>
|
541
|
+
</tr>
|
542
|
+
<tr class="uncovered">
|
543
|
+
<td><pre><a name="line165">165</a> raise "All the profiles (for Login credentials) are in use and hence stopping the execution for #{BOX}/#{str_box}" if str_key == ""</pre></td>
|
544
|
+
</tr>
|
545
|
+
<tr class="uncovered">
|
546
|
+
<td><pre><a name="line166">166</a> $log.info("Currently using #{str_key} under #{str_box} profile under #{BOX} box")</pre></td>
|
547
|
+
</tr>
|
548
|
+
<tr class="uncovered">
|
549
|
+
<td><pre><a name="line167">167</a> str_key</pre></td>
|
550
|
+
</tr>
|
551
|
+
<tr class="inferred">
|
552
|
+
<td><pre><a name="line168">168</a> rescue Exception => ex</pre></td>
|
553
|
+
</tr>
|
554
|
+
<tr class="uncovered">
|
555
|
+
<td><pre><a name="line169">169</a> $log.error("Error in getting free BOX config values : #{ex}")</pre></td>
|
556
|
+
</tr>
|
557
|
+
<tr class="uncovered">
|
558
|
+
<td><pre><a name="line170">170</a> exit</pre></td>
|
559
|
+
</tr>
|
560
|
+
<tr class="inferred">
|
561
|
+
<td><pre><a name="line171">171</a> end</pre></td>
|
562
|
+
</tr>
|
563
|
+
<tr class="inferred">
|
564
|
+
<td><pre><a name="line172">172</a> </pre></td>
|
565
|
+
</tr>
|
566
|
+
<tr class="inferred">
|
567
|
+
<td><pre><a name="line173">173</a> # Description : returns the box and profile names that is currently available</pre></td>
|
568
|
+
</tr>
|
569
|
+
<tr class="inferred">
|
570
|
+
<td><pre><a name="line174">174</a> # Author : Chandra sekaran</pre></td>
|
571
|
+
</tr>
|
572
|
+
<tr class="inferred">
|
573
|
+
<td><pre><a name="line175">175</a> # Arguments :</pre></td>
|
574
|
+
</tr>
|
575
|
+
<tr class="inferred">
|
576
|
+
<td><pre><a name="line176">176</a> # str_box : profile name whether development/test</pre></td>
|
577
|
+
</tr>
|
578
|
+
<tr class="inferred">
|
579
|
+
<td><pre><a name="line177">177</a> # Return value :</pre></td>
|
580
|
+
</tr>
|
581
|
+
<tr class="inferred">
|
582
|
+
<td><pre><a name="line178">178</a> # str_box : key name of the box</pre></td>
|
583
|
+
</tr>
|
584
|
+
<tr class="inferred">
|
585
|
+
<td><pre><a name="line179">179</a> # str_key : key name of the profile</pre></td>
|
586
|
+
</tr>
|
587
|
+
<tr class="inferred">
|
588
|
+
<td><pre><a name="line180">180</a> #</pre></td>
|
589
|
+
</tr>
|
590
|
+
<tr class="marked">
|
591
|
+
<td><pre><a name="line181">181</a> def get_any_profile(str_box)</pre></td>
|
592
|
+
</tr>
|
593
|
+
<tr class="marked">
|
594
|
+
<td><pre><a name="line182">182</a> str_key = ""</pre></td>
|
595
|
+
</tr>
|
596
|
+
<tr class="marked">
|
597
|
+
<td><pre><a name="line183">183</a> str_box_avail = ""</pre></td>
|
598
|
+
</tr>
|
599
|
+
<tr class="inferred">
|
600
|
+
<td><pre><a name="line184">184</a> # iterates through the @yml content to find the BOX key and reads the value of :in_use key and returns the key</pre></td>
|
601
|
+
</tr>
|
602
|
+
<tr class="inferred">
|
603
|
+
<td><pre><a name="line185">185</a> # if its value is "no"</pre></td>
|
604
|
+
</tr>
|
605
|
+
<tr class="marked">
|
606
|
+
<td><pre><a name="line186">186</a> @yml.each do |key, value|</pre></td>
|
607
|
+
</tr>
|
608
|
+
<tr class="marked">
|
609
|
+
<td><pre><a name="line187">187</a> value.each do |k, v|</pre></td>
|
610
|
+
</tr>
|
611
|
+
<tr class="marked">
|
612
|
+
<td><pre><a name="line188">188</a> str_box_avail = k</pre></td>
|
613
|
+
</tr>
|
614
|
+
<tr class="marked">
|
615
|
+
<td><pre><a name="line189">189</a> v.each do |k1, v1|</pre></td>
|
616
|
+
</tr>
|
617
|
+
<tr class="marked">
|
618
|
+
<td><pre><a name="line190">190</a> if k1.downcase.include? str_box.downcase</pre></td>
|
619
|
+
</tr>
|
620
|
+
<tr class="marked">
|
621
|
+
<td><pre><a name="line191">191</a> v1.each do |k2, v2|</pre></td>
|
622
|
+
</tr>
|
623
|
+
<tr class="marked">
|
624
|
+
<td><pre><a name="line192">192</a> if k2.downcase.include? "in_use"</pre></td>
|
625
|
+
</tr>
|
626
|
+
<tr class="marked">
|
627
|
+
<td><pre><a name="line193">193</a> if v2.downcase == "no"</pre></td>
|
628
|
+
</tr>
|
629
|
+
<tr class="marked">
|
630
|
+
<td><pre><a name="line194">194</a> str_key = k1</pre></td>
|
631
|
+
</tr>
|
632
|
+
<tr class="marked">
|
633
|
+
<td><pre><a name="line195">195</a> set_value("application/#{str_box_avail}/#{str_key}/in_use", "yes") # updates the key values to "yes"</pre></td>
|
634
|
+
</tr>
|
635
|
+
<tr class="marked">
|
636
|
+
<td><pre><a name="line196">196</a> change_execution_count("environment/parallel_execution_count", get_value("application/#{str_box_avail}/#{str_key}/in_use"))</pre></td>
|
637
|
+
</tr>
|
638
|
+
<tr class="marked">
|
639
|
+
<td><pre><a name="line197">197</a> break</pre></td>
|
640
|
+
</tr>
|
641
|
+
<tr class="inferred">
|
642
|
+
<td><pre><a name="line198">198</a> end</pre></td>
|
643
|
+
</tr>
|
644
|
+
<tr class="inferred">
|
645
|
+
<td><pre><a name="line199">199</a> end</pre></td>
|
646
|
+
</tr>
|
647
|
+
<tr class="uncovered">
|
648
|
+
<td><pre><a name="line200">200</a> break if str_key != ""</pre></td>
|
649
|
+
</tr>
|
650
|
+
<tr class="inferred">
|
651
|
+
<td><pre><a name="line201">201</a> end</pre></td>
|
652
|
+
</tr>
|
653
|
+
<tr class="inferred">
|
654
|
+
<td><pre><a name="line202">202</a> #break if str_key != ""</pre></td>
|
655
|
+
</tr>
|
656
|
+
<tr class="inferred">
|
657
|
+
<td><pre><a name="line203">203</a> end</pre></td>
|
658
|
+
</tr>
|
659
|
+
<tr class="marked">
|
660
|
+
<td><pre><a name="line204">204</a> break if str_key != ""</pre></td>
|
661
|
+
</tr>
|
662
|
+
<tr class="inferred">
|
663
|
+
<td><pre><a name="line205">205</a> end</pre></td>
|
664
|
+
</tr>
|
665
|
+
<tr class="marked">
|
666
|
+
<td><pre><a name="line206">206</a> break if str_key != ""</pre></td>
|
667
|
+
</tr>
|
668
|
+
<tr class="inferred">
|
669
|
+
<td><pre><a name="line207">207</a> end</pre></td>
|
670
|
+
</tr>
|
671
|
+
<tr class="marked">
|
672
|
+
<td><pre><a name="line208">208</a> break if str_key != ""</pre></td>
|
673
|
+
</tr>
|
674
|
+
<tr class="inferred">
|
675
|
+
<td><pre><a name="line209">209</a> end</pre></td>
|
676
|
+
</tr>
|
677
|
+
<tr class="marked">
|
678
|
+
<td><pre><a name="line210">210</a> raise "All the profiles (for Login credentials) are in use and hence stopping the execution for #{str_box}" if str_key == ""</pre></td>
|
679
|
+
</tr>
|
680
|
+
<tr class="marked">
|
681
|
+
<td><pre><a name="line211">211</a> $log.info("Currently using #{str_key} under #{str_box} profile under #{str_box_avail} box")</pre></td>
|
682
|
+
</tr>
|
683
|
+
<tr class="marked">
|
684
|
+
<td><pre><a name="line212">212</a> return str_box_avail, str_key</pre></td>
|
685
|
+
</tr>
|
686
|
+
<tr class="inferred">
|
687
|
+
<td><pre><a name="line213">213</a> rescue Exception => ex</pre></td>
|
688
|
+
</tr>
|
689
|
+
<tr class="uncovered">
|
690
|
+
<td><pre><a name="line214">214</a> $log.error("Error in getting free PROFILE config values : #{ex}")</pre></td>
|
691
|
+
</tr>
|
692
|
+
<tr class="uncovered">
|
693
|
+
<td><pre><a name="line215">215</a> exit</pre></td>
|
694
|
+
</tr>
|
695
|
+
<tr class="inferred">
|
696
|
+
<td><pre><a name="line216">216</a> end</pre></td>
|
697
|
+
</tr>
|
698
|
+
<tr class="inferred">
|
699
|
+
<td><pre><a name="line217">217</a> </pre></td>
|
700
|
+
</tr>
|
701
|
+
<tr class="inferred">
|
702
|
+
<td><pre><a name="line218">218</a> # Description : updates the parallel execution counter in config.yml file</pre></td>
|
703
|
+
</tr>
|
704
|
+
<tr class="inferred">
|
705
|
+
<td><pre><a name="line219">219</a> # Author : Gomathi</pre></td>
|
706
|
+
</tr>
|
707
|
+
<tr class="inferred">
|
708
|
+
<td><pre><a name="line220">220</a> # Arguments :</pre></td>
|
709
|
+
</tr>
|
710
|
+
<tr class="inferred">
|
711
|
+
<td><pre><a name="line221">221</a> # str_ypath : ypath of yml content</pre></td>
|
712
|
+
</tr>
|
713
|
+
<tr class="inferred">
|
714
|
+
<td><pre><a name="line222">222</a> # str_value : boolean value to update the counter</pre></td>
|
715
|
+
</tr>
|
716
|
+
<tr class="inferred">
|
717
|
+
<td><pre><a name="line223">223</a> #</pre></td>
|
718
|
+
</tr>
|
719
|
+
<tr class="marked">
|
720
|
+
<td><pre><a name="line224">224</a> def change_execution_count(str_ypath, str_value)</pre></td>
|
721
|
+
</tr>
|
722
|
+
<tr class="marked">
|
723
|
+
<td><pre><a name="line225">225</a> if str_value == "yes"</pre></td>
|
724
|
+
</tr>
|
725
|
+
<tr class="marked">
|
726
|
+
<td><pre><a name="line226">226</a> $parallel_execution_count += 1</pre></td>
|
727
|
+
</tr>
|
728
|
+
<tr class="inferred">
|
729
|
+
<td><pre><a name="line227">227</a> else</pre></td>
|
730
|
+
</tr>
|
731
|
+
<tr class="marked">
|
732
|
+
<td><pre><a name="line228">228</a> $parallel_execution_count -= 1</pre></td>
|
733
|
+
</tr>
|
734
|
+
<tr class="inferred">
|
735
|
+
<td><pre><a name="line229">229</a> end</pre></td>
|
736
|
+
</tr>
|
737
|
+
<tr class="marked">
|
738
|
+
<td><pre><a name="line230">230</a> set_value(str_ypath, $parallel_execution_count)</pre></td>
|
739
|
+
</tr>
|
740
|
+
<tr class="inferred">
|
741
|
+
<td><pre><a name="line231">231</a> end</pre></td>
|
742
|
+
</tr>
|
743
|
+
<tr class="inferred">
|
744
|
+
<td><pre><a name="line232">232</a> </pre></td>
|
745
|
+
</tr>
|
746
|
+
<tr class="inferred">
|
747
|
+
<td><pre><a name="line233">233</a> # Description : sets the value for the given ypath</pre></td>
|
748
|
+
</tr>
|
749
|
+
<tr class="inferred">
|
750
|
+
<td><pre><a name="line234">234</a> # Author : Chandra sekaran</pre></td>
|
751
|
+
</tr>
|
752
|
+
<tr class="inferred">
|
753
|
+
<td><pre><a name="line235">235</a> # Arguments :</pre></td>
|
754
|
+
</tr>
|
755
|
+
<tr class="inferred">
|
756
|
+
<td><pre><a name="line236">236</a> # str_ypath : ypath of yml content</pre></td>
|
757
|
+
</tr>
|
758
|
+
<tr class="inferred">
|
759
|
+
<td><pre><a name="line237">237</a> # Return value :</pre></td>
|
760
|
+
</tr>
|
761
|
+
<tr class="inferred">
|
762
|
+
<td><pre><a name="line238">238</a> # str_value : value to be set for ypath</pre></td>
|
763
|
+
</tr>
|
764
|
+
<tr class="inferred">
|
765
|
+
<td><pre><a name="line239">239</a> #</pre></td>
|
766
|
+
</tr>
|
767
|
+
<tr class="marked">
|
768
|
+
<td><pre><a name="line240">240</a> def set_value(str_ypath, str_value = "")</pre></td>
|
769
|
+
</tr>
|
770
|
+
<tr class="marked">
|
771
|
+
<td><pre><a name="line241">241</a> raise "Exception : ReadFromYML - ypath cannot be empty" if str_ypath.nil?</pre></td>
|
772
|
+
</tr>
|
773
|
+
<tr class="inferred">
|
774
|
+
<td><pre><a name="line242">242</a> </pre></td>
|
775
|
+
</tr>
|
776
|
+
<tr class="marked">
|
777
|
+
<td><pre><a name="line243">243</a> @yml = open_yml_file(@yml_file_path)</pre></td>
|
778
|
+
</tr>
|
779
|
+
<tr class="inferred">
|
780
|
+
<td><pre><a name="line244">244</a> </pre></td>
|
781
|
+
</tr>
|
782
|
+
<tr class="marked">
|
783
|
+
<td><pre><a name="line245">245</a> arr_key = str_ypath.split('/')</pre></td>
|
784
|
+
</tr>
|
785
|
+
<tr class="marked">
|
786
|
+
<td><pre><a name="line246">246</a> num_level = arr_key.size</pre></td>
|
787
|
+
</tr>
|
788
|
+
<tr class="inferred">
|
789
|
+
<td><pre><a name="line247">247</a> </pre></td>
|
790
|
+
</tr>
|
791
|
+
<tr class="marked">
|
792
|
+
<td><pre><a name="line248">248</a> case num_level</pre></td>
|
793
|
+
</tr>
|
794
|
+
<tr class="inferred">
|
795
|
+
<td><pre><a name="line249">249</a> when 1</pre></td>
|
796
|
+
</tr>
|
797
|
+
<tr class="uncovered">
|
798
|
+
<td><pre><a name="line250">250</a> @yml[arr_key[0]] = str_value</pre></td>
|
799
|
+
</tr>
|
800
|
+
<tr class="inferred">
|
801
|
+
<td><pre><a name="line251">251</a> when 2</pre></td>
|
802
|
+
</tr>
|
803
|
+
<tr class="marked">
|
804
|
+
<td><pre><a name="line252">252</a> @yml[arr_key[0]][arr_key[1]] = str_value</pre></td>
|
805
|
+
</tr>
|
806
|
+
<tr class="inferred">
|
807
|
+
<td><pre><a name="line253">253</a> when 3</pre></td>
|
808
|
+
</tr>
|
809
|
+
<tr class="uncovered">
|
810
|
+
<td><pre><a name="line254">254</a> @yml[arr_key[0]][arr_key[1]][arr_key[2]] = str_value</pre></td>
|
811
|
+
</tr>
|
812
|
+
<tr class="inferred">
|
813
|
+
<td><pre><a name="line255">255</a> when 4</pre></td>
|
814
|
+
</tr>
|
815
|
+
<tr class="marked">
|
816
|
+
<td><pre><a name="line256">256</a> @yml[arr_key[0]][arr_key[1]][arr_key[2]][arr_key[3]] = str_value</pre></td>
|
817
|
+
</tr>
|
818
|
+
<tr class="inferred">
|
819
|
+
<td><pre><a name="line257">257</a> when 5</pre></td>
|
820
|
+
</tr>
|
821
|
+
<tr class="uncovered">
|
822
|
+
<td><pre><a name="line258">258</a> @yml[arr_key[0]][arr_key[1]][arr_key[2]][arr_key[3]][arr_key[4]] = str_value</pre></td>
|
823
|
+
</tr>
|
824
|
+
<tr class="inferred">
|
825
|
+
<td><pre><a name="line259">259</a> when 6</pre></td>
|
826
|
+
</tr>
|
827
|
+
<tr class="uncovered">
|
828
|
+
<td><pre><a name="line260">260</a> @yml[arr_key[0]][arr_key[1]][arr_key[2]][arr_key[3]][arr_key[4]][arr_key[5]] = str_value</pre></td>
|
829
|
+
</tr>
|
830
|
+
<tr class="inferred">
|
831
|
+
<td><pre><a name="line261">261</a> when 7</pre></td>
|
832
|
+
</tr>
|
833
|
+
<tr class="uncovered">
|
834
|
+
<td><pre><a name="line262">262</a> @yml[arr_key[0]][arr_key[1]][arr_key[2]][arr_key[3]][arr_key[4]][arr_key[5]][arr_key[6]] = str_value</pre></td>
|
835
|
+
</tr>
|
836
|
+
<tr class="inferred">
|
837
|
+
<td><pre><a name="line263">263</a> else</pre></td>
|
838
|
+
</tr>
|
839
|
+
<tr class="uncovered">
|
840
|
+
<td><pre><a name="line264">264</a> raise "Given YML path cannot be traversed"</pre></td>
|
841
|
+
</tr>
|
842
|
+
<tr class="inferred">
|
843
|
+
<td><pre><a name="line265">265</a> end</pre></td>
|
844
|
+
</tr>
|
845
|
+
<tr class="marked">
|
846
|
+
<td><pre><a name="line266">266</a> File.open(@yml_file_path, 'w') { |h| h.write @yml.to_yaml } # updates the yml file content with the updated hash</pre></td>
|
847
|
+
</tr>
|
848
|
+
<tr class="marked">
|
849
|
+
<td><pre><a name="line267">267</a> @yml = open_yml_file(@yml_file_path)</pre></td>
|
850
|
+
</tr>
|
851
|
+
<tr class="inferred">
|
852
|
+
<td><pre><a name="line268">268</a> rescue Exception => ex</pre></td>
|
853
|
+
</tr>
|
854
|
+
<tr class="uncovered">
|
855
|
+
<td><pre><a name="line269">269</a> $log.error("Error in setting value for ypath '#{str_ypath}' : #{ex}")</pre></td>
|
856
|
+
</tr>
|
857
|
+
<tr class="uncovered">
|
858
|
+
<td><pre><a name="line270">270</a> exit</pre></td>
|
859
|
+
</tr>
|
860
|
+
<tr class="inferred">
|
861
|
+
<td><pre><a name="line271">271</a> end</pre></td>
|
862
|
+
</tr>
|
863
|
+
<tr class="inferred">
|
864
|
+
<td><pre><a name="line272">272</a> </pre></td>
|
865
|
+
</tr>
|
866
|
+
<tr class="inferred">
|
867
|
+
<td><pre><a name="line273">273</a> # Description : resets all the unused profiles</pre></td>
|
868
|
+
</tr>
|
869
|
+
<tr class="inferred">
|
870
|
+
<td><pre><a name="line274">274</a> # Author : Chandra sekaran</pre></td>
|
871
|
+
</tr>
|
872
|
+
<tr class="inferred">
|
873
|
+
<td><pre><a name="line275">275</a> #</pre></td>
|
874
|
+
</tr>
|
875
|
+
<tr class="marked">
|
876
|
+
<td><pre><a name="line276">276</a> def release_all_profiles</pre></td>
|
877
|
+
</tr>
|
878
|
+
<tr class="uncovered">
|
879
|
+
<td><pre><a name="line277">277</a> @yml.each do |key, value|</pre></td>
|
880
|
+
</tr>
|
881
|
+
<tr class="uncovered">
|
882
|
+
<td><pre><a name="line278">278</a> if key.downcase == "application"</pre></td>
|
883
|
+
</tr>
|
884
|
+
<tr class="uncovered">
|
885
|
+
<td><pre><a name="line279">279</a> value.each do |k, v|</pre></td>
|
886
|
+
</tr>
|
887
|
+
<tr class="uncovered">
|
888
|
+
<td><pre><a name="line280">280</a> v.each do |k1, v1|</pre></td>
|
889
|
+
</tr>
|
890
|
+
<tr class="uncovered">
|
891
|
+
<td><pre><a name="line281">281</a> v1.each do |k2, v2|</pre></td>
|
892
|
+
</tr>
|
893
|
+
<tr class="uncovered">
|
894
|
+
<td><pre><a name="line282">282</a> if k2.downcase.include? "in_use"</pre></td>
|
895
|
+
</tr>
|
896
|
+
<tr class="uncovered">
|
897
|
+
<td><pre><a name="line283">283</a> set_value("#{key}/#{k}/#{k1}/#{k2}", "no") if v2.downcase == "yes" # set "no" to in_use key for all profiles</pre></td>
|
898
|
+
</tr>
|
899
|
+
<tr class="inferred">
|
900
|
+
<td><pre><a name="line284">284</a> end</pre></td>
|
901
|
+
</tr>
|
902
|
+
<tr class="inferred">
|
903
|
+
<td><pre><a name="line285">285</a> end</pre></td>
|
904
|
+
</tr>
|
905
|
+
<tr class="inferred">
|
906
|
+
<td><pre><a name="line286">286</a> end</pre></td>
|
907
|
+
</tr>
|
908
|
+
<tr class="inferred">
|
909
|
+
<td><pre><a name="line287">287</a> end</pre></td>
|
910
|
+
</tr>
|
911
|
+
<tr class="inferred">
|
912
|
+
<td><pre><a name="line288">288</a> end</pre></td>
|
913
|
+
</tr>
|
914
|
+
<tr class="inferred">
|
915
|
+
<td><pre><a name="line289">289</a> end</pre></td>
|
916
|
+
</tr>
|
917
|
+
<tr class="inferred">
|
918
|
+
<td><pre><a name="line290">290</a> rescue Exception => ex</pre></td>
|
919
|
+
</tr>
|
920
|
+
<tr class="uncovered">
|
921
|
+
<td><pre><a name="line291">291</a> $log.error("Error in releasing all profiles : #{ex}")</pre></td>
|
922
|
+
</tr>
|
923
|
+
<tr class="uncovered">
|
924
|
+
<td><pre><a name="line292">292</a> exit</pre></td>
|
925
|
+
</tr>
|
926
|
+
<tr class="inferred">
|
927
|
+
<td><pre><a name="line293">293</a> end</pre></td>
|
928
|
+
</tr>
|
929
|
+
<tr class="inferred">
|
930
|
+
<td><pre><a name="line294">294</a> </pre></td>
|
931
|
+
</tr>
|
932
|
+
<tr class="inferred">
|
933
|
+
<td><pre><a name="line295">295</a> end</pre></td>
|
934
|
+
</tr>
|
935
|
+
<tr class="inferred">
|
936
|
+
<td><pre><a name="line296">296</a> end</pre></td>
|
937
|
+
</tr>
|
938
|
+
</tbody>
|
939
|
+
</table>
|
940
|
+
|
941
|
+
<p>Generated on 2015-05-08 10:40:30 +0530 with <a href="https://github.com/fguillen/simplecov-rcov">SimpleCov-RCov 0.2.3</a></p>
|
942
|
+
|
943
|
+
</body>
|
944
|
+
</html>
|