keybase-unofficial 0.0.4 → 0.0.5

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: 569fd96fa1a8332e7d7e88d64e2214f7eef12cc5
4
- data.tar.gz: 88477e5dab7b71a7aabcd2161243d90b0937521e
3
+ metadata.gz: c65d684f169a40ef888365599b327bc4fc33b087
4
+ data.tar.gz: c621a15ee3e4af35db7ace294a3378452d947f6c
5
5
  SHA512:
6
- metadata.gz: 4f725902a0cb3264d2b7541fef4a729b634f2ed67903c00073b40e94c0fd4f8cf1216495a94d0e5021c0dc891c4715f8653b6f0638e8665185ca888cd9cda92a
7
- data.tar.gz: c96ebe40d9789ba5bfed0e9cd1e0a26da8565cbb586a83d9deebbe0872d1c7bd52858ae6f153dd252cfc5dd1c2dbcc30054e0e529788376855613e224b42b7c9
6
+ metadata.gz: d0cbd85b2bf544a9374ef59c5840fb7a080a7c900d171a831b94b9308dfd3b031a5aa0888df4ac0af665f20f015e2a3f2439c737c4b18318646d8958c6792027
7
+ data.tar.gz: cd3c1cc0857fc82059d5672347d76af3aecca6881bd2c6de0a3052da809bf45922b04417eacf67e60cd0cf0e12093f2c22160f170eb0de2554d82111e22ba2e4
@@ -9,6 +9,9 @@ module Keybase
9
9
  # The Keybase configuration file.
10
10
  CONFIG_FILE = File.join(CONFIG_DIR, "config.json").freeze
11
11
 
12
+ # there's not much this library can do without a local config
13
+ raise KeybaseNotInstalledError unless File.file?(CONFIG_FILE)
14
+
12
15
  # The hash from Keybase's configuration file.
13
16
  CONFIG_HASH = JSON.parse(File.read(CONFIG_FILE)).freeze
14
17
 
@@ -37,7 +40,7 @@ module Keybase
37
40
  def running?
38
41
  # is there a more efficient way to do this that doesn't involve an exec?
39
42
  Dir["/proc/[0-9]*/comm"].any? do |comm|
40
- File.read(comm).chomp == "keybase"
43
+ File.read(comm).chomp == "keybase" rescue false # hooray for TOCTOU
41
44
  end
42
45
  end
43
46
 
@@ -3,6 +3,13 @@ module Keybase
3
3
  class KeybaseError < RuntimeError
4
4
  end
5
5
 
6
+ # Raised if a Keybase installation can't be found.
7
+ class KeybaseNotInstalledError < KeybaseError
8
+ def initialize
9
+ super "keybase needs to be installed"
10
+ end
11
+ end
12
+
6
13
  # Raised whenever Keybase is not running locally.
7
14
  class KeybaseNotRunningError < KeybaseError
8
15
  def initialize
data/lib/keybase/kbfs.rb CHANGED
@@ -8,9 +8,5 @@ module Keybase
8
8
  raise KeybaseNotRunningError unless Keybase.running?
9
9
  raise KBFSNotRunningError unless Dir.exist?("/keybase")
10
10
  end
11
-
12
- # there's nothing here yet.
13
- # i could add methods for moving files to and from the public
14
- # and private keybase directories, but that feels overkill.
15
11
  end
16
12
  end
data/lib/keybase.rb CHANGED
@@ -7,7 +7,7 @@ require_relative "keybase/api"
7
7
  # The primary namespace for keybase-unofficial.
8
8
  module Keybase
9
9
  # keybase-unofficial's current version
10
- VERSION = "0.0.4".freeze
10
+ VERSION = "0.0.5".freeze
11
11
 
12
12
  extend Configuration
13
13
  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
4
+ version: 0.0.5
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-01-28 00:00:00.000000000 Z
11
+ date: 2017-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday