Sha256: 25af3d27d265045d7d62df3f12fad9ec0a7923e11942e191f1753a692c00d7fe
Contents?: true
Size: 839 Bytes
Versions: 8
Compression:
Stored size: 839 Bytes
Contents
module ModuleSync module GitService # Git service's factory module Factory def self.instantiate(type:, endpoint:, token:) raise MissingCredentialsError, <<~MESSAGE if token.nil? A token is required to use services from #{type}: Please set environment variable: "#{type.upcase}_TOKEN" or set the token entry in module options. MESSAGE klass(type: type).new token, endpoint end def self.klass(type:) case type when :github require 'modulesync/git_service/github' ModuleSync::GitService::GitHub when :gitlab require 'modulesync/git_service/gitlab' ModuleSync::GitService::GitLab else raise NotImplementedError, "Unknown git service: '#{type}'" end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems