cucumberhtml 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3ffe9eb3e7f52c8e521f4bed6a7a9093fb5f3da96143730810f40dc8b429552
4
- data.tar.gz: 7711e792161c894f6979618d7be656040480a5a866278a3e6da9038ee79d2e27
3
+ metadata.gz: f8f8f7166be7d9443887da870ba68b92979df7ca102c6c9b9deeb4af4491983e
4
+ data.tar.gz: 83ab32b1a86ca47c87baedc00592037b1f49e7e262e64646da6acab7ffa7fd25
5
5
  SHA512:
6
- metadata.gz: 3a8b58f48b2b2ba4175212261c61cff3077ec37fd52b3250f1716b2d011d874f6fcbb8fe2e338cc8a1884b0450629db18c263c288da2a6a00989cdbe67f9d407
7
- data.tar.gz: 37b1536738eb16fa4d46960a023aa14cf02250159495ee83a383c5144d974a90ef26aeca2929fc332d67d35a753ff22772ac856a56a0f428b2060e408fae9fb5
6
+ metadata.gz: b040b3aac6e075840cf777428709eac652b1e404c022fbece36c626d032577175ccfebb9154fc9e30d1457dabadd86f781580da41284b7e77765100c45d0b9a3
7
+ data.tar.gz: e482b269cac18ef4cb7052efa562a46b5ed7dca2988dbfdc195832cfa77a992ce3334682c55cebb0d0b6b221710735a574089d3335465f95d26bf7c48f8c013b
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require 'bundler/setup'
3
5
  rescue LoadError
@@ -5,7 +5,7 @@ module CucumberToHtml::Cell
5
5
  def feature_menu_list
6
6
  res = '<div class="list-group" id="list-tab" role="tablist">'
7
7
  model.each_with_index do |feature, index|
8
- res += Feature.call(feature, active: index == 0).call(:feature_menu_item)
8
+ res += Feature.call(feature, active: index.zero?).call(:feature_menu_item)
9
9
  end
10
10
  res + '</div>'
11
11
  end
@@ -13,7 +13,7 @@ module CucumberToHtml::Cell
13
13
  def feature_list
14
14
  res = '<div class="tab-content" id="nav-tabContent">'
15
15
  model.each_with_index do |feature, index|
16
- res += Feature.call(feature, active: index == 0).call
16
+ res += Feature.call(feature, active: index.zero?).call
17
17
  end
18
18
  res + '</div>'
19
19
  end
@@ -2,12 +2,11 @@
2
2
 
3
3
  module CucumberToHtml::Cell
4
4
  class Scenario < Element
5
- # class CucumberToHtml::Cell::Scenario < Element
6
5
  def success?
7
6
  model['steps'].all? do |step|
8
7
  step.dig('result', 'status') == 'passed'
9
8
  end
10
- end
9
+ end
11
10
 
12
11
  def failure?
13
12
  false # TBD
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Cucumberhtml
2
4
  class ApplicationController < ActionController::Base
3
5
  protect_from_forgery with: :exception
data/config/routes.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Cucumberhtml::Engine.routes.draw do
2
4
  get 'index', to: 'cucumber_to_html#index'
3
5
  end
@@ -1,6 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Cucumberhtml
2
- class Cell < Trailblazer::Cell # Cell::Concept
3
- # raise Cucumberhtml::Engine.root.inspect
4
+ class Cell < Trailblazer::Cell
4
5
  self.view_paths = ["#{Cucumberhtml::Engine.root}/app/concepts/"]
5
6
  end
6
7
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Cucumberhtml
2
4
  class Engine < ::Rails::Engine
3
5
  isolate_namespace Cucumberhtml
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cucumberhtml'
4
+ require 'rails'
5
+
6
+ module Cucumberhtml
7
+ class Railtie < Rails::Railtie
8
+ railtie_name :cucumberhtml
9
+
10
+ rake_tasks do
11
+ load 'tasks/cucumberhtml.rake'
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Cucumberhtml
2
- VERSION = '0.1.1'.freeze
4
+ VERSION = '0.1.2'
3
5
  end
data/lib/cucumberhtml.rb CHANGED
@@ -1,8 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cucumberhtml/engine'
2
4
  require 'cucumberhtml/cell'
3
- # require_relative '../app/concepts/cucumber_to_html/cell/gherkin'
4
- # require 'app/concepts/cucumber_to_html/cell/gherkin'
5
+ require 'cucumberhtml/railtie' if defined?(Rails)
5
6
 
6
7
  module Cucumberhtml
7
- # Your code goes here...
8
8
  end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CucumberToHtml
4
+ end
5
+
6
+ require 'cells-rails'
7
+
8
+ require_relative '../../app/concepts/cucumber_to_html/cell/gherkin'
9
+
10
+ namespace :cucumberhtml do
11
+ desc 'Exporting cucumber html'
12
+ task :export, %i[filename outfile] => :environment do |_t, args|
13
+ filename = args[:filename] || 'tmp/cucumber_result.json'
14
+ outfile = args[:outfile] || 'tmp/cucumber_result.html'
15
+
16
+ file = File.read(filename)
17
+ json = JSON.parse(file)
18
+ html = CucumberToHtml::Cell::Gherkin.call(json)
19
+ open(outfile, 'w') do |f|
20
+ f << html
21
+ end
22
+ end
23
+ end
metadata CHANGED
@@ -1,23 +1,23 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumberhtml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Axel Nielsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-02 00:00:00.000000000 Z
11
+ date: 2018-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: cells-rails
14
+ name: rubocop
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
- type: :runtime
20
+ type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: cells-slim
28
+ name: cells-rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rails
42
+ name: cells-slim
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -93,8 +93,9 @@ files:
93
93
  - lib/cucumberhtml.rb
94
94
  - lib/cucumberhtml/cell.rb
95
95
  - lib/cucumberhtml/engine.rb
96
+ - lib/cucumberhtml/railtie.rb
96
97
  - lib/cucumberhtml/version.rb
97
- - lib/tasks/cucumberhtml_tasks.rake
98
+ - lib/tasks/cucumberhtml.rake
98
99
  homepage: https://www.github.com/lucalabs/cucumberhtml
99
100
  licenses:
100
101
  - MIT
@@ -1,35 +0,0 @@
1
- module CucumberToHtml
2
- end
3
-
4
- require 'cells-rails'
5
-
6
- require_relative '../../app/concepts/cucumber_to_html/cell/gherkin'
7
-
8
-
9
- namespace :cucumberhtml do
10
- task :export, [:filename, :outfile] => :environment do |_t, args|
11
- desc 'Exporting cucumber html'
12
- filename = args[:filename] || 'tmp/cucumber_result.json'
13
- outfile = args[:outfile] || 'tmp/cucumber_result.html'
14
-
15
- file = File.read(filename)
16
- json = JSON.parse(file)
17
- html = CucumberToHtml::Cell::Gherkin.call(json)
18
- open(outfile, 'w') do |f|
19
- f << html
20
- end
21
- end
22
-
23
- # task export3: :environment, :filename do |_t, args|
24
- # desc 'Exporting cucumber html'
25
- # filename ='tmp/cucumber_result.json'
26
- # outfile = 'tmp/cucumber_result.html'
27
- #
28
- # file = File.read(filename)
29
- # json = JSON.parse(file)
30
- # html = CucumberToHtml::Cell::Gherkin.call(json)
31
- # open(outfile, 'w') do |f|
32
- # f << html
33
- # end
34
- # end
35
- end