class Cucumber::Runtime::MetaMessageBuilder
-
tag: the name of the git tag (e.g. v1.0.0)
- branch: the name of the git branch (e.g. main)
- revision: the revision of the git repository (e.g. abcdef)
- remote: the remote of the git repository (e.g. git@github.com:cucumber/cucumber-ruby.git)
- git: the git information of the CI environment if any
- build_number: the build number of the CI environment (e.g. 123)
- url: the URL of the CI environment (e.g. ci.example.com)
- name: the name of the CI environment (e.g. Jenkins)
- ci: information about the CI environment if any, including:
- cpu: the name of the CPU (e.g. x86_64)
- os: the name and version of the operating system (e.g. linux 3.13.0-45-generic)
- runtime: the name and version of the runtime (e.g. ruby 3.0.1)
- implementation: the name and version of the implementation (e.g. cucumber-ruby 8.0.0)
- protocol version: the version of the Cucumber::Messages protocol
the runtime meta-data:
Builder to instantiate a Cucumber::Messages::Meta message filled-in with
def build_meta_message(env = ENV)
- See: Cucumber::Runtime::MetaMessageBuilder -
Returns:
-
(Cucumber::Messages::Meta)
- the meta message
Parameters:
-
environment
(env
) -- data from which the CI information will be
def build_meta_message(env = ENV) Cucumber::Messages::Meta.new( protocol_version: protocol_version, implementation: implementation, runtime: runtime, os: os, cpu: cpu, ci: ci(env) ) end
def ci(env)
def ci(env) ci_data = Cucumber::CiEnvironment.detect_ci_environment(env) return nil unless ci_data Cucumber::Messages::Ci.new( name: ci_data[:name], url: ci_data[:url], build_number: ci_data[:buildNumber], git: git_info(ci_data) ) end
def cpu
def cpu Cucumber::Messages::Product.new( name: RbConfig::CONFIG['target_cpu'] ) end
def git_info(ci_data)
def git_info(ci_data) return nil unless ci_data[:git] Cucumber::Messages::Git.new( remote: ci_data[:git][:remote], revision: ci_data[:git][:revision], branch: ci_data[:git][:branch], tag: ci_data[:git][:tag] ) end
def implementation
def implementation Cucumber::Messages::Product.new( name: 'cucumber-ruby', version: Cucumber::VERSION ) end
def os
def os Cucumber::Messages::Product.new( name: RbConfig::CONFIG['target_os'], version: Sys::Uname.uname.version ) end
def protocol_version
def protocol_version Cucumber::Messages::VERSION end
def runtime
def runtime Cucumber::Messages::Product.new( name: RUBY_ENGINE, version: RUBY_VERSION ) end