keybase-unofficial 0.0.7 → 0.0.8
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.rb +1 -1
- data/lib/keybase/chat.rb +2 -1
- data/lib/keybase/configuration.rb +12 -4
- data/lib/keybase/local_user.rb +3 -3
- 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: 0cf9b9651e3ebf2edfa9ccc0c81a99d1154329b3
|
4
|
+
data.tar.gz: 741fa785ae6295790985102ffda9535930a95f34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5d2ef8ffcc544e1777528275159a802209aa96b0437f18ef86552fba69c7e1015241215a575316e831053c3b62b46c6ef59a18147414d0e6f955a3c77864a74
|
7
|
+
data.tar.gz: 7df09eef6f159e6c50cd1f7f6e4f599e1c93f3953caa9f03ed3b857725c5d44b5e71ab61d3c08d3eb7e927f75a3f5532e1e61c01873b77965f8065ef6c5d3331
|
data/lib/keybase.rb
CHANGED
data/lib/keybase/chat.rb
CHANGED
@@ -24,7 +24,7 @@ module Keybase
|
|
24
24
|
}.to_json
|
25
25
|
end
|
26
26
|
|
27
|
-
# @param payload [String]
|
27
|
+
# @param payload [String] the JSON payload to send to the chat API
|
28
28
|
# @return [OpenStruct] a struct mapping of the JSON response
|
29
29
|
# @api private
|
30
30
|
def chat_call(payload)
|
@@ -38,6 +38,7 @@ module Keybase
|
|
38
38
|
end
|
39
39
|
|
40
40
|
# List the user's inbox.
|
41
|
+
# @param topic_type [String] the topic type to list by
|
41
42
|
# @return [OpenStruct] a struct mapping of the JSON response
|
42
43
|
def list_inbox(topic_type: nil)
|
43
44
|
payload = envelope :list, options: {
|
@@ -6,7 +6,11 @@ module Keybase
|
|
6
6
|
# Methods and constants related to a local Keybase installation.
|
7
7
|
module Configuration
|
8
8
|
# The Keybase configuration directory.
|
9
|
-
CONFIG_DIR =
|
9
|
+
CONFIG_DIR = if Gem.win_platform?
|
10
|
+
File.expand_path("#{ENV["LOCALAPPDATA"]}/Keybase").freeze
|
11
|
+
else
|
12
|
+
File.expand_path("~/.config/keybase").freeze
|
13
|
+
end
|
10
14
|
|
11
15
|
# The Keybase configuration file.
|
12
16
|
CONFIG_FILE = File.join(CONFIG_DIR, "config.json").freeze
|
@@ -40,9 +44,13 @@ module Keybase
|
|
40
44
|
|
41
45
|
# @return [Boolean] whether or not Keybase is currently running
|
42
46
|
def running?
|
43
|
-
|
44
|
-
|
45
|
-
|
47
|
+
if Gem.win_platform?
|
48
|
+
!`tasklist | find "keybase.exe"`.empty?
|
49
|
+
else
|
50
|
+
# is there a more efficient way to do this that doesn't involve an exec?
|
51
|
+
Dir["/proc/[0-9]*/comm"].any? do |comm|
|
52
|
+
File.read(comm).chomp == "keybase" rescue false # hooray for TOCTOU
|
53
|
+
end
|
46
54
|
end
|
47
55
|
end
|
48
56
|
|
data/lib/keybase/local_user.rb
CHANGED
@@ -24,9 +24,9 @@ module Keybase
|
|
24
24
|
# @option fields salt [String] some kind of salt
|
25
25
|
def initialize(fields)
|
26
26
|
@device = fields["device"]
|
27
|
-
@id
|
28
|
-
@name
|
29
|
-
@salt
|
27
|
+
@id = fields["id"]
|
28
|
+
@name = fields["name"]
|
29
|
+
@salt = fields["salt"]
|
30
30
|
end
|
31
31
|
end
|
32
32
|
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.0.
|
4
|
+
version: 0.0.8
|
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-06-
|
11
|
+
date: 2017-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|