diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-02-27 15:38:05 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-02-27 15:38:05 -0300 |
commit | 89049c1338c6ecd9951753bf00a24ab479723149 (patch) | |
tree | 26ef47d42693565819fc9a52a27d0921167bcc0e /lib/backend | |
parent | 016dda3698847024d102c309039f2d6f5511e6c0 (diff) | |
download | keyringer-89049c1338c6ecd9951753bf00a24ab479723149.tar.gz keyringer-89049c1338c6ecd9951753bf00a24ab479723149.tar.bz2 |
Init: creating/cloning repository and other changes
Diffstat (limited to 'lib/backend')
-rw-r--r-- | lib/backend/git.rb | 8 | ||||
-rw-r--r-- | lib/backend/recipients_store.rb | 12 |
2 files changed, 18 insertions, 2 deletions
diff --git a/lib/backend/git.rb b/lib/backend/git.rb index 177657b..4ce016d 100644 --- a/lib/backend/git.rb +++ b/lib/backend/git.rb @@ -28,5 +28,13 @@ module Backend false end end + + def init(path) + @git = ::Git.init(path) + end + + def clone(url, path) + @git = ::Git.clone(url, path) + end end end diff --git a/lib/backend/recipients_store.rb b/lib/backend/recipients_store.rb index 16b063b..2dab533 100644 --- a/lib/backend/recipients_store.rb +++ b/lib/backend/recipients_store.rb @@ -48,10 +48,18 @@ module Backend write()
end
+ def getPath()
+ File.join(@baseDir, "config", "recipients")
+ end
+
+ def hasPath?()
+ File.directory?(getPath())
+ end
+
private
def read()
- fileName = File.join(@baseDir, "config", "recipients")
+ fileName = getPath()
file = File.new(fileName, "r")
begin
recipients = []
@@ -72,7 +80,7 @@ module Backend end
def write()
- fileName = File.join(@baseDir, "config", "recipients")
+ fileName = getPath()
file = File.new(fileName, "w")
begin
@recipients.each do |recipient|
|