model_log 1.0.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 +7 -0
 - data/.gitignore +11 -0
 - data/.rspec +3 -0
 - data/.travis.yml +5 -0
 - data/CODE_OF_CONDUCT.md +74 -0
 - data/Gemfile +6 -0
 - data/Gemfile.lock +35 -0
 - data/LICENSE.txt +21 -0
 - data/README.md +65 -0
 - data/Rakefile +6 -0
 - data/bin/console +14 -0
 - data/bin/setup +8 -0
 - data/lib/model_log/class_methods/controllers.rb +33 -0
 - data/lib/model_log/class_methods/models.rb +101 -0
 - data/lib/model_log/passport.rb +18 -0
 - data/lib/model_log/request.rb +17 -0
 - data/lib/model_log/version.rb +3 -0
 - data/lib/model_log.rb +22 -0
 - data/model_log.gemspec +30 -0
 - metadata +104 -0
 
    
        checksums.yaml
    ADDED
    
    | 
         @@ -0,0 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            SHA1:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 3c5b94535e1a429a6ac7b6dafc2e47510de03323
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 7896e41b1051182317fefd98715fedc4d3abeb57
         
     | 
| 
      
 5 
     | 
    
         
            +
            SHA512:
         
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 19cc97d0a43b4fae221c10a0721a07d3997f55cd281adbfd5a4ab7b95242fe0952ca17c5f42df02c7a69cf0538028adcd3f3e82c4ec13fdbe938f747741de18f
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 398f192e6b454def32deaf84946feaa558fa58dcf6e23afaed294c446688a35dd26c78ebd923b5a35fb81de717c272f562552542cce6935ba2a3e967b0ee69fa
         
     | 
    
        data/.gitignore
    ADDED
    
    
    
        data/.rspec
    ADDED
    
    
    
        data/.travis.yml
    ADDED
    
    
    
        data/CODE_OF_CONDUCT.md
    ADDED
    
    | 
         @@ -0,0 +1,74 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Contributor Covenant Code of Conduct
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            ## Our Pledge
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            In the interest of fostering an open and welcoming environment, we as
         
     | 
| 
      
 6 
     | 
    
         
            +
            contributors and maintainers pledge to making participation in our project and
         
     | 
| 
      
 7 
     | 
    
         
            +
            our community a harassment-free experience for everyone, regardless of age, body
         
     | 
| 
      
 8 
     | 
    
         
            +
            size, disability, ethnicity, gender identity and expression, level of experience,
         
     | 
| 
      
 9 
     | 
    
         
            +
            nationality, personal appearance, race, religion, or sexual identity and
         
     | 
| 
      
 10 
     | 
    
         
            +
            orientation.
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            ## Our Standards
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            Examples of behavior that contributes to creating a positive environment
         
     | 
| 
      
 15 
     | 
    
         
            +
            include:
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            * Using welcoming and inclusive language
         
     | 
| 
      
 18 
     | 
    
         
            +
            * Being respectful of differing viewpoints and experiences
         
     | 
| 
      
 19 
     | 
    
         
            +
            * Gracefully accepting constructive criticism
         
     | 
| 
      
 20 
     | 
    
         
            +
            * Focusing on what is best for the community
         
     | 
| 
      
 21 
     | 
    
         
            +
            * Showing empathy towards other community members
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            Examples of unacceptable behavior by participants include:
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            * The use of sexualized language or imagery and unwelcome sexual attention or
         
     | 
| 
      
 26 
     | 
    
         
            +
            advances
         
     | 
| 
      
 27 
     | 
    
         
            +
            * Trolling, insulting/derogatory comments, and personal or political attacks
         
     | 
| 
      
 28 
     | 
    
         
            +
            * Public or private harassment
         
     | 
| 
      
 29 
     | 
    
         
            +
            * Publishing others' private information, such as a physical or electronic
         
     | 
| 
      
 30 
     | 
    
         
            +
              address, without explicit permission
         
     | 
| 
      
 31 
     | 
    
         
            +
            * Other conduct which could reasonably be considered inappropriate in a
         
     | 
| 
      
 32 
     | 
    
         
            +
              professional setting
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
            ## Our Responsibilities
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
            Project maintainers are responsible for clarifying the standards of acceptable
         
     | 
