Class: Cucumber::Runtime::MetaMessageBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/runtime/meta_message_builder.rb

Overview

Builder to instantiate a Cucumber::Messages::Meta message filled-in with the runtime meta-data:

  • protocol version: the version of the Cucumber::Messages protocol

  • implementation: the name and version of the implementation (e.g. cucumber-ruby 8.0.0)

  • runtime: the name and version of the runtime (e.g. ruby 3.0.1)

  • os: the name and version of the operating system (e.g. linux 3.13.0-45-generic)

  • cpu: the name of the CPU (e.g. x86_64)

  • ci: information about the CI environment if any, including:

    • name: the name of the CI environment (e.g. Jenkins)

    • url: the URL of the CI environment (e.g. ci.example.com)

    • build_number: the build number of the CI environment (e.g. 123)

    • git: the git information of the CI environment if any

      • remote: the remote of the git repository (e.g. [email protected]:cucumber/cucumber-ruby.git)

      • revision: the revision of the git repository (e.g. abcdef)

      • branch: the name of the git branch (e.g. main)

      • tag: the name of the git tag (e.g. v1.0.0)

Class Method Summary collapse

Class Method Details

.build_meta_message(env = ENV) ⇒ Cucumber::Messages::Meta

Builds a Cucumber::Messages::Meta filled-in with the runtime meta-data

Cucumber::Runtime::MetaMessageBuilder.build_meta_message

Parameters:

  • environment (env)

    data from which the CI information will be retrieved (default ENV). Can be used to mock the environment for testing purpose.

Returns:

  • (Cucumber::Messages::Meta)

    the meta message

See Also:



39
40
41
42
43
44
45
46
47
48
# File 'lib/cucumber/runtime/meta_message_builder.rb', line 39

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