module Gitosis

Define a mapping from a Gitosis user and their public key. Here the use of string and symbol are unimportant, i.e.

Gitosis.forkers do
   fubar :key_one
   fubar "key_one"
end

are equivalent.

Group definition use strings and symbols to define groups with mutliple members and shared membership:

Gitosis.groups do
  fubar 'public.key'
  snafu :fubar
  luke 'fubar'
  combined :luke, :snafu, :fubar
end

This means that the following have the values:

Gitosis.groups[:fubar] ==> 'public.key'
Gitosis.groups[:snafu] ==> 'public.key'
Gitosis.groups[:luke] ==> 'fubar'
Gitosis.groups[:combined] ==> 'public.key fubar'

String values are public keys and symbols are references to group names. Duplicate key names are removed and returned is a concatenation of all keys.

Constants

EmptyConfig

Public Instance Methods

config(&block) click to toggle source

Configuration verbs – config, forkers, groups (or roles) and repositories.

# File lib/gitosis_easy_conf.rb, line 19
def config(&block)
  if block_given?
    if defined?(@@config)
      @@config.instance_eval(&block)
    else
      @@config = Config.new(&block)
    end
  else
    @@config ||= Config.new(){}
  end
end
forkers(&block) click to toggle source
# File lib/gitosis_easy_conf.rb, line 31
def forkers(&block)
  block_given? ? @@forkers = Forker.new(&block) : (@@forkers ||= nil)
end
groups(&block) click to toggle source
# File lib/gitosis_easy_conf.rb, line 35
def groups(&block)
  block_given? ? @@groups = Group.new(&block).denormalize : (@@groups ||= nil)
end
Also aliased as: roles
repositories(&block) click to toggle source
# File lib/gitosis_easy_conf.rb, line 40
def repositories(&block)
  block_given? ? @@repository = Repository.new(&block) : @@repository
end
roles(&block)
Alias for: groups
setup(filename = nil, &block) click to toggle source
# File lib/gitosis_easy_conf.rb, line 44
def setup(filename = nil, &block)
  config do
    filename filename
  end

  class_eval(&block)
  repositories.write
end