keybase-unofficial-local 0.0.6 → 0.1.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/local/kbfs.rb +22 -2
- data/lib/keybase/local.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: 5555fb9991555773e853cc654333e6ae2d673ac3
|
4
|
+
data.tar.gz: 160f3018590b1925ea7e5cc0498588116c49a036
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73f0c186ddfe2d3d34e055d0c6dd8f2c782521e68ae5b1484664b8189c56268ea4b94808d39ec1973876fed7604fdb786c48ce16db058c2021fc3fc487dca42c
|
7
|
+
data.tar.gz: 7f9ab2d86d5262b189d660baaf818cd29ce425994a668e7f6a93e19a6342d4eb3f8f5d9487590e4e20c990b83e82efbc57b27e3319454f345c531698962addb7
|
data/lib/keybase/local/kbfs.rb
CHANGED
@@ -1,11 +1,31 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "json"
|
4
|
+
require "ostruct"
|
5
|
+
|
3
6
|
module Keybase
|
4
7
|
module Local
|
5
8
|
# Represents an interface to KBFS.
|
6
|
-
# @note This is a stub.
|
7
9
|
module KBFS
|
8
|
-
#
|
10
|
+
# The path to a hidden status file on KBFS.
|
11
|
+
# @note The presence of this file is used to determine whether or not the mountpoint
|
12
|
+
# is actually KBFS or just a directory (since an accidental directory at the mountpoint
|
13
|
+
# is unlikely to contain this file).
|
14
|
+
KBFS_STATUS_FILE = File.join Config::KBFS_MOUNT, ".kbfs_status"
|
15
|
+
|
16
|
+
class << self
|
17
|
+
# @return [Boolean] whether KBFS is currently mounted
|
18
|
+
def mounted?
|
19
|
+
File.exist? KBFS_STATUS_FILE
|
20
|
+
end
|
21
|
+
|
22
|
+
# @return [OpenStruct] a struct mapping of the contents of {KBFS_STATUS_FILE}
|
23
|
+
# @raise [Exceptions::KBFSNotRunningError] if KBFS is not mounted
|
24
|
+
def status
|
25
|
+
raise Exceptions::KBFSNotRunningError unless mounted?
|
26
|
+
JSON.parse File.read(KBFS_STATUS_FILE), object_class: OpenStruct
|
27
|
+
end
|
28
|
+
end
|
9
29
|
end
|
10
30
|
end
|
11
31
|
end
|
data/lib/keybase/local.rb
CHANGED
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.0
|
4
|
+
version: 0.1.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-10-
|
11
|
+
date: 2017-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: keybase-unofficial-core
|