keybase-unofficial-local 0.1.0 → 0.1.1

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: 5555fb9991555773e853cc654333e6ae2d673ac3
4
- data.tar.gz: 160f3018590b1925ea7e5cc0498588116c49a036
3
+ metadata.gz: c9abc92bbf6c5c1e35a0f214950abf59dfffe6ad
4
+ data.tar.gz: 833f5c2a500127851944c3d18857a1c7fdfda64c
5
5
  SHA512:
6
- metadata.gz: 73f0c186ddfe2d3d34e055d0c6dd8f2c782521e68ae5b1484664b8189c56268ea4b94808d39ec1973876fed7604fdb786c48ce16db058c2021fc3fc487dca42c
7
- data.tar.gz: 7f9ab2d86d5262b189d660baaf818cd29ce425994a668e7f6a93e19a6342d4eb3f8f5d9487590e4e20c990b83e82efbc57b27e3319454f345c531698962addb7
6
+ metadata.gz: 36ab4b95a42f5be43feacdf40d7d6e234264759098741863e8cc035f690fccb40abc52b14885290b38750b00791e9002230014b5a7a39b8dbeb2b901ba8c0436
7
+ data.tar.gz: 113b4a5985bd2cf4d7e945563acb24cada98e4a5695c5fa2644fc7421791efc01b97f202ee16765bf6215cc1c00b0c50e4dd2ebda6dfc7542295f3a33820ebd8
@@ -14,8 +14,28 @@ module Keybase
14
14
  KBFS_STATUS_FILE = File.join Config::KBFS_MOUNT, ".kbfs_status"
15
15
 
16
16
  class << self
17
- # @return [Boolean] whether KBFS is currently mounted
17
+ # @return [Boolean] whether or not KBFS is currently running
18
+ # @note {running?} does *not* mean that KBFS is mounted. For that, see {mounted?}
19
+ def running?
20
+ if Gem.win_platform?
21
+ !`tasklist | find "kbfsfuse.exe"`.empty?
22
+ elsif RUBY_PLATFORM =~ /darwin/
23
+ !`pgrep kbfsfuse`.empty?
24
+ else
25
+ Dir["/proc/[0-9]*/comm"].any? do |comm|
26
+ File.read(comm).chomp == "kbfsfuse" rescue false
27
+ end
28
+ end
29
+ end
30
+
31
+ # @return [Boolean] whether or not KBFS is currently mounted
32
+ # @note The criteria for being mounted is as follows:
33
+ # 1. Keybase is running
34
+ # 2. KBFS is running
35
+ # 3. {KBFS_STATUS_FILE} exists
18
36
  def mounted?
37
+ return false unless Local.running?
38
+ return false unless running?
19
39
  File.exist? KBFS_STATUS_FILE
20
40
  end
21
41
 
data/lib/keybase/local.rb CHANGED
@@ -14,7 +14,7 @@ module Keybase
14
14
  # The namespace for `keybase-unofficial-local`.
15
15
  module Local
16
16
  # The current version of `keybase-unofficial-local`.
17
- VERSION = "0.1.0"
17
+ VERSION = "0.1.1"
18
18
 
19
19
  extend Config
20
20
  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.1.0
4
+ version: 0.1.1
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-24 00:00:00.000000000 Z
11
+ date: 2017-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: keybase-unofficial-core