fast_ci 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f73e219ff5c12432106b073687d7a644523407740dfdb44a380e369580c8b3a6
4
- data.tar.gz: 8e57bc31745f2749d3b2b813d07b96ae501a06dd1c976f0e4b77436fe0079a13
3
+ metadata.gz: 1bcf8f013e9598e2122841f30d951528519bffa648cfcf7c7872642ebd00d351
4
+ data.tar.gz: 72915e82ca7728225880a297bd59d44f1bf70f75086fb74245ae0ffef21e4e21
5
5
  SHA512:
6
- metadata.gz: 8dc1ee8b038bf4134b3bda60e3d11129bf582dfebb61336dc04d1f6ef73c66cc8cb0203c9a85e1a9454771cef27c410f784db616722e33c99b163bfd6b532cbb
7
- data.tar.gz: 3051caa8148a323a4ce5b539a378f0b15531db83a0b26f51147d42595900d560e5a6265c9250d919b594595115b2b8c77e62c283adb72c7c2a55bef5e1996fe6
6
+ metadata.gz: 775e9c9368f928d4d8fb0e260f2a9d2909bbc132a038673b561ea5dd966c1e220dbbeb313157cc32ba966af28ab490b14643e1626087d24ca67f37247aa4c02c
7
+ data.tar.gz: 505db9f73edbbcced7b53e8844b6eb967a00c24a4d3dfb04d7f551a0a626aba4063c76795739452ff60c0112dd6c20a2f5980de0999ca7cce507d082feb62861
data/fast_ci.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
 
11
11
  spec.summary = "Ruby wrapper for creating FastCI integrations"
12
12
  spec.description = "Ruby wrapper for creating FastCI integrations"
13
- spec.homepage = "https://github.com/alexvko/fast_ci-rb"
13
+ spec.homepage = "https://github.com/RubyCI/fast_ci_gem"
14
14
  spec.license = "MIT"
15
15
  spec.required_ruby_version = ">= 2.4.0"
16
16
 
@@ -7,9 +7,9 @@ module FastCI
7
7
  def initialize
8
8
  # Settings defaults
9
9
  self.run_key = nil
10
- self.build_id = ENV.fetch("BUILD_ID")
11
- self.commit = `git rev-parse --short HEAD`.chomp
12
- self.branch = `git rev-parse --abbrev-ref HEAD`.chomp
10
+ self.build_id = guess_build_id
11
+ self.commit = guess_commit
12
+ self.branch = guess_branch
13
13
  self.api_url = ENV["FAST_CI_API_URL"] || "api.fast.ci"
14
14
  self.secret_key = ENV.fetch("FAST_CI_SECRET_KEY")
15
15
  end
@@ -21,5 +21,26 @@ module FastCI
21
21
  def run_key
22
22
  @run_key || raise("#run_key was not configured.")
23
23
  end
24
+
25
+ def guess_build_id
26
+ %w[GITHUB_RUN_ID BUILD_ID CIRCLE_BUILD_NUM].find do |keyword|
27
+ key = ENV.keys.find { |k| k[keyword] }
28
+ break ENV[key] if key && ENV[key]
29
+ end || guess_commit
30
+ end
31
+
32
+ def guess_commit
33
+ %w[_COMMIT _SHA1 _SHA].find do |keyword|
34
+ key = ENV.keys.find { |k| k[keyword] }
35
+ break ENV[key] if key && ENV[key]
36
+ end || `git rev-parse --short HEAD`.chomp
37
+ end
38
+
39
+ def guess_branch
40
+ %w[_BRANCH _REF].find do |keyword|
41
+ key = ENV.keys.find { |k| k[keyword] }
42
+ break ENV[key] if key && ENV[key]
43
+ end || `git rev-parse --abbrev-ref HEAD`.chomp
44
+ end
24
45
  end
25
46
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FastCI
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ale ∴
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-26 00:00:00.000000000 Z
11
+ date: 2023-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-websocket
@@ -60,14 +60,14 @@ files:
60
60
  - lib/fast_ci/configuration.rb
61
61
  - lib/fast_ci/exceptions.rb
62
62
  - lib/fast_ci/version.rb
63
- homepage: https://github.com/alexvko/fast_ci-rb
63
+ homepage: https://github.com/RubyCI/fast_ci_gem
64
64
  licenses:
65
65
  - MIT
66
66
  metadata:
67
- homepage_uri: https://github.com/alexvko/fast_ci-rb
68
- source_code_uri: https://github.com/alexvko/fast_ci-rb
69
- changelog_uri: https://github.com/alexvko/fast_ci-rb
70
- post_install_message:
67
+ homepage_uri: https://github.com/RubyCI/fast_ci_gem
68
+ source_code_uri: https://github.com/RubyCI/fast_ci_gem
69
+ changelog_uri: https://github.com/RubyCI/fast_ci_gem
70
+ post_install_message:
71
71
  rdoc_options: []
72
72
  require_paths:
73
73
  - lib
@@ -82,8 +82,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  requirements: []
85
- rubygems_version: 3.2.22
86
- signing_key:
85
+ rubyforge_project:
86
+ rubygems_version: 2.7.7
87
+ signing_key:
87
88
  specification_version: 4
88
89
  summary: Ruby wrapper for creating FastCI integrations
89
90
  test_files: []