Sha256: 41fbc1a71f767313da792e2e1aefbfa0cbe9611f5b9d144394ba946e0d63d8bb
Contents?: true
Size: 912 Bytes
Versions: 1
Compression:
Stored size: 912 Bytes
Contents
module Rubolite class Client attr_reader :admin, :ssh_keys def initialize(admin) @admin = admin @ssh_keys = {} end def repos @repos ||= admin.parser.repos end def groups @groups ||= admin.parser.groups end def add_group(name, users) groups[name] = users end def add_repo(repo) repos << repo end def add_ssh_key(user, ssh_key) ssh_keys[user] = ssh_key end def save! admin.writer.write! end def save_ssh_keys! ssh_keys.each do |user, key| key.write_for user, "#{admin.path}/keydir" end end def commit! admin.git.add('.') admin.git.commit_all("Modified configuration by rubolite") end def push! admin.git.push(admin.repo_origin) end def save_and_push! save! save_ssh_keys! commit! push! end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rubolite-0.0.3 | lib/rubolite/client.rb |