cucumber-create-meta 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3439afc7d30fd03f345e699bfd6bc8ad5148a269a1de1bf7a844ede135b0b4ac
4
- data.tar.gz: 2f2224d15ab4da7133cb2c6461733b4a9e0732f9f6ebd9207a023eab59d99038
3
+ metadata.gz: eb02c92607f075dd2131ad7f6e564e11d76cb35d895dc178d20853345a12e39f
4
+ data.tar.gz: db20d3ac9d17165204c687fe9cf733ce639510fc0360f57b0a870b9aee02cf47
5
5
  SHA512:
6
- metadata.gz: 10a81fe0937170ff097b4d83b020aeabdc36f8ca0408387361aace80eab70c2923c18e82044af52ab8e9a07cf3f3ef93fb9dafedb10c65052350544fcd18f95a
7
- data.tar.gz: 01bbf4f81b424027207b84f9de6fc98541ea4eedb3d746f27d6300bebc4a55dd30806ca9065306fea6c40ac57b68277c24376afddf500b99ad0776ecb5a52f9d
6
+ metadata.gz: 81f25445789ac4c100cdb7678080a08f2d4a2370632e3b864e4602e05d3aecebd963a74a9d8b4a4f18fdcce5f49bf6447b1cfb4845118294526ac0af237abc17
7
+ data.tar.gz: 52c0ce5a5d28b332376cf1eef36ed004f0408978f99d4609bb3e55f3ad6243c9ccfa6801023104d9cd2bcfea9f56d39dd4afd2d28182f4b65937678f20f45450
@@ -6,7 +6,7 @@ module Cucumber
6
6
  module CreateMeta
7
7
  CI_DICT = JSON.parse(IO.read(File.join(File.dirname(__FILE__),"ciDict.json")))
8
8
 
9
- def create_meta(tool_name, tool_version)
9
+ def create_meta(tool_name, tool_version, env=ENV)
10
10
  Cucumber::Messages::Meta.new(
11
11
  protocol_version: Cucumber::Messages::VERSION,
12
12
  implementation: Cucumber::Messages::Meta::Product.new(
@@ -23,7 +23,8 @@ module Cucumber
23
23
  ),
24
24
  cpu: Cucumber::Messages::Meta::Product.new(
25
25
  name: RbConfig::CONFIG['target_cpu']
26
- )
26
+ ),
27
+ ci: detect_ci(env)
27
28
  )
28
29
  end
29
30
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-create-meta
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Prêtre
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-07 00:00:00.000000000 Z
11
+ date: 2020-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber-messages
@@ -99,7 +99,6 @@ files:
99
99
  - LICENSE
100
100
  - lib/cucumber/ciDict.json
101
101
  - lib/cucumber/create_meta.rb
102
- - spec/capture_warnings.rb
103
102
  - spec/cucumber/create_meta_spec.rb
104
103
  homepage: https://github.com/cucumber/create-meta-ruby
105
104
  licenses:
@@ -129,7 +128,6 @@ requirements: []
129
128
  rubygems_version: 3.1.2
130
129
  signing_key:
131
130
  specification_version: 4
132
- summary: cucumber-create-meta-2.0.0
131
+ summary: cucumber-create-meta-2.0.1
133
132
  test_files:
134
133
  - spec/cucumber/create_meta_spec.rb
135
- - spec/capture_warnings.rb
@@ -1,74 +0,0 @@
1
- # frozen_string_literal: true
2
- # With thanks to @myronmarston
3
- # https://github.com/vcr/vcr/blob/master/spec/capture_warnings.rb
4
-
5
- module CaptureWarnings
6
- def report_warnings(&block)
7
- current_dir = Dir.pwd
8
- warnings, errors = capture_error(&block).partition { |line| line.include?('warning') }
9
- project_warnings, other_warnings = warnings.uniq.partition { |line| line.include?(current_dir) }
10
-
11
- if errors.any?
12
- puts errors.join("\n")
13
- end
14
-
15
- if other_warnings.any?
16
- puts "#{ other_warnings.count } warnings detected, set VIEW_OTHER_WARNINGS=true to see them."
17
- print_warnings('other', other_warnings) if ENV['VIEW_OTHER_WARNINGS']
18
- end
19
-
20
- # Until they fix https://bugs.ruby-lang.org/issues/10661
21
- if RUBY_VERSION == "2.2.0"
22
- project_warnings = project_warnings.reject { |w| w =~ /warning: possible reference to past scope/ }
23
- end
24
-
25
- if project_warnings.any?
26
- puts "#{ project_warnings.count } warnings detected"
27
- print_warnings('cucumber-expressions', project_warnings)
28
- fail "Please remove all cucumber-expressions warnings."
29
- end
30
-
31
- ensure_system_exit_if_required
32
- end
33
-
34
- def capture_error(&block)
35
- old_stderr = STDERR.clone
36
- pipe_r, pipe_w = IO.pipe
37
- pipe_r.sync = true
38
- error = String.new
39
- reader = Thread.new do
40
- begin
41
- loop do
42
- error << pipe_r.readpartial(1024)
43
- end
44
- rescue EOFError
45
- end
46
- end
47
- STDERR.reopen(pipe_w)
48
- block.call
49
- ensure
50
- capture_system_exit
51
- STDERR.reopen(old_stderr)
52
- pipe_w.close
53
- reader.join
54
- return error.split("\n")
55
- end
56
-
57
- def print_warnings(type, warnings)
58
- puts
59
- puts "-" * 30 + " #{type} warnings: " + "-" * 30
60
- puts
61
- puts warnings.join("\n")
62
- puts
63
- puts "-" * 75
64
- puts
65
- end
66
-
67
- def ensure_system_exit_if_required
68
- raise @system_exit if @system_exit
69
- end
70
-
71
- def capture_system_exit
72
- @system_exit = $!
73
- end
74
- end