cucumber_monitor 0.0.2 → 0.0.3

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.
@@ -11,7 +11,9 @@ class CucumberMonitorController < ApplicationController
11
11
  end
12
12
 
13
13
  def search
14
- @search_results = CucumberMonitor.new.search(params[:criteria])
14
+ features = CucumberMonitor.new.features.where(name: params[:criteria])
15
+ @features_search_results = features.kind_of?(Array) ? features : [features]
16
+ @steps_search_results = CucumberMonitor.new.search(params[:criteria])
15
17
  end
16
18
 
17
19
  end
@@ -1,4 +1,4 @@
1
1
  <%= form_tag search_cucumber_monitor_path, method: :get do %>
2
- <%= text_field_tag :criteria %>
3
- <%= submit_tag "Buscar" %>
2
+ <%= text_field_tag :criteria, params[:criteria] %>
3
+ <%= submit_tag t("buttons.search") %>
4
4
  <% end %>
@@ -1,7 +1,7 @@
1
- <h1>Features Cucumber</h1>
1
+ <h1><%= t(".title") %></h1>
2
2
 
3
3
  <p>
4
- Você tem <%= @features.size %> features do Cucumber.
4
+ <%= t(".total_features_note", total: @features.size) %>
5
5
  </p>
6
6
 
7
7
  <%= render 'search_form' %>
@@ -9,9 +9,9 @@ Você tem <%= @features.size %> features do Cucumber.
9
9
  <table class='table table-bordered table-striped'>
10
10
  <tr>
11
11
  <th class="col3">#</th>
12
- <th>Nome</th>
13
- <th>Descrição</th>
14
- <th class="col25">Arquivo</th>
12
+ <th><%= t(".table.th.name") %></th>
13
+ <th><%= t(".table.th.description") %></th>
14
+ <th class="col25"><%= t(".table.th.file") %></th>
15
15
  </tr>
16
16
  <% @features.each_with_index do |feature, i|%>
17
17
  <tr class="<%= cycle('even','odd') %>">
@@ -1,22 +1,41 @@
1
- <h1>Busca</h1>
1
+ <h1><%= t(".title") %></h1>
2
2
 
3
3
  <%= render 'search_form' %>
4
4
 
5
5
  <p>
6
- <%= link_to "Voltar para features", features_cucumber_monitor_path %>
6
+ <%= link_to t("links.back_to_features_link"), features_cucumber_monitor_path %>
7
7
  </p>
8
8
 
9
9
  <div class="feature_container">
10
- <h4>Resultados da busca</h4>
10
+ <h4><%= t(".features_search_results") %></h4>
11
11
  <div class="steps">
12
- <% @search_results.each do |step| %>
13
- <strong><%= step.description %></strong><br />
14
- <em>(Step: <%= step.description %>. Escopo: <%= step.parent.name %>. Feature: <%= link_to step.parent.feature.file, show_feature_cucumber_monitor_path(step.parent.feature.name) %>)</em>
15
- <hr />
12
+ <% if @features_search_results.any? %>
13
+ <% @features_search_results.each do |feature| %>
14
+ <strong><%= feature.description %></strong><br />
15
+ <em>(<%= feature.name %>. <%= feature.description %>. <%= t(".file") %>: <%= link_to feature.file, show_feature_cucumber_monitor_path(feature.name) %>)</em>
16
+ <hr />
17
+ <% end %>
18
+ <% else %>
19
+ <%= t(".results_not_found_for", criteria: params[:criteria]).html_safe %>
20
+ <% end %>
21
+ </div>
22
+ </div>
23
+
24
+ <div class="feature_container">
25
+ <h4><%= t(".steps_search_results") %></h4>
26
+ <div class="steps">
27
+ <% if @steps_search_results.any? %>
28
+ <% @steps_search_results.each do |step| %>
29
+ <strong><%= step.description %></strong><br />
30
+ <em>(<%= "#{t(".scope")}: #{step.parent.name}" %>. <%= t(".file") %>: <%= link_to step.parent.feature.file, show_feature_cucumber_monitor_path(step.parent.feature.name) %>)</em>
31
+ <hr />
32
+ <% end %>
33
+ <% else %>
34
+ <%= t(".results_not_found_for", criteria: params[:criteria]).html_safe %>
16
35
  <% end %>
17
36
  </div>
18
37
  </div>
19
38
 
20
39
  <p>
21
- <%= link_to "Voltar para features", features_cucumber_monitor_path %>
40
+ <%= link_to t("links.back_to_features_link"), features_cucumber_monitor_path %>
22
41
  </p>
@@ -1,17 +1,17 @@
1
1
  <%= stylesheet_link_tag 'cucumber_monitor' %>
2
2
 
3
- <h1>Feature: <%= @feature.name %></h1>
3
+ <h1><%= "#{t(".feature")} #{@feature.name}" %></h1>
4
4
 
5
5
  <h3><%= @feature.description %></h3>
6
6
 
7
7
  <p>
8
- <%= link_to "Voltar para features", features_cucumber_monitor_path %>
8
+ <%= link_to t("links.back_to_features_link"), features_cucumber_monitor_path %>
9
9
  </p>
10
10
 
11
11
  <% if @feature.contexts.any? %>
12
12
  <div class="feature_container context">
13
13
  <% @feature.contexts.each do |context|%>
14
- <h4>Contexto</h4>
14
+ <h4><%= t(".background") %></h4>
15
15
  <div class="steps">
16
16
  <% context.steps.each do |step| %>
17
17
  <%= step.formatted.html_safe %>
@@ -26,7 +26,7 @@
26
26
 
27
27
  <div class="feature_container">
28
28
  <% @feature.scenarios.each_with_index do |scenario, i|%>
29
- <h4>Cenário: <%= scenario.name %></h4>
29
+ <h4><%= "#{t(".scenario")} #{scenario.name}" %></h4>
30
30
  <div class="steps">
31
31
  <% scenario.steps.each do |step| %>
32
32
  <%= step.formatted.html_safe %>
@@ -38,4 +38,4 @@
38
38
  <% end %>
39
39
  </div>
40
40
 
41
- <%= link_to "Voltar para features", features_cucumber_monitor_path %>
41
+ <%= link_to t("links.back_to_features_link"), features_cucumber_monitor_path %>
@@ -0,0 +1,53 @@
1
+ "pt-BR":
2
+ buttons:
3
+ search: Buscar
4
+ links:
5
+ back_to_features_link: Voltar para lista de funcionalidades
6
+ cucumber_monitor:
7
+ features:
8
+ title: Funcionalidades do Cucumber
9
+ total_features_note: "Você tem %{total} funcionalidades"
10
+ table:
11
+ th:
12
+ name: Nome
13
+ description: Descrição
14
+ file: Arquivo
15
+ show_feature:
16
+ feature: Funcionalidade
17
+ background: Contexto
18
+ scenario: Cenário
19
+ search:
20
+ title: Busca
21
+ search_results: Resultados da busca
22
+ features_search_results: Resultado da busca por funcionalidades
23
+ steps_search_results: Resultado da busca por passos
24
+ scope: Escopo
25
+ file: Arquivo
26
+ results_not_found_for: "Nenhum resultado encontrado para '<strong>%{criteria}</strong>'"
27
+
28
+ "en":
29
+ buttons:
30
+ search: Search
31
+ links:
32
+ back_to_features_link: Back to features list
33
+ cucumber_monitor:
34
+ features:
35
+ title: Cucumber Features
36
+ total_features_note: "You have %{total} features"
37
+ table:
38
+ th:
39
+ name: name
40
+ description: Description
41
+ file: File
42
+ show_feature:
43
+ feature: Feature
44
+ background: Background
45
+ scenario: Scenario
46
+ search:
47
+ title: Search
48
+ search_results: Search results
49
+ features_search_results: Features search results
50
+ steps_search_results: Steps search results
51
+ scope: Scope
52
+ file: File
53
+ results_not_found_for: "Results not found for '<strong>%{criteria}</strong>'"
@@ -4,7 +4,7 @@ class Array
4
4
  def where(options={})
5
5
  result = []
6
6
  self.each do |item|
7
- if item.respond_to?(:name) && item.name == options[:name]
7
+ if item.respond_to?(:name) && item.name.include?(options[:name])
8
8
  result << item
9
9
  end
10
10
 
@@ -1,3 +1,3 @@
1
1
  module CucumberMonitor
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-11 00:00:00.000000000 Z
12
+ date: 2012-09-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -58,6 +58,7 @@ files:
58
58
  - app/views/cucumber_monitor/show_feature.html.erb
59
59
  - app/views/layouts/cucumber_monitor.html.erb
60
60
  - config/locales/cucumber_monitor.yml
61
+ - config/locales/cucumber_monitor_views.yml
61
62
  - config/routes.rb
62
63
  - lib/cucumber_monitor/array.rb
63
64
  - lib/cucumber_monitor/base.rb
@@ -124,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
125
  version: '0'
125
126
  requirements: []
126
127
  rubyforge_project:
127
- rubygems_version: 1.8.24
128
+ rubygems_version: 1.8.22
128
129
  signing_key:
129
130
  specification_version: 3
130
131
  summary: Puts your features in a highlighted position. Adds a dashboard for viewing,