repltalk 2.0.5 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/queries.rb +9 -1
- data/lib/repltalk.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 472eea85f7f18da57609656f46e3da8ba747d59a65be74cabe03cf02efa5d28a
|
4
|
+
data.tar.gz: ee9e9f15d772c950a6b7b4ad7fd694abc6b5fa52dc948faa7eaadafd03e9d644
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f8c1ccaeb7b12fd6cebb976dc6bfc57653dee0ef98ef577114db904ca45c4b4271ab45b1ee975ab6359ea4b3b7b3e3b3e0d63fde5357f7744e1df8c93d58473
|
7
|
+
data.tar.gz: fda8de303b2b4eb8f01814e683f7303bcc4342d523dbe12c71d251488c5da640ac159865c41f3fc4efce9591cc7f948cdcd179e09b6bb9bb98c65a85e7f2dd7d
|
data/lib/queries.rb
CHANGED
@@ -162,6 +162,14 @@ class Queries < Fields
|
|
162
162
|
}"
|
163
163
|
end
|
164
164
|
|
165
|
+
def Queries.user_search
|
166
|
+
"query usernameSearch($username: String!, $count: Int) {
|
167
|
+
usernameSearch(query: $username, limit: $count) {
|
168
|
+
#{@@user}
|
169
|
+
}
|
170
|
+
}"
|
171
|
+
end
|
172
|
+
|
165
173
|
def Queries.get_user_posts
|
166
174
|
"query user($username: String!, $after: String, $order: String, $count: Int) {
|
167
175
|
user: userByUsername(username: $username) {
|
@@ -439,7 +447,7 @@ class Mutations < Fields
|
|
439
447
|
}
|
440
448
|
}
|
441
449
|
}"
|
442
|
-
end
|
450
|
+
end
|
443
451
|
|
444
452
|
def Mutations.report_post
|
445
453
|
"mutation createBoardReport($id: Int!, $reason: String!) {
|
data/lib/repltalk.rb
CHANGED
@@ -550,6 +550,17 @@ class Client
|
|
550
550
|
User.new(self, u["user"])
|
551
551
|
end
|
552
552
|
|
553
|
+
def search_user(username, count: 10)
|
554
|
+
u = graphql(
|
555
|
+
"usernameSearch",
|
556
|
+
Queries.user_search,
|
557
|
+
username: username,
|
558
|
+
count: count
|
559
|
+
)
|
560
|
+
return nil if u["usernameSearch"] == nil
|
561
|
+
u["usernameSearch"].map { |user| User.new(self, user) }
|
562
|
+
end
|
563
|
+
|
553
564
|
def get_post(id)
|
554
565
|
p = graphql(
|
555
566
|
"post",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: repltalk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CodingCactus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|