keybase-unofficial 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/keybase.rb +1 -1
- data/lib/keybase/configuration.rb +3 -3
- data/lib/keybase/exceptions.rb +20 -17
- data/lib/keybase/kbfs.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 461111311c6782d52f5b6e60db7c20067124756a
|
4
|
+
data.tar.gz: 2d785d0a0c0fa0a67c02b1fdd9d3e1596fea66c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51d21e7ab430c0114d987fcc35c0cc3e9e862498614e97ffd9b4da83f046a6db4c4d307a8b77c05611dc911cf49d0d30dcc82b58c2886f6e20667d80911a0e33
|
7
|
+
data.tar.gz: 7e9c98c821a81d0d2f194206cda9443c088aea0e96170af880908d5ecb84810618cd0457edbc7fbe9e5bb34c7e3bc251237fab5b85504591785242bdc10a5e4b
|
data/lib/keybase.rb
CHANGED
@@ -16,7 +16,7 @@ module Keybase
|
|
16
16
|
CONFIG_FILE = File.join(CONFIG_DIR, "config.json").freeze
|
17
17
|
|
18
18
|
# there's not much this library can do without a local config
|
19
|
-
raise KeybaseNotInstalledError unless File.file?(CONFIG_FILE)
|
19
|
+
raise Exceptions::KeybaseNotInstalledError unless File.file?(CONFIG_FILE)
|
20
20
|
|
21
21
|
# The hash from Keybase's configuration file.
|
22
22
|
CONFIG_HASH = JSON.parse(File.read(CONFIG_FILE)).freeze
|
@@ -58,9 +58,9 @@ module Keybase
|
|
58
58
|
end
|
59
59
|
|
60
60
|
# @return [String] the running Keybase's version string
|
61
|
-
# @raise [KeybaseNotRunningError] if Keybase is not running
|
61
|
+
# @raise [Exceptions::KeybaseNotRunningError] if Keybase is not running
|
62
62
|
def running_version
|
63
|
-
raise KeybaseNotRunningError unless Keybase.running?
|
63
|
+
raise Exceptions::KeybaseNotRunningError unless Keybase.running?
|
64
64
|
`keybase --version`.split[2]
|
65
65
|
end
|
66
66
|
end
|
data/lib/keybase/exceptions.rb
CHANGED
@@ -1,28 +1,31 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Keybase
|
4
|
-
# A
|
5
|
-
|
6
|
-
|
4
|
+
# A namespace for all exceptions defined by {Keybase}.
|
5
|
+
module Exceptions
|
6
|
+
# A top-level exception for the library.
|
7
|
+
class KeybaseError < RuntimeError
|
8
|
+
end
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
# Raised if a Keybase installation can't be found.
|
11
|
+
class KeybaseNotInstalledError < KeybaseError
|
12
|
+
def initialize
|
13
|
+
super "keybase needs to be installed"
|
14
|
+
end
|
12
15
|
end
|
13
|
-
end
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
# Raised whenever Keybase is not running locally.
|
18
|
+
class KeybaseNotRunningError < KeybaseError
|
19
|
+
def initialize
|
20
|
+
super "keybase needs to be running"
|
21
|
+
end
|
19
22
|
end
|
20
|
-
end
|
21
23
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
# Raised whenever KBFS is not running locally.
|
25
|
+
class KBFSNotRunningError < KeybaseError
|
26
|
+
def initialize
|
27
|
+
super "KBFS needs to be enabled and running"
|
28
|
+
end
|
26
29
|
end
|
27
30
|
end
|
28
31
|
end
|
data/lib/keybase/kbfs.rb
CHANGED
@@ -4,11 +4,11 @@ module Keybase
|
|
4
4
|
# Represents the Keybase filesystem.
|
5
5
|
# @note This is just a stub for the time being.
|
6
6
|
class KBFS
|
7
|
-
# @raise [KeybaseNotRunningError] unless Keybase is running
|
8
|
-
# @raise [KBFSNotRunningError] unless KBFS is running
|
7
|
+
# @raise [Exceptions::KeybaseNotRunningError] unless Keybase is running
|
8
|
+
# @raise [Exceptions::KBFSNotRunningError] unless KBFS is running
|
9
9
|
def initialize
|
10
|
-
raise KeybaseNotRunningError unless Keybase.running?
|
11
|
-
raise KBFSNotRunningError unless Dir.exist?("/keybase")
|
10
|
+
raise Exceptions::KeybaseNotRunningError unless Keybase.running?
|
11
|
+
raise Exceptions::KBFSNotRunningError unless Dir.exist?("/keybase")
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
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.
|
4
|
+
version: 0.3.0
|
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-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
61
|
version: '0'
|
62
62
|
requirements: []
|
63
63
|
rubyforge_project:
|
64
|
-
rubygems_version: 2.6.
|
64
|
+
rubygems_version: 2.6.13
|
65
65
|
signing_key:
|
66
66
|
specification_version: 4
|
67
67
|
summary: keybase-unofficial - An unofficial library for Keybase.
|