class Ninny::ProjectConfig

Attributes

config[R]

Public Class Methods

config() click to toggle source
# File lib/ninny/project_config.rb, line 46
def self.config
  new
end
new() click to toggle source
# File lib/ninny/project_config.rb, line 7
def initialize
  @config = TTY::Config.new
  @config.filename = '.ninny'
  @config.extname = '.yml'
  @config.prepend_path Dir.pwd
  @config.read
end

Public Instance Methods

deploy_branch() click to toggle source
# File lib/ninny/project_config.rb, line 27
def deploy_branch
  config.fetch(:deploy_branch)
end
gitlab_endpoint() click to toggle source
# File lib/ninny/project_config.rb, line 35
def gitlab_endpoint
  config.fetch(:gitlab_endpoint, default: 'https://gitlab.com/api/v4')
end
gitlab_project_id() click to toggle source
# File lib/ninny/project_config.rb, line 31
def gitlab_project_id
  config.fetch(:gitlab_project_id)
end
repo() click to toggle source
# File lib/ninny/project_config.rb, line 39
def repo
  return unless repo_type

  repo_class = { gitlab: Repository::Gitlab }[repo_type.to_sym]
  repo_class&.new
end
repo_type() click to toggle source
# File lib/ninny/project_config.rb, line 23
def repo_type
  config.fetch(:repo_type)
end
set(*args) click to toggle source
# File lib/ninny/project_config.rb, line 19
def set(*args)
  config.set(*args)
end
write(*args) click to toggle source
# File lib/ninny/project_config.rb, line 15
def write(*args)
  config.write(*args)
end