mentionable 0.2.0 → 0.2.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
  SHA256:
3
- metadata.gz: c30772dc75b4010c83e322d4a5cd12eae0505957221929975da5e0e55e39455d
4
- data.tar.gz: ffda83a175fe71c01527df236e0fe5e903a38b2256600a98b6ba14d22db10f6a
3
+ metadata.gz: 1d8e5145d44c07e8d1954a424a9fed78a95c9943f91799216de004a0eab65f60
4
+ data.tar.gz: 02db348c44ad09733c256f2dbcb60cb2a0f5221c7613e8766641a51f3d21700e
5
5
  SHA512:
6
- metadata.gz: b74d45e06a7d71138f71bee39b8aaf88341b937d7eb9e40abed20f6013877ebebea616cce07ee2290f8bbdb2c95dd80177b88ecfc4c9a948d1b22354d0e47f7f
7
- data.tar.gz: b28a744af9fdb97aeb2a6f42c620617be44010217fc8c045c79273bab3455de639881a3d1cd1d52dc0e2a6bd5a6cfac308e19141c5f8d00c10cd45a3fa4f579c
6
+ metadata.gz: 520de84863bd600203f2cf185e08995aa1066ec8b1f92f04c602a3d0088141fb2808f7bec161e46df2fddd03e8e81c11671e3389a14844baf45b1e7f8c69b960
7
+ data.tar.gz: b5b19d6af87c0a56a707acffb1401e922f9c63fc0c80430de04054327053a60f1c43975961a5d93654cd8205049f500ce840c311238ff0b7bb024edc384283b8
data/README.md CHANGED
@@ -26,8 +26,8 @@ Or install it yourself as:
26
26
  class Comment
27
27
  mentionable_as :body #, on_mention: :after_save_mention, regexp: /@\w+/
28
28
 
29
- def after_save_mention(mentions)
30
- p mentions # Send notification if you want.
29
+ def after_save_mention(new_mentions)
30
+ p new_mentions # Send notification if you want.
31
31
  end
32
32
  end
33
33
  ```
@@ -46,7 +46,7 @@ comment.new_mentions? # => true
46
46
 
47
47
  comment.update(body: '@nobunaga @hideyosi @ieyasu Hi guys.')
48
48
  comment.mentions # => ["@nobunaga", "@hideyosi", "@ieyasu"]
49
- comment.mentions_ware # => ["@nobunaga", "@hideyosi"]
49
+ comment.mentions_were # => ["@nobunaga", "@hideyosi"]
50
50
  comment.new_mentions # => ["@ieyasu"]
51
51
  comment.new_mentions? # => true
52
52
  ```
data/lib/mentionable.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'mentionable/version'
4
4
 
5
5
  module Mentionable
6
- REGEXP = /@\w+/.freeze
6
+ REGEXP = /@[\w-]+/.freeze
7
7
 
8
8
  def self.included(base)
9
9
  base.after_save do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mentionable
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mentionable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaki Komagata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-09 00:00:00.000000000 Z
11
+ date: 2021-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord