cucumber_monitor 0.0.1

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.
Files changed (54) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/stylesheets/cucumber_monitor/cucumber_monitor.css +48 -0
  5. data/app/controllers/cucumber_monitor_controller.rb +15 -0
  6. data/app/views/cucumber_monitor/_search_form.html.erb +4 -0
  7. data/app/views/cucumber_monitor/features.html.erb +24 -0
  8. data/app/views/cucumber_monitor/search.html.erb +22 -0
  9. data/app/views/cucumber_monitor/show_feature.html.erb +41 -0
  10. data/config/locales/cucumber_monitor.yml +601 -0
  11. data/config/routes.rb +7 -0
  12. data/lib/cucumber_monitor/array.rb +25 -0
  13. data/lib/cucumber_monitor/base.rb +50 -0
  14. data/lib/cucumber_monitor/context.rb +35 -0
  15. data/lib/cucumber_monitor/engine.rb +4 -0
  16. data/lib/cucumber_monitor/feature_file.rb +60 -0
  17. data/lib/cucumber_monitor/scenario.rb +44 -0
  18. data/lib/cucumber_monitor/step.rb +76 -0
  19. data/lib/cucumber_monitor/string.rb +8 -0
  20. data/lib/cucumber_monitor/version.rb +3 -0
  21. data/lib/cucumber_monitor.rb +19 -0
  22. data/lib/tasks/cucumber_monitor_tasks.rake +4 -0
  23. data/test/cucumber_monitor_test.rb +7 -0
  24. data/test/dummy/README.rdoc +261 -0
  25. data/test/dummy/Rakefile +7 -0
  26. data/test/dummy/app/assets/javascripts/application.js +15 -0
  27. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  28. data/test/dummy/app/controllers/application_controller.rb +3 -0
  29. data/test/dummy/app/helpers/application_helper.rb +2 -0
  30. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  31. data/test/dummy/config/application.rb +59 -0
  32. data/test/dummy/config/boot.rb +10 -0
  33. data/test/dummy/config/database.yml +25 -0
  34. data/test/dummy/config/environment.rb +5 -0
  35. data/test/dummy/config/environments/development.rb +37 -0
  36. data/test/dummy/config/environments/production.rb +67 -0
  37. data/test/dummy/config/environments/test.rb +37 -0
  38. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  39. data/test/dummy/config/initializers/inflections.rb +15 -0
  40. data/test/dummy/config/initializers/mime_types.rb +5 -0
  41. data/test/dummy/config/initializers/secret_token.rb +7 -0
  42. data/test/dummy/config/initializers/session_store.rb +8 -0
  43. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  44. data/test/dummy/config/locales/en.yml +5 -0
  45. data/test/dummy/config/routes.rb +58 -0
  46. data/test/dummy/config.ru +4 -0
  47. data/test/dummy/public/404.html +26 -0
  48. data/test/dummy/public/422.html +26 -0
  49. data/test/dummy/public/500.html +25 -0
  50. data/test/dummy/public/favicon.ico +0 -0
  51. data/test/dummy/script/rails +6 -0
  52. data/test/integration/navigation_test.rb +10 -0
  53. data/test/test_helper.rb +15 -0
  54. metadata +145 -0
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2012 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = CucumberMonitor
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'CucumberMonitor'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+
27
+
28
+ Bundler::GemHelper.install_tasks
29
+
30
+ require 'rake/testtask'
31
+
32
+ Rake::TestTask.new(:test) do |t|
33
+ t.libs << 'lib'
34
+ t.libs << 'test'
35
+ t.pattern = 'test/**/*_test.rb'
36
+ t.verbose = false
37
+ end
38
+
39
+
40
+ task :default => :test
@@ -0,0 +1,48 @@
1
+ div.feature_container {
2
+ padding: 20px;
3
+ background: #eeeeee;
4
+ margin-bottom: 10px;
5
+ }
6
+
7
+ div.feature_container hr {
8
+ padding: 0px 0 10px 0;
9
+ margin: 0;
10
+ }
11
+
12
+ div.feature_container h4 {
13
+ background: #fff;
14
+ display: inline-block;
15
+ padding: 10px 30px 10px 30px;
16
+ margin-bottom: 0;
17
+ border-top-left-radius: 10px;
18
+ border-top-right-radius: 10px;
19
+ margin-left: 40px;
20
+ }
21
+
22
+ div.feature_container .steps {
23
+ background: #fff;
24
+ margin: 0 0 20px 0;
25
+ padding: 20px 20px 10px 20px;
26
+ }
27
+
28
+ div.context {
29
+ background: #6BBA70;
30
+ }
31
+
32
+ div.feature_container .steps table {
33
+ width: 80%;
34
+ border: solid 1px #ebebeb;
35
+ border-radius: 10px;
36
+ margin: 10px 0 20px 0;
37
+ }
38
+
39
+ div.feature_container .steps table th {
40
+ padding: 5px;
41
+ background: #ccc;
42
+ }
43
+
44
+ div.feature_container .steps table td {
45
+ padding: 5px;
46
+ border-bottom: #ebebeb solid 1px;
47
+ border-right: #ebebeb solid 1px;
48
+ }
@@ -0,0 +1,15 @@
1
+ class CucumberMonitorController < ApplicationController
2
+
3
+ def features
4
+ @features = CucumberMonitor.new.features
5
+ end
6
+
7
+ def show_feature
8
+ @feature = CucumberMonitor.new.features.where(name: params[:name])
9
+ end
10
+
11
+ def search
12
+ @search_results = CucumberMonitor.new.search(params[:criteria])
13
+ end
14
+
15
+ end
@@ -0,0 +1,4 @@
1
+ <%= form_tag search_cucumber_monitor_path, method: :get do %>
2
+ <%= text_field_tag :criteria %>
3
+ <%= submit_tag "Buscar" %>
4
+ <% end %>
@@ -0,0 +1,24 @@
1
+ <h1>Features Cucumber</h1>
2
+
3
+ <p>
4
+ Você tem <%= @features.size %> features do Cucumber.
5
+ </p>
6
+
7
+ <%= render 'search_form' %>
8
+
9
+ <table class='table table-bordered table-striped'>
10
+ <tr>
11
+ <th class="col3">#</th>
12
+ <th>Nome</th>
13
+ <th>Descrição</th>
14
+ <th class="col25">Arquivo</th>
15
+ </tr>
16
+ <% @features.each_with_index do |feature, i|%>
17
+ <tr>
18
+ <td><%= i+1 %></td>
19
+ <td><%= link_to feature.name, show_feature_cucumber_monitor_path(feature.name) %></td>
20
+ <td><%= feature.description %></td>
21
+ <td><%= feature.file %></td>
22
+ </tr>
23
+ <% end %>
24
+ </table>
@@ -0,0 +1,22 @@
1
+ <h1>Busca</h1>
2
+
3
+ <%= render 'search_form' %>
4
+
5
+ <p>
6
+ <%= link_to "Voltar para features", features_cucumber_monitor_path %>
7
+ </p>
8
+
9
+ <div class="feature_container">
10
+ <h4>Resultados da busca</h4>
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 />
16
+ <% end %>
17
+ </div>
18
+ </div>
19
+
20
+ <p>
21
+ <%= link_to "Voltar para features", features_cucumber_monitor_path %>
22
+ </p>
@@ -0,0 +1,41 @@
1
+ <%= stylesheet_link_tag 'cucumber_monitor' %>
2
+
3
+ <h1>Feature: <%= @feature.name %></h1>
4
+
5
+ <h3><%= @feature.description %></h3>
6
+
7
+ <p>
8
+ <%= link_to "Voltar para features", features_cucumber_monitor_path %>
9
+ </p>
10
+
11
+ <% if @feature.contexts.any? %>
12
+ <div class="feature_container context">
13
+ <% @feature.contexts.each do |context|%>
14
+ <h4>Contexto</h4>
15
+ <div class="steps">
16
+ <% context.steps.each do |step| %>
17
+ <%= step.formatted.html_safe %>
18
+ <% if step.not_a_table %>
19
+ <hr />
20
+ <% end %>
21
+ <% end %>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+ <% end %>
26
+
27
+ <div class="feature_container">
28
+ <% @feature.scenarios.each_with_index do |scenario, i|%>
29
+ <h4>Cenário: <%= scenario.name %></h4>
30
+ <div class="steps">
31
+ <% scenario.steps.each do |step| %>
32
+ <%= step.formatted.html_safe %>
33
+ <% if step.not_a_table %>
34
+ <hr />
35
+ <% end %>
36
+ <% end %>
37
+ </div>
38
+ <% end %>
39
+ </div>
40
+
41
+ <%= link_to "Voltar para features", features_cucumber_monitor_path %>