cuke_sniffer 0.0.8 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,23 @@
1
+ <div class="row">
2
+ <div class="panel panel-default">
3
+ <div class="panel-heading panel-title" data-toggle="collapse" data-target="#deadSteps" >
4
+ Dead Steps <span class="glyphicon glyphicon-menu-down"></span>
5
+ </div>
6
+ <div id="deadSteps" class="panel-body collapse">
7
+ <div>
8
+ <% dead_steps = cuke_sniffer.get_dead_steps %>
9
+ <% dead_steps.delete(:total) %>
10
+ <% dead_step_count = dead_steps.values.flatten.count %>
11
+ <% if !cuke_sniffer.cataloged? %>
12
+ <div class="notes">Steps were not cataloged.</div>
13
+ <% elsif dead_step_count == 0 %>
14
+ <div class="notes">No dead steps found!</div>
15
+ <% elsif dead_step_count == 1 %>
16
+ <div class="notes"><%= dead_step_count %> Dead Step found.</div>
17
+ <% else %>
18
+ <div class="notes"><%= dead_step_count %> Dead Steps found.</div>
19
+ <% end %>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </div>
@@ -0,0 +1,8 @@
1
+ <div class="btn-group">
2
+ <div class="btn btn-default" collapse>
3
+ Collapse All
4
+ </div>
5
+ <div class="btn btn-default" expand>
6
+ Expand All
7
+ </div>
8
+ </div>
@@ -1,114 +1,132 @@
1
- <div class="title" onclick="toggleById('features_data', this);updateDisplayStatus(document.getElementById('feature_function_bar'));updateDivScroll('features_data', 'features_table');">
2
- Features +
3
- </div>
1
+ <div class="row">
2
+ <div class="panel panel-default">
3
+ <div class="panel-heading panel-title" data-toggle="collapse" data-target="#features" >
4
+ Features <span class="glyphicon glyphicon-menu-down"></span>
5
+ </div>
6
+ <div id="features" class="panel-body collapse">
7
+ <span class="button-bar">
8
+ <%= build_page(cuke_sniffer, "expand_and_collapse_buttons.html.erb") %>
9
+ </span>
10
+ <% if cuke_sniffer.features.count == 0 %>
11
+ <div>
12
+ <div>There were no Features to sniff in '<%= cuke_sniffer.features_location %>'!</div>
13
+ </div>
14
+ <% elsif cuke_sniffer.features.count >= 1 && cuke_sniffer.scenarios.count >=1 && cuke_sniffer.summary[:features][:total_score] ==0 && cuke_sniffer.summary[:scenarios][:total_score] ==0 %>
15
+ <div>
16
+ <div>Excellent! No smells found for Features and Scenarios!</div>
17
+ </div>
18
+ <% end %>
19
+ <% cuke_sniffer.features.each do |feature| %>
20
+ <% next if feature.total_score == 0 %>
21
+ <div class="feature">
22
+ <div class="row">
23
+ <div class="col-md-12 title">
24
+ <div class="col-md-1 red" title="Total Score from this Feature.">
25
+ <%= feature.total_score %>
26
+ </div>
27
+ <div class="col-md-11">
28
+ <% if feature.name.to_s.empty? %>
29
+ No Feature Description
30
+ <% else %>
31
+ <%= feature.name %>
32
+ <% end %>
33
+ </div>
34
+ </div>
35
+ <div class="details col-md-12" style="display:none;">
36
+ <div class="well">
37
+ <div class="row">
38
+ <div class="col-md-12 filename">
39
+ File: <a target="_blank" href="file:///<%= feature.location.gsub(/:\d+$/, "") %>" title="Note: Links to file on system this report was generated.">
40
+ <%= feature.location.gsub(cuke_sniffer.features_location, '') %>
41
+ </a>
42
+ </div>
43
+ </div>
4
44
 
5
- <div id="feature_function_bar" class="function_bar">
6
- <input type="button" class="function_button" value="Collapse All" onclick="collapseAll('feature_detail')" />
7
- <input type="button" class="function_button" value="Expand All" onclick="expandAllShiftingRows('feature_detail')" />
8
- </div>
9
-
10
- <div class="new_sub_section" id="features_data">
11
- <% if cuke_sniffer.features.count == 0 %>
12
- <div class="empty_set_message">There were no Features to sniff in '<%= cuke_sniffer.features_location %>'!</div>
13
- <% elsif cuke_sniffer.features.count >= 1 && cuke_sniffer.scenarios.count >=1 && cuke_sniffer.summary[:features][:total_score] ==0 && cuke_sniffer.summary[:scenarios][:total_score] ==0 %>
14
- <div class="empty_set_message">Excellent! No smells found for Features and Scenarios!</div>
15
- <% end %>
16
-
17
- <table id="features_table" border="0" cellspacing="0" style="width:100%;padding-left: 2px">
18
- <% index = 0 %>
19
- <% cuke_sniffer.features.each do |feature| %>
20
- <% next if feature.total_score == 0 %>
21
- <% if index.odd? %>
22
- <tr class="notes blue_title_row" style="cursor: hand;" onclick="updateDisplayStatus(document.getElementById('feature_detail_<%=index%>'));updateDivScroll('features_data', 'features_table');">
23
- <% else %>
24
- <tr class="notes white_title_row" style="cursor: hand;" onclick="updateDisplayStatus(document.getElementById('feature_detail_<%=index%>'));updateDivScroll('features_data', 'features_table');">
25
- <% end %>
26
- <td valign="top" class="red_number" style="width:1%">
27
- <%= feature.total_score %>
28
- </td>
29
- <td style="padding-left: 2px; width:100%;">
30
- <% if feature.name.to_s.empty? %>
31
- No Feature Description
32
- <% else %>
33
- <%= feature.name %>
34
- <% end %>
35
- </td>
36
- </tr>
37
- <% if index.odd? %>
38
- <tr id="feature_detail_<%= index %>" class="blue_row feature_detail" style="display:none;">
39
- <% else %>
40
- <tr id="feature_detail_<%= index %>" class="white_row feature_detail" style="display:none;">
41
- <% end %>
42
-
43
- <td colspan="2">
44
- <table border="0" cellspacing="0" class="colored_subsection">
45
- <tr>
46
- <td>
47
- <% SummaryHelper::sort_improvement_list(feature.rules_hash).each do |phrase, count| %>
48
- <div>
49
- <div style="color:red; display:inline-block;">
50
- <%= count %>
45
+ <div class="row featureProblems">
46
+ <div class="col-md-12">
47
+ <h4>
48
+ Feature:
49
+ <span class="red" title="Points earned from just the feature. This updates based on what rules
50
+ are active." data-total-feature-score="<%=feature.score %>">
51
+ <%= feature.score %>
52
+ </span>
53
+ </h4>
54
+ </div>
55
+ <% SummaryHelper::sort_improvement_list(feature.rules_hash).each do |phrase, count| %>
56
+ <div data-improvement-row>
57
+ <div class="col-md-1 red" data-score>
58
+ <%= count %>
59
+ </div>
60
+ <div class="col-md-11" data-improvement="<%=phrase %>">
61
+ <%= phrase %>
62
+ </div>
51
63
  </div>
52
- <div style="display:inline-block;">
53
- <%= phrase %>
64
+ <% end %>
65
+ </div>
66
+
67
+ <div class="row backgroundProblems">
68
+ <% unless feature.background.nil? %>
69
+ <div class="col-md-12">
70
+ <h4>
71
+ Background:
72
+ <span class="red" title="Points earned from just the background. This updates based on what
73
+ rules are active." data-total-feature-score="<%=feature.background.score %>">
74
+ <%= feature.background.score %>
75
+ </span>
76
+ </h4>
54
77
  </div>
55
- </div>
56
- <% end %>
57
- </td>
58
- <td style="text-align: right;">
59
- <a href="file:///<%= feature.location.gsub(/:\d+$/, "") %>" title="Note: Links to file on system this report was generated.">
60
- <%= feature.location.gsub(cuke_sniffer.features_location, '') %>
61
- </a>
62
- </td>
63
- </tr>
64
- <% unless feature.background.nil? %>
65
- <tr>
66
- <td valign="top" style="border-top: 2px solid #509f50">
67
- <div style="display:inline;" class="red_number"><%= feature.background.score %></div>
68
- <div style="display:inline; padding-left: 2px; width:100%;"><%= feature.background.type %>
69
- : <%= feature.background.name %></div>
70
- </td>
71
- <td valign="top" style="padding-left:2px;border-top: 2px solid #509f50;">
72
- <% SummaryHelper::sort_improvement_list(feature.background.rules_hash).each do |phrase, count| %>
73
- <div>
74
- <div style="color:red; display:inline-block;">
75
- <%= count %>
78
+ <% SummaryHelper::sort_improvement_list(feature.background.rules_hash).each do |phrase, count| %>
79
+ <div data-improvement-row>
80
+ <div class="col-md-1 red" data-score>
81
+ <%= count %>
82
+ </div>
83
+ <div class="col-md-11" data-improvement="<%=phrase %>">
84
+ <%= phrase %>
85
+ </div>
76
86
  </div>
77
- <div style="display:inline-block; padding-left:2px;">
78
- <%= phrase %>
87
+ <% end %>
88
+ <% end %>
89
+ </div>
90
+ <div class="row scenarios">
91
+ <div class="col-md-12">
92
+ <h4>Scenarios:
93
+ <span class="red" title="Total Points earned from all the scenarios in this feature. This updates
94
+ based on what rules are active." data-total-scenarios-score="<%=feature.scenarios_score%>">
95
+ <%= feature.scenarios_score %>
96
+ </span>
97
+ </h4>
98
+ </div>
99
+ <div class="col-md-12 scenarios">
100
+ <% feature.scenarios.each do |scenario| %>
101
+ <% next if scenario.score == 0 %>
102
+ <div class="col-md-12 scenario">
103
+ <div class="col-md-12 title">
104
+ <div class="btn btn-xs btn-default" style="display:none;"> <!--TODO enable this feature -->
105
+ View <span class="glyphicon glyphicon-eye-open"></span>
79
106
  </div>
107
+ <%= scenario.type %>: <%=scenario.name %>
80
108
  </div>
81
- <% end %>
82
- </td>
83
- </tr>
84
- <% end %>
85
- <% feature.scenarios.each do |scenario| %>
86
- <% next if scenario.score == 0 %>
87
- <tr>
88
- <td valign="top" style="border-top: 2px solid #509f50">
89
- <div style="display:inline;" class="red_number"><%= scenario.score %></div>
90
- <div style="display:inline; padding-left: 2px; width:100%;"><%= scenario.type %>
91
- : <%= scenario.name %></div>
92
- </td>
93
- <td valign="top" style="padding-left:2px;border-top: 2px solid #509f50">
94
- <% SummaryHelper::sort_improvement_list(scenario.rules_hash).each do |phrase, count| %>
95
- <div>
96
- <div style="color:red; display:inline-block;">
97
- <%= count %>
98
- </div>
99
- <div style="display:inline-block;">
100
- <%= phrase %>
101
- </div>
109
+ <div class="col-md-12 details well">
110
+ <% SummaryHelper::sort_improvement_list(scenario.rules_hash).each do |phrase, count| %>
111
+ <div class="row" data-improvement-row>
112
+ <div class="col-md-1 red" data-score>
113
+ <%= count %>
114
+ </div>
115
+ <div class="col-md-11" data-improvement="<%=phrase %>">
116
+ <%= phrase %>
117
+ </div>
118
+ </div>
119
+ <% end %>
102
120
  </div>
121
+ </div>
103
122
  <% end %>
