repltalk 2.0.5 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/queries.rb +9 -1
  3. data/lib/repltalk.rb +11 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 021bec9878ab43bc85c7c1ef8fb628c34cece2c8643559b2969b955e13694f1a
4
- data.tar.gz: 519b81ab0f69d8b8f0289ecb85de62bfb5fb4a674f5574e70b5868d98882ef07
3
+ metadata.gz: 472eea85f7f18da57609656f46e3da8ba747d59a65be74cabe03cf02efa5d28a
4
+ data.tar.gz: ee9e9f15d772c950a6b7b4ad7fd694abc6b5fa52dc948faa7eaadafd03e9d644
5
5
  SHA512:
6
- metadata.gz: 0ff92dcc8ce300ab5c84c0753f51bb8788b695c4da858ec58f9abbf6d11f92f287589a49a36bf2bb346845ffe3d8f954b4113181718b57c86056ff9cb85eca40
7
- data.tar.gz: fe44468b7671355bdc1b143e9b032472a6715c2b40ebce9a02fbfb0bc1f4d8fe381cc80c5523f59483683465e5b68081352416b738b75741dbfea834a2c9608d
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.5
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-03-25 00:00:00.000000000 Z
11
+ date: 2021-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http