mentionable 0.1.1 → 0.2.0
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 +4 -4
- data/README.md +2 -2
- data/lib/mentionable.rb +1 -1
- data/lib/mentionable/version.rb +1 -1
- metadata +6 -6
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: c30772dc75b4010c83e322d4a5cd12eae0505957221929975da5e0e55e39455d
         | 
| 4 | 
            +
              data.tar.gz: ffda83a175fe71c01527df236e0fe5e903a38b2256600a98b6ba14d22db10f6a
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b74d45e06a7d71138f71bee39b8aaf88341b937d7eb9e40abed20f6013877ebebea616cce07ee2290f8bbdb2c95dd80177b88ecfc4c9a948d1b22354d0e47f7f
         | 
| 7 | 
            +
              data.tar.gz: b28a744af9fdb97aeb2a6f42c620617be44010217fc8c045c79273bab3455de639881a3d1cd1d52dc0e2a6bd5a6cfac308e19141c5f8d00c10cd45a3fa4f579c
         | 
    
        data/README.md
    CHANGED
    
    | @@ -24,9 +24,9 @@ Or install it yourself as: | |
| 24 24 |  | 
| 25 25 | 
             
            ```ruby
         | 
| 26 26 | 
             
            class Comment
         | 
| 27 | 
            -
              mentionable_as :body #, on_mention: : | 
| 27 | 
            +
              mentionable_as :body #, on_mention: :after_save_mention, regexp: /@\w+/
         | 
| 28 28 |  | 
| 29 | 
            -
              def  | 
| 29 | 
            +
              def after_save_mention(mentions)
         | 
| 30 30 | 
             
                p mentions # Send notification if you want.
         | 
| 31 31 | 
             
              end
         | 
| 32 32 | 
             
            end
         | 
    
        data/lib/mentionable.rb
    CHANGED
    
    | @@ -15,7 +15,7 @@ module Mentionable | |
| 15 15 | 
             
              end
         | 
| 16 16 |  | 
| 17 17 | 
             
              module ClassMethods
         | 
| 18 | 
            -
                def mentionable_as(column, on_mention: : | 
| 18 | 
            +
                def mentionable_as(column, on_mention: :after_save_mention, regexp: REGEXP)
         | 
| 19 19 | 
             
                  klass = name.constantize
         | 
| 20 20 | 
             
                  klass.class_variable_set :@@mentionable_name, column
         | 
| 21 21 | 
             
                  klass.class_variable_set :@@on_mention, on_mention
         | 
    
        data/lib/mentionable/version.rb
    CHANGED
    
    
    
        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. | 
| 4 | 
            +
              version: 0.2.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Masaki Komagata
         | 
| 8 | 
            -
            autorequire: | 
| 8 | 
            +
            autorequire:
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2020-07- | 
| 11 | 
            +
            date: 2020-07-09 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activerecord
         | 
| @@ -106,7 +106,7 @@ licenses: | |
| 106 106 | 
             
            metadata:
         | 
| 107 107 | 
             
              homepage_uri: https://github.com/komagata/mentionable
         | 
| 108 108 | 
             
              source_code_uri: https://github.com/komagata/mentionable
         | 
| 109 | 
            -
            post_install_message: | 
| 109 | 
            +
            post_install_message:
         | 
| 110 110 | 
             
            rdoc_options: []
         | 
| 111 111 | 
             
            require_paths:
         | 
| 112 112 | 
             
            - lib
         | 
| @@ -121,8 +121,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 121 121 | 
             
                - !ruby/object:Gem::Version
         | 
| 122 122 | 
             
                  version: '0'
         | 
| 123 123 | 
             
            requirements: []
         | 
| 124 | 
            -
            rubygems_version: 3. | 
| 125 | 
            -
            signing_key: | 
| 124 | 
            +
            rubygems_version: 3.0.3
         | 
| 125 | 
            +
            signing_key:
         | 
| 126 126 | 
             
            specification_version: 4
         | 
| 127 127 | 
             
            summary: Discovery mentions from ActiveRecord column.
         | 
| 128 128 | 
             
            test_files: []
         |