| 
      
 37 
     | 
    
         
            +
            behavior and are expected to take appropriate and fair corrective action in
         
     | 
| 
      
 38 
     | 
    
         
            +
            response to any instances of unacceptable behavior.
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
            Project maintainers have the right and responsibility to remove, edit, or
         
     | 
| 
      
 41 
     | 
    
         
            +
            reject comments, commits, code, wiki edits, issues, and other contributions
         
     | 
| 
      
 42 
     | 
    
         
            +
            that are not aligned to this Code of Conduct, or to ban temporarily or
         
     | 
| 
      
 43 
     | 
    
         
            +
            permanently any contributor for other behaviors that they deem inappropriate,
         
     | 
| 
      
 44 
     | 
    
         
            +
            threatening, offensive, or harmful.
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
            ## Scope
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
            This Code of Conduct applies both within project spaces and in public spaces
         
     | 
| 
      
 49 
     | 
    
         
            +
            when an individual is representing the project or its community. Examples of
         
     | 
| 
      
 50 
     | 
    
         
            +
            representing a project or community include using an official project e-mail
         
     | 
| 
      
 51 
     | 
    
         
            +
            address, posting via an official social media account, or acting as an appointed
         
     | 
| 
      
 52 
     | 
    
         
            +
            representative at an online or offline event. Representation of a project may be
         
     | 
| 
      
 53 
     | 
    
         
            +
            further defined and clarified by project maintainers.
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
            ## Enforcement
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
            Instances of abusive, harassing, or otherwise unacceptable behavior may be
         
     | 
| 
      
 58 
     | 
    
         
            +
            reported by contacting the project team at 462436208@qq.com. All
         
     | 
| 
      
 59 
     | 
    
         
            +
            complaints will be reviewed and investigated and will result in a response that
         
     | 
| 
      
 60 
     | 
    
         
            +
            is deemed necessary and appropriate to the circumstances. The project team is
         
     | 
| 
      
 61 
     | 
    
         
            +
            obligated to maintain confidentiality with regard to the reporter of an incident.
         
     | 
| 
      
 62 
     | 
    
         
            +
            Further details of specific enforcement policies may be posted separately.
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
            Project maintainers who do not follow or enforce the Code of Conduct in good
         
     | 
| 
      
 65 
     | 
    
         
            +
            faith may face temporary or permanent repercussions as determined by other
         
     | 
| 
      
 66 
     | 
    
         
            +
            members of the project's leadership.
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
            ## Attribution
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
            This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
         
     | 
