etwin 0.0.1 → 0.0.2

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
  SHA256:
3
- metadata.gz: 91479b28b00a4f5f8225a418c5f1f742fdd71554d00afbb5c4c5fe69858152fa
4
- data.tar.gz: ed39199b30be361b3568339b75d288f0706531aac94598fb0b63f74d25448b36
3
+ metadata.gz: 93bf9e25afc02f993f8e9bd60a89b36632cfe75cf1ebbd83ec55cd0a64204feb
4
+ data.tar.gz: edd4742d85abeea8b2806e655c8ac32854292a44c4ed8faef1f12ef7815653bd
5
5
  SHA512:
6
- metadata.gz: 2a5758dfe8e51877b210a3ee1e98f183d020c122582f107a68c031acc85564054b351bc94c4d26d7faa358497bfa6682c4b27a1e12e2c5bbab85922fce5ca6c9
7
- data.tar.gz: ef84e9e060c0b7a7002b3d02a878f15d440f81543e2e9879f94a88c59ca15ff2f97e3d5ae0d286466f127b456fdf9a20a01cc156fdd29ba9ddf523c29b0dc4d4
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
- TODO
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
  ```
@@ -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
@@ -17,6 +17,7 @@ module Etwin
17
17
  end
18
18
 
19
19
  require_relative './etwin/auth'
20
+ require_relative './etwin/client'
20
21
  require_relative './etwin/core'
21
22
  require_relative './etwin/hammerfest'
22
23
  require_relative './etwin/link'
@@ -9,3 +9,4 @@ end
9
9
 
10
10
  require_relative './client/auth'
11
11
  require_relative './client/etwin_client'
12
+ require_relative './client/http_etwin_client'
@@ -4,13 +4,13 @@
4
4
  module Etwin
5
5
  module Client
6
6
  # Etwin client interface
7
- class EtwinClient
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
- pp res
25
+ Etwin::User::User.from_json res.body
26
26
  end
27
27
 
28
28
  private
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Etwin
5
- VERSION = '0.0.1'
5
+ VERSION = '0.0.2'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etwin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Samborski