104
- </td>
105
- </tr>
106
- <% end %>
107
- </table>
108
- </td>
109
- </tr>
110
- <% index += 1 %>
111
- <% end %>
112
- </table>
113
- </div>
114
- <br style="clear:both">
123
+ </div>
124
+ </div>
125
+ </div>
126
+ </div>
127
+ </div>
128
+ </div>
129
+ <% end %>
130
+ </div>
131
+ </div>
132
+ </div>
@@ -1,79 +1,79 @@
1
- <div class="title" onclick="toggleById('hooks_data', this);updateDisplayStatus(document.getElementById('hooks_function_bar'));updateDivScroll('hooks_data', 'hooks_table');">
2
- Hooks +
3
- </div>
4
-
5
- <div id="hooks_function_bar" class="function_bar">
6
- <input type="button" class="function_button" value="Collapse All" onclick="collapseAll('hook_detail')" />
7
- <input type="button" class="function_button" value="Expand All" onclick="expandAllShiftingRows('hook_detail')" />
8
- </div>
9
-
10
- <div class="new_sub_section" id="hooks_data">
11
- <% if cuke_sniffer.hooks.count == 0 %>
12
- <div class="empty_set_message">There were no Hooks to sniff in '<%= cuke_sniffer.hooks_location %>'!</div>
13
- <% elsif cuke_sniffer.hooks.count >= 1 && cuke_sniffer.summary[:hooks][:total_score] ==0 %>
14
- <div class="empty_set_message">Excellent! No smells found for Hooks!</div>
15
- <% end %>
16
- <table id="hooks_table" style="width:100%;" border="0" cellspacing="0">
17
- <% index = 0 %>
18
- <% cuke_sniffer.hooks.each do |hook| %>
19
- <% next if hook.score <= 0 %>
20
- <% if index.odd? %>
21
- <tr class="notes blue_title_row" onclick="updateDisplayStatus(document.getElementById('hook_detail_<%=index%>'));updateDivScroll('hooks_data', 'hooks_table');">
22
- <% else %>
23
- <tr class="notes white_title_row" onclick="updateDisplayStatus(document.getElementById('hook_detail_<%=index%>'));updateDivScroll('hooks_data', 'hooks_table');">
24
- <% end %>
25
- <td id="hook_score_<%= index %>" valign="top" style="width:1%; color: red">
26
- <%= hook.score %>
27
- </td>
28
- <td id="hook_name_<%= index %>" style="text-indent: 2px;">
29
- <% tags = "(" %>
30
- <% hook.tags.each do |tag| %>
31
- <% tags << tag %>
32
- <% tags << ", " unless tag == hook.tags.last %>
33
- <% end %>
34
- <% tags += ")" %>
35
- <% parameters = "| " %>
36
- <% hook.parameters.each do |parameter| %>
37
- <% parameters << parameter %>
38
- <% parameters << ", " unless parameter == hook.parameters.last %>
39
- <% end %>
40
- <% parameters += " |" %>
41
- <% name = hook.type %>
42
- <% name += tags unless tags == "()" %>
43
- <% name += " do " %>
44
- <% name += parameters unless parameters == "| |" %>
45
- <%= name %>
46
- </td>
47
- </td>
48
- </tr>
49
-
50
- <% if index.odd? %>
51
- <tr id="hook_detail_<%= index %>" class="blue_row hook_detail" style="display: none;">
52
- <% else %>
53
- <tr id="hook_detail_<%= index %>" class="white_row hook_detail" style="display: none;">
54
- <% end %>
55
-
56
- <td colspan="2">
57
- <% SummaryHelper::sort_improvement_list(hook.rules_hash).each do |phrase, count| %>
58
- <div style="text-indent: 10px;">
59
- <div style="color:red; display:inline-block;">
60
- <%= count %>
1
+ <div class="row">
2
+ <div class="panel panel-default">
3
+ <div class="panel-heading panel-title" data-toggle="collapse" data-target="#hooks" >
4
+ Hooks <span class="glyphicon glyphicon-menu-down"></span>
5
+ </div>
6
+ <div id="hooks" class="panel-body collapse">
7
+ <span class="button-bar">
8
+ <%= build_page(cuke_sniffer, "expand_and_collapse_buttons.html.erb") %>
9
+ </span>
10
+ <% if cuke_sniffer.hooks.count == 0 %>
11
+ <div>
12
+ <div>There were no Hooks to sniff in '<%= cuke_sniffer.hooks_location %>'!</div>
13
+ </div>
14
+ <% elsif cuke_sniffer.hooks.count >= 1 && cuke_sniffer.summary[:hooks][:total_score] ==0 %>
15
+ <div>
16
+ <div>Excellent! No smells found for Hooks!</div>
17
+ </div>
18
+ <% else %>
19
+ <% cuke_sniffer.hooks.each do |hook| %>
20
+ <% next if hook.score <= 0 %>
21
+ <div class="hook">
22
+ <div class="row">
23
+ <div class="title col-md-12">
24
+ <div class="col-md-1">
25
+ <span class="red" title="Total score for Hook file.">
26
+ <%= hook.score %>
27
+ </span>
28
+ </div>
29
+ <div class="col-md-11">
30
+ <% tags = "(" %>
31
+ <% hook.tags.each do |tag| %>
32
+ <% tags << tag %>
33
+ <% tags << ", " unless tag == hook.tags.last %>
34
+ <% end %>
35
+ <% tags += ")" %>
36
+ <% parameters = "| " %>
37
+ <% hook.parameters.each do |parameter| %>
38
+ <% parameters << parameter %>
39
+ <% parameters << ", " unless parameter == hook.parameters.last %>
40
+ <% end %>
41
+ <% parameters += " |" %>
42
+ <% name = hook.type %>
43
+ <% name += tags unless tags == "()" %>
44
+ <% name += " do " %>
45
+ <% name += parameters unless parameters == "| |" %>
46
+ <%= name %>
47
+ </div>
61
48
  </div>
62
- <div style="display:inline-block;">
63
- <%= phrase %>
49
+ <div class="details col-md-12" style="display:none;">
50
+ <div class="well">
51
+ <div class="row">
52
+ <div class="col-md-12 filename">
53
+ File:
54
+ <a target="_blank" href="file:///<%= hook.location.gsub(/:\d+$/, "") %>" title="Note: Links to file on system this report was generated.">
55
+ <%= hook.location.gsub(cuke_sniffer.hooks_location, '') %>
56
+ </a>
57
+ </div>
58
+ <div class="well col-md-12">
59
+ <% SummaryHelper::sort_improvement_list(hook.rules_hash).each do |phrase, count| %>
60
+ <div class="row" data-improvement-row>
61
+ <div class="col-md-1 red" data-score>
62
+ <%= count %>
63
+ </div>
64
+ <div class="col-md-11" data-improvement="<%=phrase %>">
65
+ <%= phrase %>
66
+ </div>
67
+ </div>
68
+ <% end %>
69
+ </div>
70
+ </div>
71
+ </div>
64
72
  </div>
65
73
  </div>
66
- <% end %>
67
- </td>
68
- <td valign="top" style="text-align: right">
69
- <a href="file:///<%= hook.location.gsub(/:\d+$/, "") %>" title="Note: Links to file on system this report was generated.">
70
- <%= hook.location.gsub(cuke_sniffer.hooks_location, '') %>
71
- </a>
72
- </td>
73
- </tr>
74
-
75
- <% index += 1 %>
76
- <% end %>
77
- </table>
78
- </div>
79
- <br style="clear:both">
74
+ </div>
75
+ <% end %>
76
+ <% end %>
77
+ </div>
78
+ </div>
79
+ </div>
@@ -1,24 +1,34 @@
1
- <div class="title" onclick="toggleById('improvement_list_data', this) ;updateDivScroll('improvement_list_data', 'improvements_table');">
2
- Improvement List +
3
- </div>
4
- <div class="new_sub_section" id="improvement_list_data">
5
- <% improvement_list = cuke_sniffer.summary[:improvement_list] %>
6
- <% if improvement_list.empty? %>
7
- <div class="empty_set_message">No Improvements to make!</div>
8
- <% end %>
9
- <table id="improvements_table" style="width: 100%" border="0" cellspacing="0">
10
- <% index = 0 %>
11
- <% improvement_list.each do |improvement, count| %>
12
- <% if index.odd? %>
13
- <tr class="blue_row">
14
- <% else %>
15
- <tr>
16
- <% end %>
17
- <td class="red_number" style="width:1%;"><%= count %></td>
18
- <td class="notes" style="padding-left: 2px;"><%= improvement %></td>
19
- </tr>
20
- <% index += 1 %>
21
- <% end %>
22
- </table>
23
- </div>
24
- <br style="clear:both">
1
+ <div class="row">
2
+ <div class="panel panel-default">
3
+ <div class="panel-heading panel-title" data-toggle="collapse" data-target="#improvement_list_data">
4
+ Improvement List <span class="glyphicon glyphicon-menu-down"></span>
5
+ </div>
6
+ <% improvement_list = cuke_sniffer.summary[:improvement_list] %>
7
+
8
+ <div id="improvement_list_data" class="panel-body collapse">
9
+ <% if improvement_list.empty? %>
10
+ <div>
11
+ <div>
12
+ No Improvements to make!
13
+ </div>
14
+ </div>
15
+ <% end %>
16
+ <div>
17
+ <% improvement_list.each do |improvement, count| %>
18
+ <div class="improvement" data-improvement="<%=improvement%>">
19
+ <div class="row">
20
+ <div class="col-md-12 title">
21
+ <div class="col-md-1 red">
22
+ <%= count %>
23
+ </div>
24
+ <div class="col-md-11">
25
+ <%= improvement %>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ <% end %>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </div>