repltalk 4.1.1 → 4.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b84d171f11260c6228c57a98ecafa820de55beee7e3b2b6a6a073c8d1f098e2d
4
- data.tar.gz: 5308bbf0fe4421b85445e3d30166073508fe6a51298e862844d33bc876323c03
3
+ metadata.gz: 17af54edd0d1552ed38a2f3e971da22cb42eb3540eac53642f2347555284c4b1
4
+ data.tar.gz: 5a30898e823d5d5959b1fe33e2f6508865f6538982c3e605ef83e9e684b4e52a
5
5
  SHA512:
6
- metadata.gz: e6233c13df87432bd1465da62193bc46d1b3ba7305ada0974693d88548ccd681af160f3ea82ea1384264434f185ca2364f2bf3de186dbcf9b44dd29d39c5324e
7
- data.tar.gz: cc1d0293a530e7baaae7a3c1bbbe89296b2193fdad2c4097889dd25b96b641e218428db86672de0552cd17acb02420832d40285d0076080b45fbe97c3e4ffef3
6
+ metadata.gz: 7fa905a802f5bbba4d8f7c3d0ee403b3d7885d8069e04c4e68e73ed8891b0403c2e2e4880f2a2ec0155325556f31ff3f50abc4109d0086bb0abd1065000005d2
7
+ data.tar.gz: 0f319ab29a06dbb6424d9cf71cff28dbaba96951ab537f5f6a5819e4988dc26f734f5b27a3df71aab22307c756ef4fc3a7a9c8ebbbf0e491182d28c846dda9e2
@@ -24,7 +24,7 @@ module ReplTalk
24
24
  "X-Requested-With": "ReplTalk"
25
25
  )
26
26
  .post(
27
- "#{$BASE_URL}/graphql",
27
+ "#{$BASE_URL}/graphql",
28
28
  form: payload
29
29
  )
30
30
  begin data = JSON.parse(r)
@@ -126,7 +126,7 @@ module ReplTalk
126
126
  isAnnouncement
127
127
  timeCreated
128
128
  isAnswered
129
- isAnswerable
129
+ isAnswerable
130
130
  voteCount
131
131
  canVote
132
132
  hasVoted
@@ -380,26 +380,27 @@ module ReplTalk
380
380
  class Post
381
381
  attr_reader :id, :url, :repl, :board, :title, :author, :answer, :content, :preview, :timestamp, :vote_count, :comment_count, :can_vote, :has_voted, :is_answered, :is_answerable, :is_hidden, :is_pinned, :is_locked, :is_announcement
382
382
 
383
- def initialize(client, post)
383
+ def initialize(client, post)
384
384
  @client = client
385
385
 
386
386
  @id = post["id"]
387
387
  @url = $BASE_URL + post["url"]
388
388
  @title = post["title"]
389
389
  @timestamp = post["timeCreated"]
390
+
391
+ @board = Board.new(post["board"])
392
+ @repl = post["repl"] == nil ? nil : Repl.new(@client, post["repl"])
393
+ @author = post["user"] == nil ? nil : User.new(@client, post["user"])
394
+ @answer = post["answer"] == nil ? nil : Comment.new(@client, post["answer"])
390
395
 
391
396
  @content = post["body"]
392
397
  @preview = post["preview"]
393
398
 
394
- if @content == ""
399
+ if @content == "" # new post type
400
+ @url = "#{@repl.url}?c=#{post["replComment"]["id"]}"
395
401
  @content = post["replComment"]["body"]
396
402
  @preview = @content.length > 150 ? @content[0..150] : @content
397
- end
398
-
399
- @board = Board.new(post["board"])
400
- @repl = post["repl"] == nil ? nil : Repl.new(@client, post["repl"])
401
- @author = post["user"] == nil ? nil : User.new(@client, post["user"])
402
- @answer = post["answer"] == nil ? nil : Comment.new(@client, post["answer"])
403
+ end
403
404
 
404
405
  @vote_count = post["voteCount"]
405
406
  @comment_count = post["commentCount"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repltalk
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - CodingCactus