keybase-unofficial 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92b8d2bb03033f025a8a8e778f11d5e2d470a88a
4
- data.tar.gz: 9fb4001568fcddebd690431706c93d87459e2e87
3
+ metadata.gz: 0cf9b9651e3ebf2edfa9ccc0c81a99d1154329b3
4
+ data.tar.gz: 741fa785ae6295790985102ffda9535930a95f34
5
5
  SHA512:
6
- metadata.gz: c42a9078a6129bd77e4aa06c73dd6b7525883638fec692fcf645012b89d75714598b6d708faaa8f7d4d2fe8e02fd0250a277237892910805de28a0425608213e
7
- data.tar.gz: 3947bf4f71286973f63966a1f444ba2a2a6a2f8c495a216a241f41fdd93a360e4a831ca2f9100cfe61804851f8b30fd071e85ddb517c578211a4af2b63f951b1
6
+ metadata.gz: f5d2ef8ffcc544e1777528275159a802209aa96b0437f18ef86552fba69c7e1015241215a575316e831053c3b62b46c6ef59a18147414d0e6f955a3c77864a74
7
+ data.tar.gz: 7df09eef6f159e6c50cd1f7f6e4f599e1c93f3953caa9f03ed3b857725c5d44b5e71ab61d3c08d3eb7e927f75a3f5532e1e61c01873b77965f8065ef6c5d3331
data/lib/keybase.rb CHANGED
@@ -11,7 +11,7 @@ require_relative "keybase/chat"
11
11
  # The primary namespace for keybase-unofficial.
12
12
  module Keybase
13
13
  # keybase-unofficial's current version
14
- VERSION = "0.0.7"
14
+ VERSION = "0.0.8"
15
15
 
16
16
  extend Configuration
17
17
  end
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 = File.expand_path("~/.config/keybase").freeze
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
- # is there a more efficient way to do this that doesn't involve an exec?
44
- Dir["/proc/[0-9]*/comm"].any? do |comm|
45
- File.read(comm).chomp == "keybase" rescue false # hooray for TOCTOU
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
 
@@ -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 = fields["id"]
28
- @name = fields["name"]
29
- @salt = fields["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.7
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-03 00:00:00.000000000 Z
11
+ date: 2017-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday