keybase-unofficial-local 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/keybase/local.rb +1 -1
- data/lib/keybase/local/kbfs.rb +14 -8
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05d2db9b79b7345a485cfb6bea7909e7fde2e465
|
4
|
+
data.tar.gz: '08319c5cad2c89da0a2903aa72cfd21b2ecbfba2'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fba3cb63b897b8f213a1a1a26ec48b4fbbf58ecba79c72a7e6d0c3e0e7d38959a9df8b62e3c27af2c1c76015e01c8f6ab349e60c81f2f8906fe9e93c1b84feb
|
7
|
+
data.tar.gz: e5a7b079d0f69866eeb0c7f15a0442fb0797020dc80c4cb99210a178d683b1e715b72d6de29099dee182671c4e94134b218c254d94074fd15d6c9624c4030e6f
|
data/lib/keybase/local.rb
CHANGED
data/lib/keybase/local/kbfs.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require "json"
|
4
4
|
require "ostruct"
|
5
|
+
require "sys/filesystem"
|
5
6
|
|
6
7
|
module Keybase
|
7
8
|
module Local
|
@@ -29,20 +30,25 @@ module Keybase
|
|
29
30
|
end
|
30
31
|
|
31
32
|
# @return [Boolean] whether or not KBFS is currently mounted
|
32
|
-
# @note
|
33
|
+
# @note {mounted?} does *not* mean that KBFS is fully functional. For that, see
|
34
|
+
# {functional?}
|
35
|
+
def mounted?
|
36
|
+
Sys::Filesystem.mounts.any? { |m| m.mount_point == Config::KBFS_MOUNT }
|
37
|
+
end
|
38
|
+
|
39
|
+
# @return [Boolean] whether or not KBFS is currently fully functional
|
40
|
+
# @note The criteria for being "functional" is as follows:
|
33
41
|
# 1. Keybase is running
|
34
42
|
# 2. KBFS is running
|
35
|
-
# 3. {
|
36
|
-
def
|
37
|
-
|
38
|
-
return false unless running?
|
39
|
-
File.exist? KBFS_STATUS_FILE
|
43
|
+
# 3. {KBFS_MOUNT} is mounted
|
44
|
+
def functional?
|
45
|
+
Local.running? && running? && mounted?
|
40
46
|
end
|
41
47
|
|
42
48
|
# @return [OpenStruct] a struct mapping of the contents of {KBFS_STATUS_FILE}
|
43
|
-
# @raise [Exceptions::KBFSNotRunningError] if KBFS is not
|
49
|
+
# @raise [Exceptions::KBFSNotRunningError] if KBFS is not functional
|
44
50
|
def status
|
45
|
-
raise Exceptions::KBFSNotRunningError unless
|
51
|
+
raise Exceptions::KBFSNotRunningError unless functional?
|
46
52
|
JSON.parse File.read(KBFS_STATUS_FILE), object_class: OpenStruct
|
47
53
|
end
|
48
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keybase-unofficial-local
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.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-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: keybase-unofficial-core
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sys-filesystem
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.1'
|
27
41
|
description: |
|
28
42
|
This library provides access to Keybase's desktop utility from
|
29
43
|
Ruby.
|