brainiac-fizzy 0.0.15 → 0.0.16

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: 554fe8796537111b5df0a3d5236cb457c28089097f75efb797fdb2a32fa20c6a
4
- data.tar.gz: 5a1799ef50971dc53df499213fa00bae7d84c1913da5da070b4c4e96de8e113c
3
+ metadata.gz: 6ed1ef3ae4c3db228a9a98a796579e7450e25fad4e19fa5ce075777e677342cc
4
+ data.tar.gz: 9e5ceac2510d64194bc498850871ca8105aeea24b742e9930ede13c761928f50
5
5
  SHA512:
6
- metadata.gz: f2cc672d0cd0760c0c4319a9b5bca323877b8ca7284739a3cd8fbd4f6deeffb0735e7bd9c19d50726b62207453bffab2b228f972b55c1f0ac1289a0490155a12
7
- data.tar.gz: 3e7e6d3da09df5f97bfbe47b7b152dca2381c58b3ed75d315ff8979f0341b62563dbae33043d568562c23de06e9cee10d07ce54e2b290bd8d13fbf9c0d322437
6
+ metadata.gz: 73f14f9e28f8eaba2558fac32e14116d0255fdb513cd2ba13753f1e5babe9a311807620832b75cd4b46282473e0603a1127a38483f18034177c0d983a84b5146
7
+ data.tar.gz: d45acdf7a664c1585b262230a0b1cf70eff969699fc80c270193ccedf0d902ed7876fc6d3eb353acf4768217bd88babced1f10db835b6aa7e13edde62b57b27c
@@ -54,7 +54,7 @@ module Brainiac
54
54
  comments = JSON.parse(output)["data"] || []
55
55
  agent_display = agent_display_name(agent_name)
56
56
 
57
- agent_comments = comments.select { |c| c["creator_name"]&.downcase == agent_display.downcase }
57
+ agent_comments = comments.select { |c| c.dig("creator", "name")&.downcase == agent_display.downcase }
58
58
  return agent_comments.any? unless since
59
59
 
60
60
  buffered_since = since - CLOCK_SKEW_BUFFER
@@ -66,7 +66,7 @@ module Brainiac
66
66
  comments.last(15).map do |c|
67
67
  body = c.dig("body", "plain_text") || ""
68
68
  body = "#{body[0..500]}..." if body.length > 500
69
- "**#{c["creator_name"]}** (#{c["id"]}):\n#{body}"
69
+ "**#{c.dig("creator", "name")}** (#{c["id"]}):\n#{body}"
70
70
  end.join("\n\n---\n\n")
71
71
  rescue StandardError => e
72
72
  LOG.warn "[Fizzy] Could not fetch comments for card ##{card_number}: #{e.message}" if defined?(LOG)
@@ -82,7 +82,7 @@ module Brainiac
82
82
  return nil if comments.empty?
83
83
 
84
84
  comments.last(5).map do |c|
85
- creator = c["creator_name"] || "unknown"
85
+ creator = c.dig("creator", "name") || "unknown"
86
86
  body = (c.dig("body", "plain_text") || "").lines.first(3).join.strip
87
87
  body = "#{body[0..200]}..." if body.length > 200
88
88
  "#{creator}: #{body}"
@@ -112,7 +112,7 @@ module Brainiac
112
112
 
113
113
  # Find the most recent agent comment, scoped to this session if `since` is provided.
114
114
  # Subtracts 30s buffer from `since` to account for clock skew between local server and Fizzy API.
115
- agent_comments = comments.select { |c| c["creator_name"]&.downcase == agent_display.downcase }
115
+ agent_comments = comments.select { |c| c.dig("creator", "name")&.downcase == agent_display.downcase }
116
116
  if since
117
117
  buffered_since = since - 30
118
118
  agent_comments = agent_comments.select do |c|
@@ -3,7 +3,7 @@
3
3
  module Brainiac
4
4
  module Plugins
5
5
  module Fizzy
6
- VERSION = "0.0.15"
6
+ VERSION = "0.0.16"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brainiac-fizzy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Davis