keybase-unofficial 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/keybase.rb +2 -2
- data/lib/keybase/api.rb +1 -1
- data/lib/keybase/configuration.rb +4 -3
- data/lib/keybase/{user.rb → local_user.rb} +11 -6
- 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: 569fd96fa1a8332e7d7e88d64e2214f7eef12cc5
|
4
|
+
data.tar.gz: 88477e5dab7b71a7aabcd2161243d90b0937521e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f725902a0cb3264d2b7541fef4a729b634f2ed67903c00073b40e94c0fd4f8cf1216495a94d0e5021c0dc891c4715f8653b6f0638e8665185ca888cd9cda92a
|
7
|
+
data.tar.gz: c96ebe40d9789ba5bfed0e9cd1e0a26da8565cbb586a83d9deebbe0872d1c7bd52858ae6f153dd252cfc5dd1c2dbcc30054e0e529788376855613e224b42b7c9
|
data/README.md
CHANGED
@@ -7,6 +7,11 @@ An unofficial ruby library for Keybase and the Keybase API.
|
|
7
7
|
|
8
8
|
Work in progress.
|
9
9
|
|
10
|
+
### Documentation
|
11
|
+
|
12
|
+
Documentation for the current release can be found on
|
13
|
+
[RubyDoc](http://www.rubydoc.info/gems/keybase-unofficial/).
|
14
|
+
|
10
15
|
### Example
|
11
16
|
|
12
17
|
```ruby
|
data/lib/keybase.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
require_relative "keybase/exceptions"
|
2
2
|
require_relative "keybase/configuration"
|
3
|
-
require_relative "keybase/
|
3
|
+
require_relative "keybase/local_user"
|
4
4
|
require_relative "keybase/kbfs"
|
5
5
|
require_relative "keybase/api"
|
6
6
|
|
7
7
|
# The primary namespace for keybase-unofficial.
|
8
8
|
module Keybase
|
9
9
|
# keybase-unofficial's current version
|
10
|
-
VERSION = "0.0.
|
10
|
+
VERSION = "0.0.4".freeze
|
11
11
|
|
12
12
|
extend Configuration
|
13
13
|
end
|
data/lib/keybase/api.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
require "faraday"
|
2
2
|
require "json"
|
3
3
|
require "ostruct"
|
4
|
-
require "uri"
|
5
4
|
|
6
5
|
module Keybase
|
7
6
|
# Represents (parts of) the Keybase REST API.
|
7
|
+
# @see https://keybase.io/docs/api/1.0
|
8
8
|
class API
|
9
9
|
# The base URL for the majority of API calls.
|
10
10
|
BASE_URL = "https://keybase.io/_/api/1.0"
|
@@ -17,9 +17,10 @@ module Keybase
|
|
17
17
|
CONFIG_HASH["current_user"]
|
18
18
|
end
|
19
19
|
|
20
|
-
# @return [Array<Keybase::
|
21
|
-
|
22
|
-
|
20
|
+
# @return [Array<Keybase::LocalUser>] a list of all local users known
|
21
|
+
# to Keybase
|
22
|
+
def local_users
|
23
|
+
CONFIG_HASH["users"].map { |_, v| Keybase::LocalUser.new(v) }
|
23
24
|
end
|
24
25
|
|
25
26
|
# @return [String] the user's private KBFS directory
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Keybase
|
2
2
|
# Represents a user known to the local Keybase process.
|
3
3
|
# These are (presumably) users that have been logged into locally.
|
4
|
-
class
|
4
|
+
class LocalUser
|
5
5
|
# @return [String] the device's unique identifier
|
6
6
|
attr_reader :device
|
7
7
|
|
@@ -15,11 +15,16 @@ module Keybase
|
|
15
15
|
# @note I have no idea what this field does.
|
16
16
|
attr_reader :salt
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
# @param fields [Hash] the user's configuration fields
|
19
|
+
# @option fields device [String] the device's unique identifier
|
20
|
+
# @option fields id [String] the user's unique identifier
|
21
|
+
# @option fields name [String] the user's Keybase username
|
22
|
+
# @option fields salt [String] some kind of salt
|
23
|
+
def initialize(fields)
|
24
|
+
@device = fields["device"]
|
25
|
+
@id = fields["id"]
|
26
|
+
@name = fields["name"]
|
27
|
+
@salt = fields["salt"]
|
23
28
|
end
|
24
29
|
end
|
25
30
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Woodruff
|
@@ -38,7 +38,7 @@ files:
|
|
38
38
|
- lib/keybase/configuration.rb
|
39
39
|
- lib/keybase/exceptions.rb
|
40
40
|
- lib/keybase/kbfs.rb
|
41
|
-
- lib/keybase/
|
41
|
+
- lib/keybase/local_user.rb
|
42
42
|
homepage: https://github.com/woodruffw/keybase-unofficial
|
43
43
|
licenses:
|
44
44
|
- MIT
|