sferik 0.0.1
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 +7 -0
- data/.yardopts +5 -0
- data/CHANGELOG.md +72 -0
- data/LICENSE.md +16 -0
- data/README.md +517 -0
- data/exe/sferik +6 -0
- data/lib/sferik/api/code_endpoints.rb +37 -0
- data/lib/sferik/api/profile_endpoints.rb +113 -0
- data/lib/sferik/api/resume_endpoints.rb +41 -0
- data/lib/sferik/api/site_endpoints.rb +247 -0
- data/lib/sferik/api/talk_endpoints.rb +45 -0
- data/lib/sferik/api.rb +23 -0
- data/lib/sferik/block.rb +25 -0
- data/lib/sferik/body.rb +54 -0
- data/lib/sferik/cache.rb +361 -0
- data/lib/sferik/cli.rb +369 -0
- data/lib/sferik/client.rb +453 -0
- data/lib/sferik/collection.rb +82 -0
- data/lib/sferik/configuration.rb +129 -0
- data/lib/sferik/connections.rb +151 -0
- data/lib/sferik/contributions.rb +86 -0
- data/lib/sferik/day.rb +35 -0
- data/lib/sferik/dependency.rb +26 -0
- data/lib/sferik/deployment.rb +36 -0
- data/lib/sferik/errors.rb +234 -0
- data/lib/sferik/figure.rb +83 -0
- data/lib/sferik/finger.rb +74 -0
- data/lib/sferik/freshness.rb +54 -0
- data/lib/sferik/home/pages.rb +27 -0
- data/lib/sferik/home/profile.rb +51 -0
- data/lib/sferik/home/section.rb +27 -0
- data/lib/sferik/home.rb +38 -0
- data/lib/sferik/json_parsing.rb +28 -0
- data/lib/sferik/name_change.rb +49 -0
- data/lib/sferik/place.rb +33 -0
- data/lib/sferik/podcast.rb +41 -0
- data/lib/sferik/project.rb +49 -0
- data/lib/sferik/projects.rb +138 -0
- data/lib/sferik/push.rb +33 -0
- data/lib/sferik/resource.rb +373 -0
- data/lib/sferik/resume/award.rb +43 -0
- data/lib/sferik/resume/basics.rb +77 -0
- data/lib/sferik/resume/education.rb +59 -0
- data/lib/sferik/resume/location.rb +35 -0
- data/lib/sferik/resume/meta.rb +35 -0
- data/lib/sferik/resume/patent.rb +43 -0
- data/lib/sferik/resume/profile.rb +35 -0
- data/lib/sferik/resume/project.rb +27 -0
- data/lib/sferik/resume/skill.rb +27 -0
- data/lib/sferik/resume/speaking.rb +19 -0
- data/lib/sferik/resume/volunteer.rb +59 -0
- data/lib/sferik/resume/work.rb +51 -0
- data/lib/sferik/resume.rb +125 -0
- data/lib/sferik/session.rb +41 -0
- data/lib/sferik/social_profile.rb +49 -0
- data/lib/sferik/status/github.rb +38 -0
- data/lib/sferik/status/loaded.rb +48 -0
- data/lib/sferik/status.rb +33 -0
- data/lib/sferik/talk.rb +73 -0
- data/lib/sferik/talks.rb +79 -0
- data/lib/sferik/validation.rb +119 -0
- data/lib/sferik/version.rb +7 -0
- data/lib/sferik/web_finger/link.rb +46 -0
- data/lib/sferik/web_finger.rb +43 -0
- data/lib/sferik/who.rb +53 -0
- data/lib/sferik/whoami.rb +36 -0
- data/lib/sferik/wrapping.rb +114 -0
- data/lib/sferik.rb +246 -0
- data/sig/manifest.yaml +13 -0
- data/sig/sferik.rbs +825 -0
- metadata +118 -0
data/sig/sferik.rbs
ADDED
|
@@ -0,0 +1,825 @@
|
|
|
1
|
+
# Signatures for the sferik gem, checked against lib/ by Steep (rake steep) and validated by RBS (rake rbs)
|
|
2
|
+
module Sferik
|
|
3
|
+
VERSION: String
|
|
4
|
+
CLIENT_MUTEX: Thread::Mutex
|
|
5
|
+
|
|
6
|
+
extend Configuration
|
|
7
|
+
extend SingleForwardable
|
|
8
|
+
|
|
9
|
+
self.@client: Client?
|
|
10
|
+
self.@client_options: Hash[Symbol, untyped]?
|
|
11
|
+
|
|
12
|
+
def self.new: (?host: String, ?user_agent: String, ?open_timeout: Numeric, ?read_timeout: Numeric, ?write_timeout: Numeric, ?max_redirects: Integer) -> Client
|
|
13
|
+
def self.client: () -> Client
|
|
14
|
+
def self.reset: () -> self
|
|
15
|
+
|
|
16
|
+
def self.home: () -> Home
|
|
17
|
+
def self.whoami: () -> Whoami
|
|
18
|
+
def self.dependency: () -> Dependency
|
|
19
|
+
def self.finger: () -> Finger
|
|
20
|
+
def self.finger_vcard: () -> String
|
|
21
|
+
def self.name_change: () -> NameChange
|
|
22
|
+
def self.signature: () -> String
|
|
23
|
+
def self.webfinger: (?String resource) -> WebFinger
|
|
24
|
+
def self.contributions: () -> Contributions
|
|
25
|
+
def self.projects: () -> Projects
|
|
26
|
+
def self.talks: () -> Talks
|
|
27
|
+
def self.talks_feed: () -> String
|
|
28
|
+
def self.podcasts: () -> Array[Podcast]
|
|
29
|
+
def self.resume: () -> Resume
|
|
30
|
+
def self.resume_latex: () -> String
|
|
31
|
+
def self.resume_pdf: () -> String
|
|
32
|
+
def self.who: () -> Who
|
|
33
|
+
def self.check_in: (String token, ?page: String) -> Who
|
|
34
|
+
| [T] (String token, ?page: String) { (Who who) -> T } -> T
|
|
35
|
+
def self.write: (String message, ?tty: String?, ?key: String) -> String
|
|
36
|
+
def self.text: (?String path) -> String
|
|
37
|
+
def self.openapi: () -> Hash[String, untyped]
|
|
38
|
+
def self.deployment: () -> Deployment
|
|
39
|
+
def self.status: () -> Status
|
|
40
|
+
|
|
41
|
+
module Configuration : Module
|
|
42
|
+
DEFAULTS: Hash[Symbol, untyped]
|
|
43
|
+
|
|
44
|
+
def self.extended: (Configuration & Module base) -> Configuration
|
|
45
|
+
|
|
46
|
+
attr_accessor host: String
|
|
47
|
+
attr_accessor user_agent: String
|
|
48
|
+
attr_accessor open_timeout: Numeric
|
|
49
|
+
attr_accessor read_timeout: Numeric
|
|
50
|
+
attr_accessor write_timeout: Numeric
|
|
51
|
+
attr_accessor max_redirects: Integer
|
|
52
|
+
attr_accessor cache: bool
|
|
53
|
+
|
|
54
|
+
def configure: () { (self config) -> void } -> self
|
|
55
|
+
def options: () -> Hash[Symbol, untyped]
|
|
56
|
+
def reset: () -> self
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
class Error < StandardError
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
class InvalidURL < Error
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
class Unanswered < NetworkError
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
class NetworkError < Error
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
class TooManyRedirects < Error
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
module Body
|
|
75
|
+
CHARSET: Regexp
|
|
76
|
+
TEXT: Regexp
|
|
77
|
+
|
|
78
|
+
def self.of: (Net::HTTPResponse response) -> String
|
|
79
|
+
private def self.encoding_of: (Net::HTTPResponse response) -> Encoding
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
class InvalidResponse < Error
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
class HTTPError < Error
|
|
86
|
+
PLAIN_TEXT: Regexp
|
|
87
|
+
SECONDS: Regexp
|
|
88
|
+
CODE: Integer?
|
|
89
|
+
attr_reader headers: Hash[String, String]
|
|
90
|
+
attr_reader body: String
|
|
91
|
+
attr_reader code: Integer?
|
|
92
|
+
|
|
93
|
+
def initialize: (?String? message, ?code: Integer?, ?reason: String?, ?headers: Hash[String, String], ?body: String) -> void
|
|
94
|
+
def error_code: () -> String?
|
|
95
|
+
def retry_after: () -> Integer?
|
|
96
|
+
|
|
97
|
+
private
|
|
98
|
+
|
|
99
|
+
def detail: (String? reason) -> String?
|
|
100
|
+
def status_line: (String? reason) -> String?
|
|
101
|
+
def utf8: () -> String
|
|
102
|
+
def named: (String body, String key) -> String?
|
|
103
|
+
def plain: (String text) -> String?
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
class ClientError < HTTPError
|
|
107
|
+
CODE: Integer
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
class NotFound < ClientError
|
|
111
|
+
CODE: Integer
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
class NotAcceptable < ClientError
|
|
115
|
+
CODE: Integer
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
class TooManyRequests < ClientError
|
|
119
|
+
CODE: Integer
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
class ServerError < HTTPError
|
|
123
|
+
CODE: Integer
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# What the endpoints need from the class that includes them: a way to send a request, and to make something of
|
|
127
|
+
# the JSON that comes back
|
|
128
|
+
interface _Requests
|
|
129
|
+
def get: (String path, ?accept: String) -> String
|
|
130
|
+
def json: [T] (String path, ?accept: String) { (Hash[String, untyped] attributes) -> T } -> T
|
|
131
|
+
def post: (String path, ?String body, ?accept: String, ?idempotency_key: String?) -> String
|
|
132
|
+
def keep_alive: [T] () { (Client client) -> T } -> T
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
module JSONParsing
|
|
136
|
+
private
|
|
137
|
+
|
|
138
|
+
def parse_json: (String body) -> Hash[String, untyped]
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
module API : Object, _Requests
|
|
142
|
+
include CodeEndpoints
|
|
143
|
+
include ProfileEndpoints
|
|
144
|
+
include ResumeEndpoints
|
|
145
|
+
include SiteEndpoints
|
|
146
|
+
include TalkEndpoints
|
|
147
|
+
|
|
148
|
+
module ProfileEndpoints : Object, _Requests
|
|
149
|
+
include Validation
|
|
150
|
+
|
|
151
|
+
def home: () -> Home
|
|
152
|
+
def whoami: () -> Whoami
|
|
153
|
+
def dependency: () -> Dependency
|
|
154
|
+
def finger: () -> Finger
|
|
155
|
+
def finger_vcard: () -> String
|
|
156
|
+
def name_change: () -> NameChange
|
|
157
|
+
def signature: () -> String
|
|
158
|
+
def webfinger: (?String resource) -> WebFinger
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
module CodeEndpoints : Object, _Requests
|
|
162
|
+
def contributions: () -> Contributions
|
|
163
|
+
def projects: () -> Projects
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
module TalkEndpoints : Object, _Requests
|
|
167
|
+
def talks: () -> Talks
|
|
168
|
+
def talks_feed: () -> String
|
|
169
|
+
def podcasts: () -> Array[Podcast]
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
module ResumeEndpoints : Object, _Requests
|
|
173
|
+
def resume: () -> Resume
|
|
174
|
+
def resume_latex: () -> String
|
|
175
|
+
def resume_pdf: () -> String
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
module SiteEndpoints : Object, _Requests
|
|
179
|
+
include JSONParsing
|
|
180
|
+
include Validation
|
|
181
|
+
|
|
182
|
+
def who: () -> Who
|
|
183
|
+
def check_in: (String token, ?page: String) -> Who
|
|
184
|
+
| [T] (String token, ?page: String) { (Who who) -> T } -> T
|
|
185
|
+
def write: (String message, ?tty: String?, ?key: String) -> String
|
|
186
|
+
def text: (?String path) -> String
|
|
187
|
+
def openapi: () -> Hash[String, untyped]
|
|
188
|
+
def deployment: () -> Deployment
|
|
189
|
+
def status: () -> Status
|
|
190
|
+
|
|
191
|
+
PAUSE: Integer
|
|
192
|
+
BEAT: Integer
|
|
193
|
+
|
|
194
|
+
private
|
|
195
|
+
|
|
196
|
+
def logged_in: [T] (String token, String page, Who who) { (Who who) -> T } -> T
|
|
197
|
+
def beat: (String token, String page) -> bot
|
|
198
|
+
|
|
199
|
+
def deliver: (String path, String message, String key) -> String
|
|
200
|
+
def settle: (String path, String message, String key) -> String
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
class CLI
|
|
205
|
+
COMMANDS: Hash[String, String]
|
|
206
|
+
USAGE: String
|
|
207
|
+
|
|
208
|
+
# What makes the client for a host: the Client class
|
|
209
|
+
interface _Clients
|
|
210
|
+
def new: (host: String) -> _Client
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# What the command asks of a client
|
|
214
|
+
interface _Client
|
|
215
|
+
def get: (String path, ?accept: String) -> String
|
|
216
|
+
def write: (String message, ?tty: String?) -> String
|
|
217
|
+
def check_in: (String token) -> Who
|
|
218
|
+
| [T] (String token) { (Who who) -> T } -> T
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# The environment: ENV, or a Hash
|
|
222
|
+
interface _Environment
|
|
223
|
+
def fetch: (String name, String default) -> String
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
PROMPT: String
|
|
227
|
+
FORMATS: Hash[String, String]
|
|
228
|
+
VALUES: Hash[String, Symbol]
|
|
229
|
+
OWNERS: Hash[Symbol, String]
|
|
230
|
+
ACTIONS: Hash[Symbol | String, Array[Symbol | String]]
|
|
231
|
+
|
|
232
|
+
@client: _Clients?
|
|
233
|
+
@input: IO
|
|
234
|
+
@out: IO
|
|
235
|
+
@err: IO
|
|
236
|
+
@env: _Environment
|
|
237
|
+
|
|
238
|
+
def initialize: (?client: _Clients?, ?input: IO, ?out: IO, ?err: IO, ?env: _Environment) -> void
|
|
239
|
+
def run: (Array[String] argv) -> Integer
|
|
240
|
+
|
|
241
|
+
private
|
|
242
|
+
|
|
243
|
+
def dispatch: (Array[String] argv) -> Integer
|
|
244
|
+
def perform: (String? command, Hash[Symbol, untyped] options) -> Integer
|
|
245
|
+
def usage: (Hash[Symbol, untyped] _options) -> Integer
|
|
246
|
+
def version: (Hash[Symbol, untyped] _options) -> Integer
|
|
247
|
+
def parser: (Hash[Symbol, untyped] options) -> OptionParser
|
|
248
|
+
def show: (String path, Hash[Symbol, untyped] options) -> Integer
|
|
249
|
+
def unformatted: (Hash[Symbol, untyped] options) { () -> Integer } -> Integer
|
|
250
|
+
def write: (Hash[Symbol, untyped] options) -> Integer
|
|
251
|
+
def check_in: (Hash[Symbol, untyped] options) -> Integer
|
|
252
|
+
def token: (Hash[Symbol, untyped] options) -> String
|
|
253
|
+
def stay: (_Client client, String token) -> String
|
|
254
|
+
def named: (Who who) -> String
|
|
255
|
+
def only: (String path, String accept, Hash[Symbol, untyped] options) -> Integer
|
|
256
|
+
def ask: (Hash[Symbol, untyped] options) { (_Client client) -> String } -> Integer
|
|
257
|
+
def clients: () -> _Clients
|
|
258
|
+
def library: () -> bool
|
|
259
|
+
def print_body: (String body) -> Integer
|
|
260
|
+
def redirected: [T] (T binary) -> T
|
|
261
|
+
def say: (String text) -> Integer
|
|
262
|
+
def misuse: (_ToS problem) -> Integer
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
module Validation
|
|
266
|
+
private
|
|
267
|
+
|
|
268
|
+
def check: (Symbol option, untyped value, Class type) -> untyped
|
|
269
|
+
def boolean: (Symbol option, untyped value) -> bool
|
|
270
|
+
def one_line: (Symbol option, String value) -> String
|
|
271
|
+
def seconds: (Symbol option, untyped value) -> Numeric
|
|
272
|
+
def positive: (Symbol option, Numeric value) -> Numeric
|
|
273
|
+
def http_url: (String value) -> String
|
|
274
|
+
def not_negative: (Symbol option, Integer value) -> Integer
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
class Client
|
|
278
|
+
include API
|
|
279
|
+
include JSONParsing
|
|
280
|
+
include Validation
|
|
281
|
+
|
|
282
|
+
UNLABELED: Array[Encoding]
|
|
283
|
+
PLAIN_TEXT: String
|
|
284
|
+
|
|
285
|
+
attr_reader host: String
|
|
286
|
+
attr_reader user_agent: String
|
|
287
|
+
attr_reader open_timeout: Numeric
|
|
288
|
+
attr_reader read_timeout: Numeric
|
|
289
|
+
attr_reader write_timeout: Numeric
|
|
290
|
+
attr_reader max_redirects: Integer
|
|
291
|
+
|
|
292
|
+
def initialize: (?host: String, ?user_agent: String, ?open_timeout: Numeric, ?read_timeout: Numeric, ?write_timeout: Numeric, ?max_redirects: Integer, ?cache: bool) -> void
|
|
293
|
+
def get: (String path, ?accept: String) -> String
|
|
294
|
+
def post: (String path, ?String body, ?accept: String, ?idempotency_key: String?) -> String
|
|
295
|
+
def keep_alive: [T] () { (Client client) -> T } -> T
|
|
296
|
+
def close: () -> nil
|
|
297
|
+
def cached: (?stale_if_error: bool) -> Client
|
|
298
|
+
def cache?: () -> bool
|
|
299
|
+
def inspect: () -> String
|
|
300
|
+
def json: [T] (String path, ?accept: String) { (Hash[String, untyped] attributes) -> T } -> T
|
|
301
|
+
|
|
302
|
+
@connections: _Connections?
|
|
303
|
+
|
|
304
|
+
def keep: (_Connections connections) -> Client
|
|
305
|
+
|
|
306
|
+
private
|
|
307
|
+
|
|
308
|
+
def got: (URI::Generic uri, String accept) -> Net::HTTPResponse
|
|
309
|
+
def success: (Net::HTTPResponse response) -> Net::HTTPResponse
|
|
310
|
+
def caching: (untyped cache) -> Cache?
|
|
311
|
+
def connections: () -> _Connections
|
|
312
|
+
def uri_for: (String path) -> URI::Generic
|
|
313
|
+
def fetch: (URI::Generic uri, String accept, Integer redirects) -> Net::HTTPResponse
|
|
314
|
+
def redirect: (Net::HTTPResponse response, URI::Generic uri) -> URI::Generic?
|
|
315
|
+
def utf8: (String body) -> String
|
|
316
|
+
def headers: (String accept) -> Hash[String, String]
|
|
317
|
+
def post_headers: (untyped accept, untyped key) -> Hash[String, String]
|
|
318
|
+
def error_for: (Net::HTTPResponse response, ?String? message) -> HTTPError
|
|
319
|
+
def error_class: (Net::HTTPResponse response) -> singleton(HTTPError)
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# What a client makes its requests over: connections, or a cache over them
|
|
323
|
+
interface _Connections
|
|
324
|
+
def instance_of?: (Class klass) -> bool
|
|
325
|
+
def request: (Net::HTTPRequest request) -> Net::HTTPResponse
|
|
326
|
+
def made: [T] (URI::Generic uri, String accept, Net::HTTPResponse response) { () -> T } -> T
|
|
327
|
+
def keeping: [T] () { (_Connections connections) -> T } -> T
|
|
328
|
+
def close: () -> nil
|
|
329
|
+
def uncached: () -> _Connections
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
module Freshness
|
|
333
|
+
MAX_AGE: Regexp
|
|
334
|
+
NO_CACHE: Regexp
|
|
335
|
+
NO_STORE: Regexp
|
|
336
|
+
|
|
337
|
+
def self.lifetime: (Net::HTTPResponse answer) -> Integer
|
|
338
|
+
def self.left: (Net::HTTPResponse answer) -> Integer
|
|
339
|
+
def self.keepable?: (Net::HTTPResponse answer) -> bool
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
class Cache
|
|
343
|
+
class Entry < Data
|
|
344
|
+
attr_reader response: Net::HTTPResponse
|
|
345
|
+
attr_reader etag: String?
|
|
346
|
+
attr_reader expires: Numeric
|
|
347
|
+
attr_reader made: untyped
|
|
348
|
+
|
|
349
|
+
def self.new: (Net::HTTPResponse response, String? etag, Numeric expires, untyped made) -> Entry
|
|
350
|
+
def with: (?expires: Numeric, ?made: untyped) -> Entry
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
class Flight
|
|
354
|
+
@landed: Queue
|
|
355
|
+
@response: Net::HTTPResponse?
|
|
356
|
+
|
|
357
|
+
def initialize: () -> void
|
|
358
|
+
def fly: () { () -> Net::HTTPResponse } -> Net::HTTPResponse
|
|
359
|
+
def response: () -> Net::HTTPResponse?
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
type key = [URI::Generic, String]
|
|
363
|
+
|
|
364
|
+
CLOCK: ^() -> Float
|
|
365
|
+
LIMIT: Integer
|
|
366
|
+
|
|
367
|
+
@connections: _Connections
|
|
368
|
+
@clock: ^() -> Numeric
|
|
369
|
+
@entries: Hash[key, Entry]
|
|
370
|
+
@lock: Mutex
|
|
371
|
+
@flights: Hash[key, Flight]
|
|
372
|
+
@stale: bool
|
|
373
|
+
|
|
374
|
+
def initialize: (_Connections connections, ?^() -> Numeric clock, ?Hash[key, Entry] entries, ?Mutex lock, ?stale: bool) -> void
|
|
375
|
+
def keeping: [T] () { (_Connections connections) -> T } -> T
|
|
376
|
+
def close: () -> nil
|
|
377
|
+
def uncached: () -> _Connections
|
|
378
|
+
def request: (Net::HTTPRequest request) -> Net::HTTPResponse
|
|
379
|
+
def made: [T] (URI::Generic uri, String accept, Net::HTTPResponse response) { () -> T } -> T
|
|
380
|
+
def over: (_Connections connections) -> Cache
|
|
381
|
+
|
|
382
|
+
private
|
|
383
|
+
|
|
384
|
+
def share: (key key) { () -> Net::HTTPResponse } -> Net::HTTPResponse
|
|
385
|
+
def lead: (key key, Flight flight) { () -> Net::HTTPResponse } -> Net::HTTPResponse
|
|
386
|
+
def renew: (key key, Entry? entry, Net::HTTPRequest request) -> Net::HTTPResponse
|
|
387
|
+
def ask: (key key, Entry? entry, Net::HTTPRequest request) -> Net::HTTPResponse
|
|
388
|
+
def renewed: (key key, Entry? entry, Net::HTTPResponse response) -> Net::HTTPResponse
|
|
389
|
+
def spared: (Entry entry, Net::HTTPResponse response) -> Net::HTTPResponse
|
|
390
|
+
def remember: [T] (key key, Entry entry, T made) -> T
|
|
391
|
+
def keep: (key key, Entry entry, Net::HTTPResponse answer) -> void
|
|
392
|
+
def hold: (key key, Entry entry) -> void
|
|
393
|
+
def expiry: (Net::HTTPResponse latest) -> Numeric
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
class Connections
|
|
397
|
+
NETWORK_ERRORS: Array[singleton(Exception)]
|
|
398
|
+
|
|
399
|
+
type timeouts = { open_timeout: Numeric, read_timeout: Numeric, write_timeout: Numeric }
|
|
400
|
+
type kept = Hash[[Integer, String?, String?, Integer?, timeouts], Net::HTTP]
|
|
401
|
+
|
|
402
|
+
KEEP_ALIVE: Integer
|
|
403
|
+
OPENED: Symbol
|
|
404
|
+
|
|
405
|
+
@timeouts: timeouts
|
|
406
|
+
@kept: kept?
|
|
407
|
+
|
|
408
|
+
def initialize: (timeouts timeouts, ?kept? kept) -> void
|
|
409
|
+
def keeping: [T] (?kept kept) { (Connections connections) -> T } -> T
|
|
410
|
+
def request: (Net::HTTPRequest request) -> Net::HTTPResponse
|
|
411
|
+
def made: [T] (URI::Generic _uri, String _accept, Net::HTTPResponse _response) { () -> T } -> T
|
|
412
|
+
def close: () -> nil
|
|
413
|
+
def uncached: () -> Connections
|
|
414
|
+
|
|
415
|
+
private
|
|
416
|
+
|
|
417
|
+
def connection: (URI::Generic uri) -> Net::HTTP
|
|
418
|
+
def kept: () -> kept
|
|
419
|
+
def start: (URI::Generic uri) -> Net::HTTP
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
module PartialDate
|
|
423
|
+
def self.iso8601: (String value) -> Date
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
interface _ISO8601Parser
|
|
427
|
+
def iso8601: (String value) -> untyped
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
module Wrapping
|
|
431
|
+
include Validation
|
|
432
|
+
|
|
433
|
+
private
|
|
434
|
+
|
|
435
|
+
def given: (untyped value, untyped otherwise) -> untyped
|
|
436
|
+
def wrap: (untyped value, singleton(Resource)? type) -> untyped
|
|
437
|
+
def wrap_list: (Symbol name, untyped list, singleton(Resource)? type) -> Array[untyped]
|
|
438
|
+
def wrap_dictionary: (Symbol name, untyped dictionary, singleton(Resource) type) -> Hash[String, Resource]
|
|
439
|
+
def wrap_timestamp: (Symbol name, untyped value, Object & _ISO8601Parser parser) -> untyped
|
|
440
|
+
def build: (singleton(Resource) type, untyped value) -> Resource
|
|
441
|
+
def deep_freeze: (untyped value) -> untyped
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
class Resource
|
|
445
|
+
include Wrapping
|
|
446
|
+
|
|
447
|
+
EMPTY: Array[untyped]
|
|
448
|
+
NONE: Hash[untyped, untyped]
|
|
449
|
+
|
|
450
|
+
self.@readers: Hash[Symbol, Symbol]?
|
|
451
|
+
self.@preparations: Hash[Symbol, ^() [self: Resource] -> untyped]?
|
|
452
|
+
@prepared: Hash[Symbol, untyped]
|
|
453
|
+
self.@keys: Array[String]?
|
|
454
|
+
self.@inspected: Array[Symbol]?
|
|
455
|
+
|
|
456
|
+
attr_reader attributes: Hash[String, untyped]
|
|
457
|
+
|
|
458
|
+
def self.attribute_names: () -> Array[Symbol]
|
|
459
|
+
private def self.readers: () -> Hash[Symbol, Symbol]
|
|
460
|
+
private def self.keys: () -> Array[String]
|
|
461
|
+
private def self.preparations: () -> Hash[Symbol, ^() [self: Resource] -> untyped]
|
|
462
|
+
private def self.prepare: (Symbol name) { () [self: Resource] -> untyped } -> Hash[Symbol, ^() [self: Resource] -> untyped]
|
|
463
|
+
private def self.reader: (Symbol name, String key) { () [self: Resource] -> untyped } -> Symbol
|
|
464
|
+
private def self.attribute: (Symbol name, ?String key, ?type: singleton(Resource)?) -> Symbol
|
|
465
|
+
private def self.list: (Symbol name, ?String key, ?type: singleton(Resource)?) -> Symbol
|
|
466
|
+
private def self.predicate: (Symbol name, ?String key) -> Symbol
|
|
467
|
+
private def self.dictionary: (Symbol name, ?String key, type: singleton(Resource)) -> Symbol
|
|
468
|
+
private def self.timestamp: (Symbol name, Object & _ISO8601Parser parser, ?String key) -> Symbol
|
|
469
|
+
private def self.inspect_with: (*Symbol names) -> Array[Symbol]
|
|
470
|
+
private def self.inspected: () -> Array[Symbol]
|
|
471
|
+
private def self.record: (Symbol name, ?String? key, ?reader: Symbol) -> Symbol
|
|
472
|
+
private def self.camelize: (Symbol name) -> String
|
|
473
|
+
|
|
474
|
+
def initialize: (Hash[String, untyped] attributes) -> void
|
|
475
|
+
def to_h: () -> Hash[Symbol, untyped]
|
|
476
|
+
def to_json: (*untyped args) -> String
|
|
477
|
+
def as_json: (*untyped _options) -> Hash[String, untyped]
|
|
478
|
+
def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped]
|
|
479
|
+
def ==: (untyped other) -> bool
|
|
480
|
+
def eql?: (untyped other) -> bool
|
|
481
|
+
def hash: () -> Integer
|
|
482
|
+
def inspect: () -> String
|
|
483
|
+
|
|
484
|
+
private
|
|
485
|
+
|
|
486
|
+
def prepared: (Symbol name) -> untyped
|
|
487
|
+
def read: (Symbol name) -> untyped
|
|
488
|
+
end
|
|
489
|
+
|
|
490
|
+
class Block < Resource
|
|
491
|
+
def type: () -> String
|
|
492
|
+
def html: () -> String
|
|
493
|
+
end
|
|
494
|
+
|
|
495
|
+
class Contributions < Resource
|
|
496
|
+
def total: () -> Integer
|
|
497
|
+
def longest_streak: () -> Integer
|
|
498
|
+
def days: () -> Array[Day]
|
|
499
|
+
def since: () -> Integer
|
|
500
|
+
def last_push: () -> Push?
|
|
501
|
+
def live?: () -> bool
|
|
502
|
+
def command: () -> String
|
|
503
|
+
end
|
|
504
|
+
|
|
505
|
+
class Day < Resource
|
|
506
|
+
def date: () -> Date
|
|
507
|
+
def count: () -> Integer
|
|
508
|
+
def level: () -> Integer
|
|
509
|
+
end
|
|
510
|
+
|
|
511
|
+
class Deployment < Resource
|
|
512
|
+
def commit: () -> String?
|
|
513
|
+
def deployed: () -> Time?
|
|
514
|
+
def url: () -> String?
|
|
515
|
+
end
|
|
516
|
+
|
|
517
|
+
class Status < Resource
|
|
518
|
+
def github: () -> GitHub?
|
|
519
|
+
def loaded: () -> Loaded?
|
|
520
|
+
|
|
521
|
+
class GitHub < Resource
|
|
522
|
+
def asked: () -> Time?
|
|
523
|
+
def answered: () -> Time?
|
|
524
|
+
def error: () -> String?
|
|
525
|
+
end
|
|
526
|
+
|
|
527
|
+
class Loaded < Resource
|
|
528
|
+
def gems: () -> Time?
|
|
529
|
+
def stars: () -> Time?
|
|
530
|
+
def contributions: () -> Time?
|
|
531
|
+
def push: () -> Time?
|
|
532
|
+
end
|
|
533
|
+
end
|
|
534
|
+
|
|
535
|
+
class Dependency < Resource
|
|
536
|
+
def command: () -> String
|
|
537
|
+
def figure: () -> Figure
|
|
538
|
+
end
|
|
539
|
+
|
|
540
|
+
class Figure < Resource
|
|
541
|
+
def type: () -> String
|
|
542
|
+
def href: () -> String
|
|
543
|
+
def src: () -> String
|
|
544
|
+
def srcset: () -> String
|
|
545
|
+
def width: () -> Integer
|
|
546
|
+
def height: () -> Integer
|
|
547
|
+
def alt: () -> String
|
|
548
|
+
def title: () -> String
|
|
549
|
+
def caption: () -> String
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
class Finger < Resource
|
|
553
|
+
def name: () -> String
|
|
554
|
+
def login: () -> String
|
|
555
|
+
def mail: () -> String
|
|
556
|
+
def directory: () -> String
|
|
557
|
+
def shell: () -> String
|
|
558
|
+
def plan: () -> String
|
|
559
|
+
def profiles: () -> Array[SocialProfile]
|
|
560
|
+
def command: () -> String
|
|
561
|
+
end
|
|
562
|
+
|
|
563
|
+
class Home < Resource
|
|
564
|
+
def profile: () -> Profile
|
|
565
|
+
def modules: () -> Array[Section]
|
|
566
|
+
def pages: () -> Pages
|
|
567
|
+
|
|
568
|
+
class Pages < Resource
|
|
569
|
+
def talks: () -> String
|
|
570
|
+
def resume: () -> String
|
|
571
|
+
end
|
|
572
|
+
|
|
573
|
+
class Profile < Resource
|
|
574
|
+
def name: () -> String
|
|
575
|
+
def location: () -> String
|
|
576
|
+
def tagline: () -> String
|
|
577
|
+
def handle: () -> String
|
|
578
|
+
def url: () -> String
|
|
579
|
+
end
|
|
580
|
+
|
|
581
|
+
class Section < Resource
|
|
582
|
+
def id: () -> String
|
|
583
|
+
def url: () -> String
|
|
584
|
+
end
|
|
585
|
+
end
|
|
586
|
+
|
|
587
|
+
class WebFinger < Resource
|
|
588
|
+
def subject: () -> String
|
|
589
|
+
def aliases: () -> Array[String]
|
|
590
|
+
def links: () -> Array[Link]
|
|
591
|
+
|
|
592
|
+
class Link < Resource
|
|
593
|
+
def rel: () -> String
|
|
594
|
+
def type: () -> String?
|
|
595
|
+
def href: () -> String?
|
|
596
|
+
def template: () -> String?
|
|
597
|
+
end
|
|
598
|
+
end
|
|
599
|
+
|
|
600
|
+
class NameChange < Resource
|
|
601
|
+
def subject: () -> String
|
|
602
|
+
def year: () -> Integer
|
|
603
|
+
def commit: () -> String
|
|
604
|
+
def notes: () -> Array[String]
|
|
605
|
+
def command: () -> String
|
|
606
|
+
end
|
|
607
|
+
|
|
608
|
+
class Place < Resource
|
|
609
|
+
def lat: () -> Numeric
|
|
610
|
+
def lon: () -> Numeric
|
|
611
|
+
def country: () -> String
|
|
612
|
+
end
|
|
613
|
+
|
|
614
|
+
class Podcast < Resource
|
|
615
|
+
def title: () -> String
|
|
616
|
+
def show: () -> String
|
|
617
|
+
def date: () -> Date
|
|
618
|
+
def url: () -> String
|
|
619
|
+
end
|
|
620
|
+
|
|
621
|
+
class Project < Resource
|
|
622
|
+
def name: () -> String
|
|
623
|
+
def description: () -> String
|
|
624
|
+
def downloads: () -> Integer?
|
|
625
|
+
def stars: () -> Integer?
|
|
626
|
+
def url: () -> String
|
|
627
|
+
end
|
|
628
|
+
|
|
629
|
+
module Collection[unchecked out Elem] : _ToA[Elem], Resource
|
|
630
|
+
def size: () -> Integer
|
|
631
|
+
alias length size
|
|
632
|
+
def empty?: () -> bool
|
|
633
|
+
def last: () -> Elem?
|
|
634
|
+
| (Integer count) -> Array[Elem]
|
|
635
|
+
def []: (Integer index) -> Elem?
|
|
636
|
+
| (Integer start, Integer length) -> Array[Elem]?
|
|
637
|
+
| (Range[Integer?] range) -> Array[Elem]?
|
|
638
|
+
def deconstruct: () -> Array[Elem]
|
|
639
|
+
def to_h: () -> Hash[Symbol, untyped]
|
|
640
|
+
| [K, V] () { (Elem item) -> [K, V] } -> Hash[K, V]
|
|
641
|
+
end
|
|
642
|
+
|
|
643
|
+
class Projects < Resource
|
|
644
|
+
include Enumerable[Project]
|
|
645
|
+
include Collection[Project]
|
|
646
|
+
|
|
647
|
+
def projects: () -> Array[Project]
|
|
648
|
+
def total_downloads: () -> Integer?
|
|
649
|
+
def total_gems: () -> Integer?
|
|
650
|
+
def total_stars: () -> Integer?
|
|
651
|
+
def more: () -> String
|
|
652
|
+
def live?: () -> bool
|
|
653
|
+
def command: () -> String
|
|
654
|
+
def each: () { (Project project) -> void } -> self
|
|
655
|
+
| () -> Enumerator[Project, self]
|
|
656
|
+
| () -> Enumerator[Project, Array[Project]]
|
|
657
|
+
def as_json: (*untyped _options) -> Hash[String, untyped]
|
|
658
|
+
|
|
659
|
+
private
|
|
660
|
+
|
|
661
|
+
def total: () -> Hash[String, untyped]
|
|
662
|
+
end
|
|
663
|
+
|
|
664
|
+
class Push < Resource
|
|
665
|
+
def repo: () -> String
|
|
666
|
+
def sha: () -> String
|
|
667
|
+
def at: () -> Time
|
|
668
|
+
end
|
|
669
|
+
|
|
670
|
+
class Resume < Resource
|
|
671
|
+
def basics: () -> Basics
|
|
672
|
+
def work: () -> Array[Work]
|
|
673
|
+
def projects: () -> Array[Project]
|
|
674
|
+
def skills: () -> Array[Skill]
|
|
675
|
+
def awards: () -> Array[Award]
|
|
676
|
+
def patents: () -> Array[Patent]
|
|
677
|
+
def speaking: () -> Speaking
|
|
678
|
+
def education: () -> Array[Education]
|
|
679
|
+
def volunteer: () -> Array[Volunteer]
|
|
680
|
+
def meta: () -> Meta?
|
|
681
|
+
def name: () -> String?
|
|
682
|
+
def last_modified: () -> Date?
|
|
683
|
+
|
|
684
|
+
class Award < Resource
|
|
685
|
+
def title: () -> String
|
|
686
|
+
def date: () -> Date
|
|
687
|
+
def awarder: () -> String
|
|
688
|
+
def summary: () -> String
|
|
689
|
+
end
|
|
690
|
+
|
|
691
|
+
class Basics < Resource
|
|
692
|
+
def name: () -> String
|
|
693
|
+
def label: () -> String
|
|
694
|
+
def former_name: () -> String
|
|
695
|
+
def email: () -> String
|
|
696
|
+
def url: () -> String
|
|
697
|
+
def summary: () -> String
|
|
698
|
+
def location: () -> Location
|
|
699
|
+
def profiles: () -> Array[Profile]
|
|
700
|
+
end
|
|
701
|
+
|
|
702
|
+
class Education < Resource
|
|
703
|
+
def institution: () -> String
|
|
704
|
+
def location: () -> String
|
|
705
|
+
def start_date: () -> Date
|
|
706
|
+
def end_date: () -> Date?
|
|
707
|
+
def highlights: () -> Array[String]
|
|
708
|
+
def courses: () -> Array[String]
|
|
709
|
+
end
|
|
710
|
+
|
|
711
|
+
class Location < Resource
|
|
712
|
+
def city: () -> String
|
|
713
|
+
def region: () -> String
|
|
714
|
+
def country_code: () -> String
|
|
715
|
+
end
|
|
716
|
+
|
|
717
|
+
class Meta < Resource
|
|
718
|
+
def canonical: () -> String?
|
|
719
|
+
def version: () -> String?
|
|
720
|
+
def last_modified: () -> Date?
|
|
721
|
+
end
|
|
722
|
+
|
|
723
|
+
class Patent < Resource
|
|
724
|
+
def title: () -> String
|
|
725
|
+
def number: () -> String
|
|
726
|
+
def date: () -> Date
|
|
727
|
+
def url: () -> String
|
|
728
|
+
end
|
|
729
|
+
|
|
730
|
+
class Profile < Resource
|
|
731
|
+
def network: () -> String
|
|
732
|
+
def username: () -> String
|
|
733
|
+
def url: () -> String
|
|
734
|
+
end
|
|
735
|
+
|
|
736
|
+
class Project < Resource
|
|
737
|
+
def name: () -> String
|
|
738
|
+
def description: () -> String
|
|
739
|
+
end
|
|
740
|
+
|
|
741
|
+
class Skill < Resource
|
|
742
|
+
def name: () -> String
|
|
743
|
+
def keywords: () -> Array[String]
|
|
744
|
+
end
|
|
745
|
+
|
|
746
|
+
class Speaking < Resource
|
|
747
|
+
def summary: () -> String
|
|
748
|
+
end
|
|
749
|
+
|
|
750
|
+
class Volunteer < Resource
|
|
751
|
+
def position: () -> String
|
|
752
|
+
def organization: () -> String
|
|
753
|
+
def start_date: () -> Date
|
|
754
|
+
def end_date: () -> Date?
|
|
755
|
+
def summary: () -> String?
|
|
756
|
+
def url: () -> String?
|
|
757
|
+
end
|
|
758
|
+
|
|
759
|
+
class Work < Resource
|
|
760
|
+
def position: () -> String
|
|
761
|
+
def name: () -> String
|
|
762
|
+
def start_date: () -> Date
|
|
763
|
+
def end_date: () -> Date?
|
|
764
|
+
def highlights: () -> Array[String]
|
|
765
|
+
end
|
|
766
|
+
end
|
|
767
|
+
|
|
768
|
+
class Session < Resource
|
|
769
|
+
def tty: () -> String
|
|
770
|
+
def page: () -> String
|
|
771
|
+
def login: () -> Time
|
|
772
|
+
def idle: () -> Integer
|
|
773
|
+
end
|
|
774
|
+
|
|
775
|
+
class SocialProfile < Resource
|
|
776
|
+
def network: () -> String
|
|
777
|
+
def username: () -> String
|
|
778
|
+
def url: () -> String
|
|
779
|
+
def icon: () -> String
|
|
780
|
+
def aliases: () -> Array[String]
|
|
781
|
+
end
|
|
782
|
+
|
|
783
|
+
class Talk < Resource
|
|
784
|
+
def title: () -> String
|
|
785
|
+
def event: () -> String
|
|
786
|
+
def date: () -> Date
|
|
787
|
+
def location: () -> String
|
|
788
|
+
def slides: () -> String?
|
|
789
|
+
def video: () -> String?
|
|
790
|
+
def link: () -> String?
|
|
791
|
+
def featured?: () -> bool
|
|
792
|
+
end
|
|
793
|
+
|
|
794
|
+
class Talks < Resource
|
|
795
|
+
include Enumerable[Talk]
|
|
796
|
+
include Collection[Talk]
|
|
797
|
+
|
|
798
|
+
def talks: () -> Array[Talk]
|
|
799
|
+
def places: () -> Hash[String, Place]
|
|
800
|
+
def podcasts: () -> Array[Podcast]
|
|
801
|
+
def speaker_deck: () -> String
|
|
802
|
+
def command: () -> String
|
|
803
|
+
def each: () { (Talk talk) -> void } -> self
|
|
804
|
+
| () -> Enumerator[Talk, self]
|
|
805
|
+
| () -> Enumerator[Talk, Array[Talk]]
|
|
806
|
+
end
|
|
807
|
+
|
|
808
|
+
class Who < Resource
|
|
809
|
+
include Enumerable[Session]
|
|
810
|
+
include Collection[Session]
|
|
811
|
+
|
|
812
|
+
def users: () -> Array[Session]
|
|
813
|
+
def you: () -> String?
|
|
814
|
+
def each: () { (Session session) -> void } -> self
|
|
815
|
+
| () -> Enumerator[Session, self]
|
|
816
|
+
| () -> Enumerator[Session, Array[Session]]
|
|
817
|
+
def as_json: (*untyped _options) -> Hash[String, untyped]
|
|
818
|
+
end
|
|
819
|
+
|
|
820
|
+
class Whoami < Resource
|
|
821
|
+
def command: () -> String
|
|
822
|
+
def blocks: () -> Array[Block]
|
|
823
|
+
def multi_downloads: () -> Integer
|
|
824
|
+
end
|
|
825
|
+
end
|