wit_bot 0.5.1 → 0.5.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 +4 -4
- data/lib/generators/wit_bot/bot/USAGE +11 -3
- data/lib/generators/wit_bot/message_bus/USAGE +10 -3
- data/lib/generators/wit_bot/model/USAGE +9 -3
- data/lib/generators/wit_bot/model/model_generator.rb +1 -7
- data/lib/generators/wit_bot/model/templates/clear_conversations.txt +5 -0
- data/lib/wit_bot/version.rb +1 -1
- metadata +2 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 54335eac2026b307d2ee5ab5d2db3bd677682307
         | 
| 4 | 
            +
              data.tar.gz: 383290319ad7d6a874f3b285380d2b1031ab3092
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 94fda45b8bed4e23e077ac9182de55967c06bb5e78a634973a88bbd0f010c0a830aa7b79cb5069499441d9c72cf89386515489660fd75545b2a123bece745722
         | 
| 7 | 
            +
              data.tar.gz: 7b4d2d19a66604195a0c0709eb3668e893aefdc0d88213b8c4f98db6ba75d29b77dd8256d5fc3b268751da1eaf5ce166154ce12c8db38ab5be5ea2faeab1f8a2
         | 
| @@ -1,8 +1,16 @@ | |
| 1 1 | 
             
            Description:
         | 
| 2 | 
            -
                 | 
| 2 | 
            +
                Creates a bot for use with wit_bot.
         | 
| 3 3 |  | 
| 4 4 | 
             
            Example:
         | 
| 5 | 
            -
             | 
| 5 | 
            +
             | 
| 6 | 
            +
                To generate without intents:
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                    rails generate wit_bot:bot BotName
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                To include intents:
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                    rails generate wit_bot:bot BotName intent1 intent2 ...
         | 
| 6 13 |  | 
| 7 14 | 
             
                This will create:
         | 
| 8 | 
            -
             | 
| 15 | 
            +
                
         | 
| 16 | 
            +
                    app/wit_bot/bot_name_bot.rb
         | 
| @@ -1,8 +1,15 @@ | |
| 1 1 | 
             
            Description:
         | 
| 2 | 
            -
                Sets up  | 
| 2 | 
            +
                Sets up a message participant for using message_bus to transmit messages to web clients.
         | 
| 3 3 |  | 
| 4 4 | 
             
            Example:
         | 
| 5 | 
            -
                 | 
| 5 | 
            +
                All commands below are equivalent:
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                    rails generate wit_bot:message_bus Bot
         | 
| 8 | 
            +
                    rails generate wit_bot:message_bus Bot User
         | 
| 9 | 
            +
                    rails generate wit_bot:message_bus Bot User /witbot
         | 
| 6 10 |  | 
| 7 11 | 
             
                This will create:
         | 
| 8 | 
            -
             | 
| 12 | 
            +
             | 
| 13 | 
            +
                    app/wit_bot/message_bus_listener.rb
         | 
| 14 | 
            +
                    app/controllers/message_bus_controller.rb
         | 
| 15 | 
            +
                    app/jobs/message_bus_job.rb
         | 
| @@ -1,8 +1,14 @@ | |
| 1 1 | 
             
            Description:
         | 
| 2 | 
            -
                 | 
| 2 | 
            +
                Create a model to store conversations in ActiveRecord belonging to a user.
         | 
| 3 3 |  | 
| 4 4 | 
             
            Example:
         | 
| 5 | 
            -
                 | 
| 5 | 
            +
                Both commands are equivalent:
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                    rails generate wit_bot:model
         | 
| 8 | 
            +
                    rails generate wit_bot:model User
         | 
| 6 9 |  | 
| 7 10 | 
             
                This will create:
         | 
| 8 | 
            -
             | 
| 11 | 
            +
             | 
| 12 | 
            +
                    db/migrate/create_conversations.rb
         | 
| 13 | 
            +
                    app/models/conversation.rb
         | 
| 14 | 
            +
             | 
| @@ -17,13 +17,7 @@ module WitBot | |
| 17 17 | 
             
                    user_file = "app/models/#{user_lower}.rb"
         | 
| 18 18 | 
             
                    inject_into_class user_file, user_model, "  has_one :conversation, dependent: :destroy\n"
         | 
| 19 19 |  | 
| 20 | 
            -
                     | 
| 21 | 
            -
            If you're thinking that storing conversations will take up a lot of room in your database,
         | 
| 22 | 
            -
            you are correct. You'll want to destroy inactive conversations from the database every few hours.
         | 
| 23 | 
            -
            Here's the guide on setting up a job to clear old conversations with Clockwork:
         | 
| 24 | 
            -
             | 
| 25 | 
            -
            https://github.com/penne12/wit_bot/wiki/Clear-Old-Conversations-in-ActiveRecord-with-Clockwork-and-ActiveJob
         | 
| 26 | 
            -
            TEXT
         | 
| 20 | 
            +
                    readme 'clear_conversations.txt'
         | 
| 27 21 | 
             
                  end
         | 
| 28 22 | 
             
                end
         | 
| 29 23 | 
             
              end
         | 
| @@ -0,0 +1,5 @@ | |
| 1 | 
            +
            If you're thinking that storing conversations will take up a lot of room in your database,
         | 
| 2 | 
            +
            you are correct. You'll want to destroy inactive conversations from the database every few hours.
         | 
| 3 | 
            +
            Here's the guide on setting up a job to clear old conversations with Clockwork:
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            https://github.com/penne12/wit_bot/wiki/Clear-Old-Conversations-in-ActiveRecord-with-Clockwork-and-ActiveJob
         | 
    
        data/lib/wit_bot/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: wit_bot
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.5. | 
| 4 | 
            +
              version: 0.5.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Ben (@penne12_)
         | 
| @@ -158,6 +158,7 @@ files: | |
| 158 158 | 
             
            - lib/generators/wit_bot/message_bus/templates/message_bus_listener.rb.erb
         | 
| 159 159 | 
             
            - lib/generators/wit_bot/model/USAGE
         | 
| 160 160 | 
             
            - lib/generators/wit_bot/model/model_generator.rb
         | 
| 161 | 
            +
            - lib/generators/wit_bot/model/templates/clear_conversations.txt
         | 
| 161 162 | 
             
            - lib/generators/wit_bot/model/templates/model.rb.erb
         | 
| 162 163 | 
             
            - lib/generators/wit_bot/setup/USAGE
         | 
| 163 164 | 
             
            - lib/generators/wit_bot/setup/setup_generator.rb
         |