prpr-mention_comment 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d87b681a438845826a9d4693774f0e951e0040b8
4
- data.tar.gz: 7813413cd4e0403470fc70661829d02bcc4d7910
3
+ metadata.gz: 984db03353cee2236b86a6aa848565970c1b93b8
4
+ data.tar.gz: f3880cf92a6dcbde6ccb641979c09e4699972d4c
5
5
  SHA512:
6
- metadata.gz: fe43a419f2a66af47b7b9019c59705a4624c825798b03329d91a2423b69470e68e15356939a18e62e6735477add52b279cf05aea75c6ef0cd5975edc94e969da
7
- data.tar.gz: a5f53e8495b357c435b0b4ee2a1f576b07e1ce11e07b302398d04734c1a19bc497273463042fe1c19f06583a34c2d2eb0134b6e3f5748da2f25440619cc60f24
6
+ metadata.gz: 60be6228c148ca7c96afc4474ea291c4c9975d42f1ba2556575cc463b7148fed445513fd83099c26b6b0033e2484f3359d03ebba16d9b5f98c4e448f4e6617ea
7
+ data.tar.gz: 0a7a197c52382b3750ed49df2d7c1fe1834fe44ff5a51bf96659caaf6db018905d7cb04b8e1aaef45f6df0632e4fefde35b3ef29c72aff08d52ec424ca3c18ce
@@ -2,6 +2,8 @@ module Prpr
2
2
  module Action
3
3
  module MentionComment
4
4
  class Mention < Base
5
+ REGEXP = /@[a-zA-Z0-9_-]+/
6
+
5
7
  def call
6
8
  if mention?
7
9
  Publisher::Adapter::Base.broadcast message
@@ -15,7 +17,7 @@ module Prpr
15
17
  end
16
18
 
17
19
  def mention?
18
- comment.body =~ /@[a-zA-Z0-9_]+/
20
+ comment.body =~ REGEXP
19
21
  end
20
22
 
21
23
  def body
@@ -27,7 +29,7 @@ module Prpr
27
29
  end
28
30
 
29
31
  def comment_body
30
- comment.body.gsub(/@[a-zA-Z0-9_]+/) { |old|
32
+ comment.body.gsub(REGEXP) { |old|
31
33
  members[old] || old
32
34
  }
33
35
  end
@@ -1,5 +1,5 @@
1
1
  module Prpr
2
2
  module MentionComment
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prpr-mention_comment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mzp