keybase-unofficial 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/keybase/configuration.rb +4 -1
- data/lib/keybase/exceptions.rb +7 -0
- data/lib/keybase/kbfs.rb +0 -4
- data/lib/keybase.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c65d684f169a40ef888365599b327bc4fc33b087
|
4
|
+
data.tar.gz: c621a15ee3e4af35db7ace294a3378452d947f6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0cbd85b2bf544a9374ef59c5840fb7a080a7c900d171a831b94b9308dfd3b031a5aa0888df4ac0af665f20f015e2a3f2439c737c4b18318646d8958c6792027
|
7
|
+
data.tar.gz: cd3c1cc0857fc82059d5672347d76af3aecca6881bd2c6de0a3052da809bf45922b04417eacf67e60cd0cf0e12093f2c22160f170eb0de2554d82111e22ba2e4
|
@@ -9,6 +9,9 @@ module Keybase
|
|
9
9
|
# The Keybase configuration file.
|
10
10
|
CONFIG_FILE = File.join(CONFIG_DIR, "config.json").freeze
|
11
11
|
|
12
|
+
# there's not much this library can do without a local config
|
13
|
+
raise KeybaseNotInstalledError unless File.file?(CONFIG_FILE)
|
14
|
+
|
12
15
|
# The hash from Keybase's configuration file.
|
13
16
|
CONFIG_HASH = JSON.parse(File.read(CONFIG_FILE)).freeze
|
14
17
|
|
@@ -37,7 +40,7 @@ module Keybase
|
|
37
40
|
def running?
|
38
41
|
# is there a more efficient way to do this that doesn't involve an exec?
|
39
42
|
Dir["/proc/[0-9]*/comm"].any? do |comm|
|
40
|
-
File.read(comm).chomp == "keybase"
|
43
|
+
File.read(comm).chomp == "keybase" rescue false # hooray for TOCTOU
|
41
44
|
end
|
42
45
|
end
|
43
46
|
|
data/lib/keybase/exceptions.rb
CHANGED
@@ -3,6 +3,13 @@ module Keybase
|
|
3
3
|
class KeybaseError < RuntimeError
|
4
4
|
end
|
5
5
|
|
6
|
+
# Raised if a Keybase installation can't be found.
|
7
|
+
class KeybaseNotInstalledError < KeybaseError
|
8
|
+
def initialize
|
9
|
+
super "keybase needs to be installed"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
6
13
|
# Raised whenever Keybase is not running locally.
|
7
14
|
class KeybaseNotRunningError < KeybaseError
|
8
15
|
def initialize
|
data/lib/keybase/kbfs.rb
CHANGED
@@ -8,9 +8,5 @@ module Keybase
|
|
8
8
|
raise KeybaseNotRunningError unless Keybase.running?
|
9
9
|
raise KBFSNotRunningError unless Dir.exist?("/keybase")
|
10
10
|
end
|
11
|
-
|
12
|
-
# there's nothing here yet.
|
13
|
-
# i could add methods for moving files to and from the public
|
14
|
-
# and private keybase directories, but that feels overkill.
|
15
11
|
end
|
16
12
|
end
|
data/lib/keybase.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keybase-unofficial
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Woodruff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|