cucumber-create-meta 6.0.2 → 6.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cucumber/create_meta.rb +11 -10
- data/spec/acceptance/create_meta_spec.rb +25 -0
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63127f1e5e91ab72c44f0bb1bd04fd3c6e135f3d663e527dc5cb9e83333b64bc
|
4
|
+
data.tar.gz: fe39fb543eaeb57b6f11e461a669da01348571d8bff54ab88a0cb1ed70afa910
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70de8133e0320a1ecd8a340e69fa5c469c874676b4c65aa7f7ef268c298b875720c9152068366b628183e4cc13d29387adee865defef9da23159465cf42b34ab
|
7
|
+
data.tar.gz: 40298073a226c0fd14ed6d3e2342fe01e5b3ef6c60cd3abcfcdcc54c760a572fcb55ccf76ca13e4ebf6a6a47263421977d47efb400e0cbb3b98f4042fcf78cc3
|
data/lib/cucumber/create_meta.rb
CHANGED
@@ -7,25 +7,25 @@ require 'cucumber/create_meta/variable_expression'
|
|
7
7
|
module Cucumber
|
8
8
|
module CreateMeta
|
9
9
|
extend Cucumber::CreateMeta::VariableExpression
|
10
|
-
CI_DICT = JSON.parse(IO.read(File.join(File.dirname(__FILE__),
|
10
|
+
CI_DICT = JSON.parse(IO.read(File.join(File.dirname(__FILE__), 'ciDict.json')))
|
11
11
|
|
12
12
|
def create_meta(tool_name, tool_version, env = ENV)
|
13
13
|
Cucumber::Messages::Meta.new(
|
14
14
|
protocol_version: Cucumber::Messages::VERSION,
|
15
15
|
implementation: Cucumber::Messages::Product.new(
|
16
|
-
|
17
|
-
|
16
|
+
name: tool_name,
|
17
|
+
version: tool_version
|
18
18
|
),
|
19
19
|
runtime: Cucumber::Messages::Product.new(
|
20
|
-
|
21
|
-
|
20
|
+
name: RUBY_ENGINE,
|
21
|
+
version: RUBY_VERSION
|
22
22
|
),
|
23
23
|
os: Cucumber::Messages::Product.new(
|
24
|
-
|
25
|
-
|
24
|
+
name: RbConfig::CONFIG['target_os'],
|
25
|
+
version: Sys::Uname.uname.version
|
26
26
|
),
|
27
27
|
cpu: Cucumber::Messages::Product.new(
|
28
|
-
|
28
|
+
name: RbConfig::CONFIG['target_cpu']
|
29
29
|
),
|
30
30
|
ci: detect_ci(env)
|
31
31
|
)
|
@@ -51,18 +51,19 @@ module Cucumber
|
|
51
51
|
remote: remove_userinfo_from_url(evaluate(ci_system['git']['remote'], env)),
|
52
52
|
revision: evaluate(ci_system['git']['revision'], env),
|
53
53
|
branch: evaluate(ci_system['git']['branch'], env),
|
54
|
-
tag: evaluate(ci_system['git']['tag'], env)
|
54
|
+
tag: evaluate(ci_system['git']['tag'], env)
|
55
55
|
)
|
56
56
|
)
|
57
57
|
end
|
58
58
|
|
59
59
|
def remove_userinfo_from_url(value)
|
60
60
|
return nil if value.nil?
|
61
|
+
|
61
62
|
begin
|
62
63
|
uri = URI(value)
|
63
64
|
uri.userinfo = ''
|
64
65
|
uri.to_s
|
65
|
-
rescue
|
66
|
+
rescue StandardError
|
66
67
|
value
|
67
68
|
end
|
68
69
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cucumber/create_meta'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
TEST_DATA_DIR = '../testdata'
|
7
|
+
|
8
|
+
describe 'CreateMeta' do
|
9
|
+
Dir.each_child(TEST_DATA_DIR) do |test_data_file|
|
10
|
+
next unless File.extname(test_data_file) == '.txt'
|
11
|
+
|
12
|
+
context "with #{File.basename(test_data_file, '.*')}" do
|
13
|
+
subject { JSON.parse(meta.ci.to_json) }
|
14
|
+
|
15
|
+
let(:meta) { Cucumber::CreateMeta.create_meta('cucumber-something', '1.2.3', env) }
|
16
|
+
let(:env) { Hash[entries] }
|
17
|
+
let(:entries) { env_data.split(/\n/).map { |line| line.split(/=/) } }
|
18
|
+
let(:env_data) { IO.read("#{TEST_DATA_DIR}/#{test_data_file}") }
|
19
|
+
|
20
|
+
let(:expected_json) { File.read("#{TEST_DATA_DIR}/#{test_data_file}.json") }
|
21
|
+
|
22
|
+
it { is_expected.to eq JSON.parse(expected_json) }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
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: 6.0.
|
4
|
+
version: 6.0.4
|
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: 2021-
|
11
|
+
date: 2021-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber-messages
|
@@ -100,19 +100,20 @@ files:
|
|
100
100
|
- lib/cucumber/ciDict.json
|
101
101
|
- lib/cucumber/create_meta.rb
|
102
102
|
- lib/cucumber/create_meta/variable_expression.rb
|
103
|
+
- spec/acceptance/create_meta_spec.rb
|
103
104
|
- spec/capture_warnings.rb
|
104
105
|
- spec/cucumber/create_meta_spec.rb
|
105
106
|
- spec/cucumber/evaluate_variable_expression_spec.rb
|
106
107
|
- spec/cucumber/remove_userinfo_from_url_spec.rb
|
107
|
-
homepage: https://github.com/cucumber/create-meta
|
108
|
+
homepage: https://github.com/cucumber/create-meta
|
108
109
|
licenses:
|
109
110
|
- MIT
|
110
111
|
metadata:
|
111
|
-
bug_tracker_uri: https://github.com/cucumber/
|
112
|
-
changelog_uri: https://github.com/cucumber/
|
112
|
+
bug_tracker_uri: https://github.com/cucumber/create-meta/issues
|
113
|
+
changelog_uri: https://github.com/cucumber/create-meta/blob/main/CHANGELOG.md
|
113
114
|
documentation_uri: https://cucumber.io/docs/gherkin/
|
114
115
|
mailing_list_uri: https://groups.google.com/forum/#!forum/cukes
|
115
|
-
source_code_uri: https://github.com/cucumber/
|
116
|
+
source_code_uri: https://github.com/cucumber/create-meta/tree/main/ruby
|
116
117
|
post_install_message:
|
117
118
|
rdoc_options:
|
118
119
|
- "--charset=UTF-8"
|
@@ -132,9 +133,10 @@ requirements: []
|
|
132
133
|
rubygems_version: 3.1.2
|
133
134
|
signing_key:
|
134
135
|
specification_version: 4
|
135
|
-
summary: cucumber-create-meta-6.0.
|
136
|
+
summary: cucumber-create-meta-6.0.4
|
136
137
|
test_files:
|
137
|
-
- spec/
|
138
|
+
- spec/acceptance/create_meta_spec.rb
|
138
139
|
- spec/cucumber/remove_userinfo_from_url_spec.rb
|
139
140
|
- spec/cucumber/evaluate_variable_expression_spec.rb
|
140
141
|
- spec/cucumber/create_meta_spec.rb
|
142
|
+
- spec/capture_warnings.rb
|