| 
      
 71 
     | 
    
         
            +
            available at [http://contributor-covenant.org/version/1/4][version]
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
            [homepage]: http://contributor-covenant.org
         
     | 
| 
      
 74 
     | 
    
         
            +
            [version]: http://contributor-covenant.org/version/1/4/
         
     | 
    
        data/Gemfile
    ADDED
    
    
    
        data/Gemfile.lock
    ADDED
    
    | 
         @@ -0,0 +1,35 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            PATH
         
     | 
| 
      
 2 
     | 
    
         
            +
              remote: .
         
     | 
| 
      
 3 
     | 
    
         
            +
              specs:
         
     | 
| 
      
 4 
     | 
    
         
            +
                model_log (1.0.0)
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            GEM
         
     | 
| 
      
 7 
     | 
    
         
            +
              remote: https://rubygems.org/
         
     | 
| 
      
 8 
     | 
    
         
            +
              specs:
         
     | 
| 
      
 9 
     | 
    
         
            +
                diff-lcs (1.3)
         
     | 
| 
      
 10 
     | 
    
         
            +
                rake (10.5.0)
         
     | 
| 
      
 11 
     | 
    
         
            +
                rspec (3.7.0)
         
     | 
| 
      
 12 
     | 
    
         
            +
                  rspec-core (~> 3.7.0)
         
     | 
| 
      
 13 
     | 
    
         
            +
                  rspec-expectations (~> 3.7.0)
         
     | 
| 
      
 14 
     | 
    
         
            +
                  rspec-mocks (~> 3.7.0)
         
     | 
| 
      
 15 
     | 
    
         
            +
                rspec-core (3.7.1)
         
     | 
| 
      
 16 
     | 
    
         
            +
                  rspec-support (~> 3.7.0)
         
     | 
| 
      
 17 
     | 
    
         
            +
                rspec-expectations (3.7.0)
         
     | 
| 
      
 18 
     | 
    
         
            +
                  diff-lcs (>= 1.2.0, < 2.0)
         
     | 
| 
      
 19 
     | 
    
         
            +
                  rspec-support (~> 3.7.0)
         
     | 
| 
      
 20 
     | 
    
         
            +
                rspec-mocks (3.7.0)
         
     | 
| 
      
 21 
     | 
    
         
            +
                  diff-lcs (>= 1.2.0, < 2.0)
         
     | 
| 
      
 22 
     | 
    
         
            +
                  rspec-support (~> 3.7.0)
         
     | 
| 
      
 23 
     | 
    
         
            +
                rspec-support (3.7.1)
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            PLATFORMS
         
     | 
| 
      
 26 
     | 
    
         
            +
              ruby
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            DEPENDENCIES
         
     | 
| 
      
 29 
     | 
    
         
            +
              bundler (~> 1.16)
         
     | 
| 
      
 30 
     | 
    
         
            +
              model_log!
         
     | 
| 
      
 31 
     | 
    
         
            +
              rake (~> 10.0)
         
     | 
| 
      
 32 
     | 
    
         
            +
              rspec (~> 3.0)
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
            BUNDLED WITH
         
     | 
| 
      
 35 
     | 
    
         
            +
               1.16.1
         
     | 
    
        data/LICENSE.txt
    ADDED
    
    | 
         @@ -0,0 +1,21 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            The MIT License (MIT)
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Copyright (c) 2018 sunyudong
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            Permission is hereby granted, free of charge, to any person obtaining a copy
         
     | 
| 
      
 6 
     | 
    
         
            +
            of this software and associated documentation files (the "Software"), to deal
         
     | 
| 
      
 7 
     | 
    
         
            +
            in the Software without restriction, including without limitation the rights
         
     | 
| 
      
 8 
     | 
    
         
            +
            to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         
     | 
| 
      
 9 
     | 
    
         
            +
            copies of the Software, and to permit persons to whom the Software is
         
     | 
| 
      
 10 
     | 
    
         
            +
            furnished to do so, subject to the following conditions:
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            The above copyright notice and this permission notice shall be included in
         
     | 
| 
      
 13 
     | 
    
         
            +
            all copies or substantial portions of the Software.
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         
     | 
| 
      
 16 
     | 
    
         
            +
            IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         
     | 
| 
      
 17 
     | 
    
         
            +
            FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         
     | 
| 
      
 18 
     | 
    
         
            +
            AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         
     | 
| 
      
 19 
     | 
    
         
            +
            LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         
     | 
| 
      
 20 
     | 
    
         
            +
            OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
         
     | 
| 
      
 21 
     | 
    
         
            +
            THE SOFTWARE.
         
     | 
    
        data/README.md
    ADDED
    
    | 
         @@ -0,0 +1,65 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # ModelLog
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            User operation data saves log files and records user information.
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            ## Installation
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            Add this line to your application's Gemfile:
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 10 
     | 
    
         
            +
            gem 'model_log'
         
     | 
| 
      
 11 
     | 
    
         
            +
            ```
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            And then execute:
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                $ bundle
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            ## Usage
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            Simply call `model_log` on your models:
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 22 
     | 
    
         
            +
            class User < ActiveRecord::Base
         
     | 
| 
      
 23 
     | 
    
         
            +
              model_log
         
     | 
| 
      
 24 
     | 
    
         
            +
            end
         
     | 
| 
      
 25 
     | 
    
         
            +
            ```
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            ## Log Path
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            The log is saved in the `log/` section of your rails app.
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            The development environment file is called `model_log_development.log`.
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
            The product environment file is called `model_log_product.log`.
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
            ## Current User Tracking
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
            If you're using ModelLog in a Rails application, all audited changes made within a request will automatically be attributed to the current user. By default, ModelLog uses the `current_passport` method in your controller.
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
            The username field default to `username`.
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
            To use a method other than `current_passport` and a field other than `username`, put the following in an initializer:
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 44 
     | 
    
         
            +
            # config/initializers/model_log.rb
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
            ModelLog.current_user_method = :current_user
         
     | 
| 
      
 47 
     | 
    
         
            +
            ModelLog.user_name_field = :name
         
     | 
| 
      
 48 
     | 
    
         
            +
            ```
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
            ## Other Settings
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
            If you have multiple platforms, and the tag data changes belong to that platform, put the following in an initializer:
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 55 
     | 
    
         
            +
            # config/initializers/model_log.rb
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
            ModelLog.platform = :CPM
         
     | 
| 
      
 58 
     | 
    
         
            +
            ```
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
            ## Gem Update
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
            If you want to update the gem, run:
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                $ bundle update model_log
         
     | 
| 
      
 65 
     | 
    
         
            +
             
     | 
    
        data/Rakefile
    ADDED
    
    
    
        data/bin/console
    ADDED
    
    | 
         @@ -0,0 +1,14 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #!/usr/bin/env ruby
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require "bundler/setup"
         
     | 
| 
      
 4 
     | 
    
         
            +
            require "model_log"
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            # You can add fixtures and/or initialization code here to make experimenting
         
     | 
| 
      
 7 
     | 
    
         
            +
            # with your gem easier. You can also use a different console, if you like.
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            # (If you use this, don't forget to add pry to your Gemfile!)
         
     | 
| 
      
 10 
     | 
    
         
            +
            # require "pry"
         
     | 
| 
      
 11 
     | 
    
         
            +
            # Pry.start
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            require "irb"
         
     | 
| 
      
 14 
     | 
    
         
            +
            IRB.start(__FILE__)
         
     | 
    
        data/bin/setup
    ADDED
    
    
| 
         @@ -0,0 +1,33 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module ModelLog
         
     | 
| 
      
 2 
     | 
    
         
            +
              module ClassMethods
         
     | 
| 
      
 3 
     | 
    
         
            +
                module Controllers
         
     | 
| 
      
 4 
     | 
    
         
            +
                  def self.included(base)
         
     | 
| 
      
 5 
     | 
    
         
            +
                    base.class_eval do
         
     | 
| 
      
 6 
     | 
    
         
            +
                      extend Invoking
         
     | 
| 
      
 7 
     | 
    
         
            +
                      model_log_user_setting
         
     | 
| 
      
 8 
     | 
    
         
            +
                    end
         
     | 
| 
      
 9 
     | 
    
         
            +
                  end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                  module Invoking
         
     | 
| 
      
 12 
     | 
    
         
            +
                    def model_log_user_setting
         
     | 
| 
      
 13 
     | 
    
         
            +
                      before_action :set_current_passport
         
     | 
| 
      
 14 
     | 
    
         
            +
                      before_action :set_current_request
         
     | 
| 
      
 15 
     | 
    
         
            +
                    end
         
     | 
| 
      
 16 
     | 
    
         
            +
                  end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                  private
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
                    def set_current_passport
         
     | 
| 
      
 21 
     | 
    
         
            +
                      ModelLog::Passport.clear_current_passport!
         
     | 
| 
      
 22 
     | 
    
         
            +
                      ModelLog::Passport.current_passport = send(ModelLog.current_user_method)
         
     | 
| 
      
 23 
     | 
    
         
            +
                    end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
                    def set_current_request
         
     | 
| 
      
 26 
     | 
    
         
            +
                      ModelLog::Request.clear_current_request!
         
     | 
| 
      
 27 
     | 
    
         
            +
                      ModelLog::Request.current_request = request
         
     | 
| 
      
 28 
     | 
    
         
            +
                    end
         
     | 
| 
      
 29 
     | 
    
         
            +
                end
         
     | 
| 
      
 30 
     | 
    
         
            +
              end
         
     | 
| 
      
 31 
     | 
    
         
            +
            end
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
            ActionController::Base.send(:include, ModelLog::ClassMethods::Controllers) if defined? ActionController::Base
         
     | 
| 
         @@ -0,0 +1,101 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module ModelLog
         
     | 
| 
      
 2 
     | 
    
         
            +
              module ClassMethods
         
     | 
| 
      
 3 
     | 
    
         
            +
                module Models
         
     | 
| 
      
 4 
     | 
    
         
            +
                  def self.included(base)
         
     | 
| 
      
 5 
     | 
    
         
            +
                    base.extend Invoking
         
     | 
| 
      
 6 
     | 
    
         
            +
                  end
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                  module Invoking
         
     | 
| 
      
 9 
     | 
    
         
            +
                    def model_log
         
     | 
| 
      
 10 
     | 
    
         
            +
                      after_create :model_log_create
         
     | 
| 
      
 11 
     | 
    
         
            +
                      after_destroy :model_log_destroy
         
     | 
| 
      
 12 
     | 
    
         
            +
                      before_update :model_log_update
         
     | 
| 
      
 13 
     | 
    
         
            +
                    end
         
     | 
| 
      
 14 
     | 
    
         
            +
                  end
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
                  private
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                    def model_log_create
         
     | 
| 
      
 19 
     | 
    
         
            +
                      write_log(self, :create)
         
     | 
| 
      
 20 
     | 
    
         
            +
                    end
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                    def model_log_update
         
     | 
| 
      
 23 
     | 
    
         
            +
                      write_log(self, :update)
         
     | 
| 
      
 24 
     | 
    
         
            +
                    end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                    def model_log_destroy
         
     | 
| 
      
 27 
     | 
    
         
            +
                      write_log(self, :destroy)
         
     | 
| 
      
 28 
     | 
    
         
            +
                    end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                    def data_processing(field_name, field_data, **options)
         
     | 
| 
      
 31 
     | 
    
         
            +
                      if field_data.is_a? CarrierWave::Uploader::Base
         
     | 
| 
      
 32 
     | 
    
         
            +
                        return options[:index] == 0 ? get_uploader_filename(field_data.url) : send("#{field_name}_identifier")
         
     | 
| 
      
 33 
     | 
    
         
            +
                      elsif field_data.is_a? BigDecimal
         
     | 
| 
      
 34 
     | 
    
         
            +
                        return field_data.to_f
         
     | 
| 
      
 35 
     | 
    
         
            +
                      else
         
     | 
| 
      
 36 
     | 
    
         
            +
                        return field_data
         
     | 
| 
      
 37 
     | 
    
         
            +
                      end
         
     | 
| 
      
 38 
     | 
    
         
            +
                    end
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                    def get_uploader_filename(path)
         
     | 
| 
      
 41 
     | 
    
         
            +
                      if path
         
     | 
| 
      
 42 
     | 
    
         
            +
                        rindex = path.rindex('/')
         
     | 
| 
      
 43 
     | 
    
         
            +
                        return path.slice(rindex+1, path.size-rindex-1)
         
     | 
| 
      
 44 
     | 
    
         
            +
                      end
         
     | 
| 
      
 45 
     | 
    
         
            +
                      return nil
         
     | 
| 
      
 46 
     | 
    
         
            +
                    end
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                    def write_log(resource, type)
         
     | 
| 
      
 49 
     | 
    
         
            +
                      begin
         
     | 
| 
      
 50 
     | 
    
         
            +
                        passport = ModelLog::Passport.current_passport
         
     | 
| 
      
 51 
     | 
    
         
            +
                        request = ModelLog::Request.current_request
         
     | 
| 
      
 52 
     | 
    
         
            +
                        type = type.to_s
         
     | 
| 
      
 53 
     | 
    
         
            +
                        can_write = true
         
     | 
| 
      
 54 
     | 
    
         
            +
                        content_text = {}
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                        if type == "update"
         
     | 
| 
      
 57 
     | 
    
         
            +
                          changes = resource.changes
         
     | 
| 
      
 58 
     | 
    
         
            +
                          changes.each do |key, values|
         
     | 
| 
      
 59 
     | 
    
         
            +
                            value_arr = []
         
     | 
| 
      
 60 
     | 
    
         
            +
                            values.each_with_index do |value, i|
         
     | 
| 
      
 61 
     | 
    
         
            +
                              value_arr << data_processing(key, value, :index => i)
         
     | 
| 
      
 62 
     | 
    
         
            +
                            end
         
     | 
| 
      
 63 
     | 
    
         
            +
                            content_text.merge!(Hash[key, value_arr])
         
     | 
| 
      
 64 
     | 
    
         
            +
                          end
         
     | 
| 
      
 65 
     | 
    
         
            +
             
     | 
| 
      
 66 
     | 
    
         
            +
                          can_write = false if content_text.empty?
         
     | 
| 
      
 67 
     | 
    
         
            +
                        else
         
     | 
| 
      
 68 
     | 
    
         
            +
                          resource.class.content_columns.each do |column|
         
     | 
| 
      
 69 
     | 
    
         
            +
                            column_name = column.name
         
     | 
| 
      
 70 
     | 
    
         
            +
                            column_val = data_processing(column_name, resource.send(column_name))
         
     | 
| 
      
 71 
     | 
    
         
            +
                            content_text.merge!(Hash[column_name, column_val])
         
     | 
| 
      
 72 
     | 
    
         
            +
                          end
         
     | 
| 
      
 73 
     | 
    
         
            +
                        end
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
                        file_content = <<-EFO.strip_heredoc.gsub("\n", "\t")
         
     | 
| 
      
 76 
     | 
    
         
            +
                          #{request.try(:request_method)}
         
     | 
| 
      
 77 
     | 
    
         
            +
                          #{request.try(:url)}
         
     | 
| 
      
 78 
     | 
    
         
            +
                          #{request.try(:referer)}
         
     | 
| 
      
 79 
     | 
    
         
            +
                          #{request.try(:remote_ip)}
         
     | 
| 
      
 80 
     | 
    
         
            +
                          #{request.try(:user_agent)}
         
     | 
| 
      
 81 
     | 
    
         
            +
                          #{ModelLog.platform}
         
     | 
| 
      
 82 
     | 
    
         
            +
                          #{passport.try(:id)}
         
     | 
| 
      
 83 
     | 
    
         
            +
                          #{passport.try(ModelLog.user_name_field)}
         
     | 
| 
      
 84 
     | 
    
         
            +
                          #{type.to_s}
         
     | 
| 
      
 85 
     | 
    
         
            +
                          #{resource.class}
         
     | 
| 
      
 86 
     | 
    
         
            +
                          #{resource.id}
         
     | 
| 
      
 87 
     | 
    
         
            +
                          #{Time.now}
         
     | 
| 
      
 88 
     | 
    
         
            +
                          #{content_text}
         
     | 
| 
      
 89 
     | 
    
         
            +
                        EFO
         
     | 
| 
      
 90 
     | 
    
         
            +
             
     | 
| 
      
 91 
     | 
    
         
            +
                        ModelLog.info file_content if can_write
         
     | 
| 
      
 92 
     | 
    
         
            +
                      rescue => e
         
     | 
| 
      
 93 
     | 
    
         
            +
                        ModelLog.info e.message
         
     | 
| 
      
 94 
     | 
    
         
            +
                      end
         
     | 
| 
      
 95 
     | 
    
         
            +
                    end
         
     | 
| 
      
 96 
     | 
    
         
            +
                end
         
     | 
| 
      
 97 
     | 
    
         
            +
              end
         
     | 
| 
      
 98 
     | 
    
         
            +
            end
         
     | 
| 
      
 99 
     | 
    
         
            +
             
     | 
| 
      
 100 
     | 
    
         
            +
            ActiveRecord::Base.send(:include, ModelLog::ClassMethods::Models) if defined? ActiveRecord::Base
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
         @@ -0,0 +1,18 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module ModelLog
         
     | 
| 
      
 2 
     | 
    
         
            +
              module Passport
         
     | 
| 
      
 3 
     | 
    
         
            +
                class << self
         
     | 
| 
      
 4 
     | 
    
         
            +
                  def current_passport
         
     | 
| 
      
 5 
     | 
    
         
            +
                    Thread.current[:passport]
         
     | 
| 
      
 6 
     | 
    
         
            +
                  end
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                  def current_passport=(value)
         
     | 
| 
      
 9 
     | 
    
         
            +
                    Thread.current[:passport] = value
         
     | 
| 
      
 10 
     | 
    
         
            +
                  end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                  def clear_current_passport!
         
     | 
| 
      
 13 
     | 
    
         
            +
                    Thread.current[:passport] = nil
         
     | 
| 
      
 14 
     | 
    
         
            +
                  end
         
     | 
| 
      
 15 
     | 
    
         
            +
                end
         
     | 
| 
      
 16 
     | 
    
         
            +
              end
         
     | 
| 
      
 17 
     | 
    
         
            +
            end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
         @@ -0,0 +1,17 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module ModelLog
         
     | 
| 
      
 2 
     | 
    
         
            +
              module Request
         
     | 
| 
      
 3 
     | 
    
         
            +
                class << self
         
     | 
| 
      
 4 
     | 
    
         
            +
                  def current_request
         
     | 
| 
      
 5 
     | 
    
         
            +
                    Thread.current[:request]
         
     | 
| 
      
 6 
     | 
    
         
            +
                  end
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                  def current_request=(value)
         
     | 
| 
      
 9 
     | 
    
         
            +
                    Thread.current[:request] = value
         
     | 
| 
      
 10 
     | 
    
         
            +
                  end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                  def clear_current_request!
         
     | 
| 
      
 13 
     | 
    
         
            +
                    Thread.current[:request] = nil
         
     | 
| 
      
 14 
     | 
    
         
            +
                  end
         
     | 
| 
      
 15 
     | 
    
         
            +
                end
         
     | 
| 
      
 16 
     | 
    
         
            +
              end
         
     | 
| 
      
 17 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/model_log.rb
    ADDED
    
    | 
         @@ -0,0 +1,22 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require "model_log/version"
         
     | 
| 
      
 2 
     | 
    
         
            +
            require "model_log/passport"
         
     | 
| 
      
 3 
     | 
    
         
            +
            require "model_log/request"
         
     | 
| 
      
 4 
     | 
    
         
            +
            require "model_log/class_methods/models"
         
     | 
| 
      
 5 
     | 
    
         
            +
            require "model_log/class_methods/controllers"
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            module ModelLog
         
     | 
| 
      
 8 
     | 
    
         
            +
              class << self
         
     | 
| 
      
 9 
     | 
    
         
            +
                attr_accessor :platform, :current_user_method, :user_name_field
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                def info(content)
         
     | 
| 
      
 12 
     | 
    
         
            +
                  content = content.chomp + "\n"
         
     | 
| 
      
 13 
     | 
    
         
            +
                  File.open("log/model_log_#{Rails.env}.log", "a+") do |output|
         
     | 
| 
      
 14 
     | 
    
         
            +
                    output.write(content)
         
     | 
| 
      
 15 
     | 
    
         
            +
                  end
         
     | 
| 
      
 16 
     | 
    
         
            +
                end
         
     | 
| 
      
 17 
     | 
    
         
            +
              end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
              @current_user_method = @current_user_method || :current_passport
         
     | 
| 
      
 20 
     | 
    
         
            +
              @user_name_field = @user_name_field || :username
         
     | 
| 
      
 21 
     | 
    
         
            +
            end
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
    
        data/model_log.gemspec
    ADDED
    
    | 
         @@ -0,0 +1,30 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
             
     | 
| 
      
 2 
     | 
    
         
            +
            lib = File.expand_path("../lib", __FILE__)
         
     | 
| 
      
 3 
     | 
    
         
            +
            $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
         
     | 
| 
      
 4 
     | 
    
         
            +
            require "model_log/version"
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            Gem::Specification.new do |spec|
         
     | 
| 
      
 7 
     | 
    
         
            +
              spec.name          = "model_log"
         
     | 
| 
      
 8 
     | 
    
         
            +
              spec.version       = ModelLog::VERSION
         
     | 
| 
      
 9 
     | 
    
         
            +
              spec.authors       = ["sunyudong"]
         
     | 
| 
      
 10 
     | 
    
         
            +
              spec.email         = ["462436208@qq.com"]
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              spec.summary       = "The operation data holds the log file."
         
     | 
| 
      
 13 
     | 
    
         
            +
              spec.description   = "User operation data saves log files and records user information."
         
     | 
| 
      
 14 
     | 
    
         
            +
              spec.homepage      = "https://github.com/OrderSun/model_log"
         
     | 
| 
      
 15 
     | 
    
         
            +
              spec.license       = "MIT"
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
         
     | 
| 
      
 18 
     | 
    
         
            +
              # to allow pushing to a single host or delete this section to allow pushing to any host.
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
              spec.files         = `git ls-files -z`.split("\x0").reject do |f|
         
     | 
| 
      
 21 
     | 
    
         
            +
                f.match(%r{^(test|spec|features)/})
         
     | 
| 
      
 22 
     | 
    
         
            +
              end
         
     | 
| 
      
 23 
     | 
    
         
            +
              spec.bindir        = "exe"
         
     | 
| 
      
 24 
     | 
    
         
            +
              spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
         
     | 
| 
      
 25 
     | 
    
         
            +
              spec.require_paths = ["lib"]
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
              spec.add_development_dependency "bundler", "~> 1.16"
         
     | 
| 
      
 28 
     | 
    
         
            +
              spec.add_development_dependency "rake", "~> 10.0"
         
     | 
| 
      
 29 
     | 
    
         
            +
              spec.add_development_dependency "rspec", "~> 3.0"
         
     | 
| 
      
 30 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,104 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: model_log
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.0
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - sunyudong
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 9 
     | 
    
         
            +
            bindir: exe
         
     | 
| 
      
 10 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2018-03-07 00:00:00.000000000 Z
         
     | 
| 
      
 12 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 13 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 14 
     | 
    
         
            +
              name: bundler
         
     | 
| 
      
 15 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 16 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '1.16'
         
     | 
| 
      
 20 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 21 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 22 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 23 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 24 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 25 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 26 
     | 
    
         
            +
                    version: '1.16'
         
     | 
| 
      
 27 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 28 
     | 
    
         
            +
              name: rake
         
     | 
| 
      
 29 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 30 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 31 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 32 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 33 
     | 
    
         
            +
                    version: '10.0'
         
     | 
| 
      
 34 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 35 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 36 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 37 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 38 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 39 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 40 
     | 
    
         
            +
                    version: '10.0'
         
     | 
| 
      
 41 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 42 
     | 
    
         
            +
              name: rspec
         
     | 
| 
      
 43 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 44 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 45 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 46 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 47 
     | 
    
         
            +
                    version: '3.0'
         
     | 
| 
      
 48 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 49 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 50 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 51 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 52 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 53 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 54 
     | 
    
         
            +
                    version: '3.0'
         
     | 
| 
      
 55 
     | 
    
         
            +
            description: User operation data saves log files and records user information.
         
     | 
| 
      
 56 
     | 
    
         
            +
            email:
         
     | 
| 
      
 57 
     | 
    
         
            +
            - 462436208@qq.com
         
     | 
| 
      
 58 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 59 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 60 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 61 
     | 
    
         
            +
            files:
         
     | 
| 
      
 62 
     | 
    
         
            +
            - ".gitignore"
         
     | 
| 
      
 63 
     | 
    
         
            +
            - ".rspec"
         
     | 
| 
      
 64 
     | 
    
         
            +
            - ".travis.yml"
         
     | 
| 
      
 65 
     | 
    
         
            +
            - CODE_OF_CONDUCT.md
         
     | 
| 
      
 66 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 67 
     | 
    
         
            +
            - Gemfile.lock
         
     | 
| 
      
 68 
     | 
    
         
            +
            - LICENSE.txt
         
     | 
| 
      
 69 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 70 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 71 
     | 
    
         
            +
            - bin/console
         
     | 
| 
      
 72 
     | 
    
         
            +
            - bin/setup
         
     | 
| 
      
 73 
     | 
    
         
            +
            - lib/model_log.rb
         
     | 
| 
      
 74 
     | 
    
         
            +
            - lib/model_log/class_methods/controllers.rb
         
     | 
| 
      
 75 
     | 
    
         
            +
            - lib/model_log/class_methods/models.rb
         
     | 
| 
      
 76 
     | 
    
         
            +
            - lib/model_log/passport.rb
         
     | 
| 
      
 77 
     | 
    
         
            +
            - lib/model_log/request.rb
         
     | 
| 
      
 78 
     | 
    
         
            +
            - lib/model_log/version.rb
         
     | 
| 
      
 79 
     | 
    
         
            +
            - model_log.gemspec
         
     | 
| 
      
 80 
     | 
    
         
            +
            homepage: https://github.com/OrderSun/model_log
         
     | 
| 
      
 81 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 82 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 83 
     | 
    
         
            +
            metadata: {}
         
     | 
| 
      
 84 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 85 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 86 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 87 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 88 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 89 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 90 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 91 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 92 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 93 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 94 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 95 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 96 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 97 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 98 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 99 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 100 
     | 
    
         
            +
            rubygems_version: 2.6.14
         
     | 
| 
      
 101 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 102 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 103 
     | 
    
         
            +
            summary: The operation data holds the log file.
         
     | 
| 
      
 104 
     | 
    
         
            +
            test_files: []
         
     |