Sha256: e2ddf1441a0348565707b1dd3167de5bcf7d7eb69bf1c7e45c539fb226aa3b6b
Contents?: true
Size: 875 Bytes
Versions: 16
Compression:
Stored size: 875 Bytes
Contents
# frozen_string_literal: true module Ninny class ProjectConfig attr_reader :config def initialize @config = TTY::Config.new @config.filename = '.ninny' @config.extname = '.yml' @config.prepend_path Dir.pwd @config.read end def write(*args) config.write(*args) end def set(*args) config.set(*args) end def repo_type config.fetch(:repo_type) end def deploy_branch config.fetch(:deploy_branch) end def gitlab_project_id config.fetch(:gitlab_project_id) end def gitlab_endpoint config.fetch(:gitlab_endpoint, default: 'https://gitlab.com/api/v4') end def repo return unless repo_type repo_class = { gitlab: Repository::Gitlab }[repo_type.to_sym] repo_class&.new end def self.config new end end end
Version data entries
16 entries across 16 versions & 1 rubygems