etwin 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +13 -3
- data/etwin.gemspec +1 -1
- data/lib/etwin.rb +1 -0
- data/lib/etwin/client.rb +1 -0
- data/lib/etwin/client/etwin_client.rb +2 -2
- data/lib/etwin/client/http_etwin_client.rb +2 -2
- data/lib/etwin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93bf9e25afc02f993f8e9bd60a89b36632cfe75cf1ebbd83ec55cd0a64204feb
|
4
|
+
data.tar.gz: edd4742d85abeea8b2806e655c8ac32854292a44c4ed8faef1f12ef7815653bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9456347bcff0462844e2f69119b50aecae08a19a47ccdd89cf8196e0a3c9d36ff9c3ced6b73d8e04bd3b6914c2d62d47aab234e4697ab59f52cea7d20884642
|
7
|
+
data.tar.gz: 182fc1f1c91ad71050872b879de8373c39f603804b0181ae9f864dc5e85f17437b453dc9bbdf67056f1b5da7095ca87956f6a0d449817d2416c461e4ecaa1cfd
|
data/README.md
CHANGED
@@ -16,7 +16,15 @@ bundle install
|
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
19
|
-
|
19
|
+
```ruby
|
20
|
+
require 'etwin'
|
21
|
+
|
22
|
+
# ...
|
23
|
+
|
24
|
+
client = Etwin::Client::HttpEtwinClient.new(URI.parse("https://eternal-twin.net"))
|
25
|
+
user = client.get_user(Etwin::Client::Auth::Guest, Etwin::User::UserId.new("9f310484-963b-446b-af69-797feec6813f"))
|
26
|
+
pp user
|
27
|
+
```
|
20
28
|
|
21
29
|
## Development
|
22
30
|
|
@@ -24,7 +32,9 @@ TODO
|
|
24
32
|
bundle install
|
25
33
|
bundle exec rubocop
|
26
34
|
bundle exec rspec
|
27
|
-
bundle exec rake release
|
28
|
-
bundle exec rake install
|
35
|
+
# bundle exec rake release
|
36
|
+
# bundle exec rake install
|
29
37
|
bundle exec srb tc
|
38
|
+
# gem build
|
39
|
+
# gem push ...
|
30
40
|
```
|
data/etwin.gemspec
CHANGED
@@ -7,11 +7,11 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.version = Etwin::VERSION
|
8
8
|
spec.authors = ['Charles Samborski']
|
9
9
|
spec.email = ['demurgos@demurgos.net']
|
10
|
-
spec.licenses = ['AGPL-3.0-or-later']
|
11
10
|
|
12
11
|
spec.summary = 'Ruby client for the Eternal-Twin API.'
|
13
12
|
spec.description = 'Ruby client for the Eternal-Twin API. Defines Etwin domain types and HTTP client.'
|
14
13
|
spec.homepage = 'https://gitlab.com/eternal-twin/etwin'
|
14
|
+
spec.license = 'AGPL-3.0-or-later'
|
15
15
|
spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
|
16
16
|
|
17
17
|
spec.metadata['homepage_uri'] = spec.homepage
|
data/lib/etwin.rb
CHANGED
data/lib/etwin/client.rb
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
module Etwin
|
5
5
|
module Client
|
6
6
|
# Etwin client interface
|
7
|
-
|
7
|
+
module EtwinClient
|
8
8
|
extend T::Helpers
|
9
9
|
extend T::Sig
|
10
10
|
|
11
11
|
interface!
|
12
12
|
|
13
|
-
sig { abstract.params(auth: Auth, user_id: UserId).returns(User) }
|
13
|
+
sig { abstract.params(auth: Auth, user_id: Etwin::User::UserId).returns(Etwin::User::User) }
|
14
14
|
def get_user(auth, user_id); end
|
15
15
|
end
|
16
16
|
end
|
@@ -18,11 +18,11 @@ module Etwin
|
|
18
18
|
freeze
|
19
19
|
end
|
20
20
|
|
21
|
-
sig(:final) { params(auth: Auth, user_id: UserId).returns(User) }
|
21
|
+
sig(:final) { override.params(auth: Auth, user_id: Etwin::User::UserId).returns(Etwin::User::User) }
|
22
22
|
def get_user(auth, user_id)
|
23
23
|
uri = resolve(['users', user_id.to_s])
|
24
24
|
res = Faraday.get uri
|
25
|
-
|
25
|
+
Etwin::User::User.from_json res.body
|
26
26
|
end
|
27
27
|
|
28
28
|
private
|
data/lib/etwin/version.rb
CHANGED