Class: Environments::TravisCi
- Inherits:
-
Object
- Object
- Environments::TravisCi
- Defined in:
- lib/flakyci_rspec/environments/travis_ci.rb
Class Method Summary collapse
Instance Method Summary collapse
- #build_id ⇒ Object
- #build_name ⇒ Object
- #get_infos ⇒ Object
- #get_ref ⇒ Object
- #is_travis? ⇒ Boolean
- #sha ⇒ Object
Class Method Details
.is_travis_ci? ⇒ Boolean
38 39 40 |
# File 'lib/flakyci_rspec/environments/travis_ci.rb', line 38 def self.is_travis_ci?() ENV["TRAVIS"] == "true" end |
Instance Method Details
#build_id ⇒ Object
30 31 32 |
# File 'lib/flakyci_rspec/environments/travis_ci.rb', line 30 def build_id() ENV["TRAVIS_BUILD_ID"] end |
#build_name ⇒ Object
34 35 36 |
# File 'lib/flakyci_rspec/environments/travis_ci.rb', line 34 def build_name() ENV["TRAVIS_JOB_NAME"] end |
#get_infos ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/flakyci_rspec/environments/travis_ci.rb', line 3 def get_infos() { sha: sha(), build_id: build_id(), ref: get_ref(), build_name: build_name(), env_name: "travis-ci" } end |
#get_ref ⇒ Object
26 27 28 |
# File 'lib/flakyci_rspec/environments/travis_ci.rb', line 26 def get_ref() ENV["TRAVIS_BRANCH"] end |
#is_travis? ⇒ Boolean
13 14 15 |
# File 'lib/flakyci_rspec/environments/travis_ci.rb', line 13 def is_travis? ENV["TRAVIS"] == "true" end |
#sha ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/flakyci_rspec/environments/travis_ci.rb', line 17 def sha() sha = ENV["TRAVIS_PULL_REQUEST_SHA"] if sha == "" "unknown" else sha end end |