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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db0b875052bf623f798762c590f519e6143115f7
4
- data.tar.gz: b501af569c38574f42652f2417513371b4fc2f63
3
+ metadata.gz: 569fd96fa1a8332e7d7e88d64e2214f7eef12cc5
4
+ data.tar.gz: 88477e5dab7b71a7aabcd2161243d90b0937521e
5
5
  SHA512:
6
- metadata.gz: cd0c47e547ead2245567014a587f0023014e7d251710c3be188302b0f0915fff88fd45c952d763f391d02c30ce58a29e0e24c41dc8bbb3a5a80dff0bdf98b396
7
- data.tar.gz: c38b9d94a32786fa374de4bbef4c09cd61d9e1bb3701d7bcda497fded963b3d3daaeacaac07386bbc76f51df80cd5dcd02233e94d87be272b01fa972caa7bfea
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/user"
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.3".freeze
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::User>] a list of all local users known to Keybase
21
- def users
22
- CONFIG_HASH["users"].map { |_, v| Keybase::User.new(v) }
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 User
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
- def initialize(hsh)
19
- @device = hsh["device"]
20
- @id = hsh["id"]
21
- @name = hsh["name"]
22
- @salt = hsh["salt"]
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.3
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/user.rb
41
+ - lib/keybase/local_user.rb
42
42
  homepage: https://github.com/woodruffw/keybase-unofficial
43
43
  licenses:
44
44
  - MIT