Sha256: 8f47355d651dcd7627fc9a2f0444c3e638e20a6b1e645bc39f64496c48c5edae
Contents?: true
Size: 877 Bytes
Versions: 4
Compression:
Stored size: 877 Bytes
Contents
module Jets::Git class Info extend Memoist # Not using options but trying to future proof initialize def initialize(options = {}) @options = options end def user User.new end memoize :user # Best effort to get git info def params return {} if ENV["JETS_GIT_DISABLED"] strategy_class.new.params end def strategy_class return Saved if File.exist?(".jets/gitinfo.yml") env_map = { BITBUCKET_COMMIT: Bitbucket, CIRCLECI: Circleci, CODEBUILD_CI: Codebuild, GITHUB_ACTIONS: Github, GITLAB_CI: Gitlab, JETS_GIT_CUSTOM: Custom, SYSTEM_TEAMFOUNDATIONSERVERURI: Azure } found = env_map.find do |env_key, strategy_class| ENV[env_key.to_s] end found ? found[1] : Local end memoize :strategy_class end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
jets-6.0.5 | lib/jets/git/info.rb |
jets-6.0.4 | lib/jets/git/info.rb |
jets-6.0.3 | lib/jets/git/info.rb |
jets-6.0.2 | lib/jets/git/info.rb |