Class: Jets::Git::Info
- Inherits:
-
Object
- Object
- Jets::Git::Info
- Extended by:
- Memoist
- Defined in:
- lib/jets/git/info.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Info
constructor
Not using options but trying to future proof initialize.
-
#params ⇒ Object
Best effort to get git info.
- #strategy_class ⇒ Object
- #user ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Info
Not using options but trying to future proof initialize
5 6 7 |
# File 'lib/jets/git/info.rb', line 5 def initialize(={}) @options = end |
Instance Method Details
#params ⇒ Object
Best effort to get git info
15 16 17 18 |
# File 'lib/jets/git/info.rb', line 15 def params return {} if ENV['JETS_GIT_DISABLED'] strategy_class.new.params end |
#strategy_class ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jets/git/info.rb', line 20 def strategy_class 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 |
#user ⇒ Object
9 10 11 |
# File 'lib/jets/git/info.rb', line 9 def user User.new end |