fixturizer 0.1.0 → 0.4.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 +4 -4
- data/.debride_whitelist +7 -0
- data/.rubocop.yml +80 -0
- data/Gemfile +4 -4
- data/Rakefile +58 -3
- data/VERSION +1 -0
- data/bin/console +4 -3
- data/bom.xml +802 -0
- data/fixturizer.gemspec +34 -16
- data/lib/dependencies.rb +10 -0
- data/lib/fixturizer/adapters/init.rb +3 -0
- data/lib/fixturizer/adapters/mongoid.rb +52 -0
- data/lib/fixturizer/configuration.rb +22 -0
- data/lib/fixturizer/engines/datasets.rb +46 -0
- data/lib/fixturizer/engines/init.rb +3 -0
- data/lib/fixturizer/engines/models.rb +73 -0
- data/lib/fixturizer/engines/records.rb +23 -0
- data/lib/fixturizer/getters/init.rb +28 -0
- data/lib/fixturizer/getters/json.rb +16 -0
- data/lib/fixturizer/getters/yaml.rb +16 -0
- data/lib/fixturizer/rake/manage.rb +3 -1
- data/lib/fixturizer/rake/rules/database.rake +13 -9
- data/lib/fixturizer/rspec/helpers/database.rb +27 -0
- data/lib/fixturizer/rspec/helpers/datasets.rb +19 -0
- data/lib/fixturizer/rspec/helpers/getter.rb +24 -0
- data/lib/fixturizer/rspec/helpers/records.rb +19 -0
- data/lib/fixturizer/rspec/helpers/serializer.rb +25 -0
- data/lib/fixturizer/rspec/matchers/database_be_correctly_dropped.rb +16 -0
- data/lib/fixturizer/rspec/matchers/database_be_correctly_populated.rb +16 -0
- data/lib/fixturizer/rspec/prepare.rb +6 -0
- data/lib/fixturizer/serializers/init.rb +30 -0
- data/lib/fixturizer/serializers/json.rb +18 -0
- data/lib/fixturizer/serializers/yaml.rb +15 -0
- data/lib/fixturizer/services.rb +51 -0
- data/lib/fixturizer/settings.rb +13 -0
- data/lib/fixturizer/version.rb +5 -1
- data/lib/fixturizer.rb +10 -109
- data/samples/.rspec +3 -0
- data/samples/Gemfile +17 -0
- data/samples/Rakefile +28 -0
- data/samples/app.rb +43 -0
- data/samples/config/rules.yml +52 -0
- data/samples/config.ru +10 -0
- data/samples/spec/app_spec.rb +168 -0
- data/samples/spec/fixtures/data.json +10 -0
- data/samples/spec/fixtures/data.yml +6 -0
- data/samples/spec/spec_helper.rb +23 -0
- metadata +218 -8
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 2b32aa16a54c913b66e8d68df00c968faea177694473669e1041e5f120158641
         | 
| 4 | 
            +
              data.tar.gz: 7896981fd9376c0929896894f306bd47653058aecaffb9f293df3143f9ebe3e0
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 11f9ea54665b8be2fe7c2db16b0805d683d348f144d6cd7367dbecf04b562c78a6429b394c2511913882b6a926f267829f2efda6442364548fb38d629415b76f
         | 
| 7 | 
            +
              data.tar.gz: 1a4714aa619eeef6ff7142a848b5d8d04d452a577353827d34ea463d0bebc4e77592256ce631139bdd2b9ab086eecc00ab388269ffefb7585c01fa2c0b12373e
         | 
    
        data/.debride_whitelist
    ADDED
    
    
    
        data/.rubocop.yml
    ADDED
    
    | @@ -0,0 +1,80 @@ | |
| 1 | 
            +
            AllCops:
         | 
| 2 | 
            +
              NewCops: enable
         | 
| 3 | 
            +
              SuggestExtensions: false
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            # Offense count: 2
         | 
| 6 | 
            +
            # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
         | 
| 7 | 
            +
            Metrics/AbcSize:
         | 
| 8 | 
            +
              Max: 34
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            # Offense count: 3
         | 
| 11 | 
            +
            # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
         | 
| 12 | 
            +
            # AllowedMethods: refine
         | 
| 13 | 
            +
            Metrics/BlockLength:
         | 
| 14 | 
            +
              Max: 114
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            # Offense count: 2
         | 
| 17 | 
            +
            # Configuration parameters: AllowedMethods, AllowedPatterns.
         | 
| 18 | 
            +
            Metrics/CyclomaticComplexity:
         | 
| 19 | 
            +
              Max: 9
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            # Offense count: 4
         | 
| 22 | 
            +
            # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
         | 
| 23 | 
            +
            Metrics/MethodLength:
         | 
| 24 | 
            +
              Max: 15
         | 
| 25 | 
            +
             | 
| 26 | 
            +
            # Offense count: 1
         | 
| 27 | 
            +
            # Configuration parameters: AllowedMethods, AllowedPatterns.
         | 
| 28 | 
            +
            Metrics/PerceivedComplexity:
         | 
| 29 | 
            +
              Max: 9
         | 
| 30 | 
            +
             | 
| 31 | 
            +
            # Offense count: 1
         | 
| 32 | 
            +
            Security/Eval:
         | 
| 33 | 
            +
              Exclude:
         | 
| 34 | 
            +
                - 'lib/fixturizer/engines/records.rb'
         | 
| 35 | 
            +
             | 
| 36 | 
            +
            # Offense count: 1
         | 
| 37 | 
            +
            Style/ClassVars:
         | 
| 38 | 
            +
              Exclude:
         | 
| 39 | 
            +
                - 'lib/fixturizer/services.rb'
         | 
| 40 | 
            +
             | 
| 41 | 
            +
            # Offense count: 17
         | 
| 42 | 
            +
            # Configuration parameters: AllowedConstants.
         | 
| 43 | 
            +
            Style/Documentation:
         | 
| 44 | 
            +
              Exclude:
         | 
| 45 | 
            +
                - 'spec/**/*'
         | 
| 46 | 
            +
                - 'test/**/*'
         | 
| 47 | 
            +
                - 'lib/fixturizer/adapters/mongoid.rb'
         | 
| 48 | 
            +
                - 'lib/fixturizer/configuration.rb'
         | 
| 49 | 
            +
                - 'lib/fixturizer/engines/datasets.rb'
         | 
| 50 | 
            +
                - 'lib/fixturizer/engines/models.rb'
         | 
| 51 | 
            +
                - 'lib/fixturizer/engines/records.rb'
         | 
| 52 | 
            +
                - 'lib/fixturizer/rspec/helpers/database.rb'
         | 
| 53 | 
            +
                - 'lib/fixturizer/rspec/helpers/datasets.rb'
         | 
| 54 | 
            +
                - 'lib/fixturizer/rspec/helpers/records.rb'
         | 
| 55 | 
            +
                - 'lib/fixturizer/rspec/helpers/serializer.rb'
         | 
| 56 | 
            +
                - 'lib/fixturizer/serializers/init.rb'
         | 
| 57 | 
            +
                - 'lib/fixturizer/serializers/json.rb'
         | 
| 58 | 
            +
                - 'lib/fixturizer/serializers/yaml.rb'
         | 
| 59 | 
            +
                - 'lib/fixturizer/services.rb'
         | 
| 60 | 
            +
                - 'lib/fixturizer/settings.rb'
         | 
| 61 | 
            +
                - 'samples/app.rb'
         | 
| 62 | 
            +
             | 
| 63 | 
            +
            # Offense count: 1
         | 
| 64 | 
            +
            # This cop supports safe autocorrection (--autocorrect).
         | 
| 65 | 
            +
            Style/EvalWithLocation:
         | 
| 66 | 
            +
              Exclude:
         | 
| 67 | 
            +
                - 'lib/fixturizer/engines/records.rb'
         | 
| 68 | 
            +
             | 
| 69 | 
            +
            # Offense count: 1
         | 
| 70 | 
            +
            Style/MultilineBlockChain:
         | 
| 71 | 
            +
              Exclude:
         | 
| 72 | 
            +
                - 'samples/Rakefile'
         | 
| 73 | 
            +
             | 
| 74 | 
            +
            Gemspec/DevelopmentDependencies:
         | 
| 75 | 
            +
              Exclude:
         | 
| 76 | 
            +
                - 'fixturizer.gemspec'
         | 
| 77 | 
            +
             | 
| 78 | 
            +
            Style/DocumentDynamicEvalDefinition:
         | 
| 79 | 
            +
              Exclude:
         | 
| 80 | 
            +
                - 'lib/fixturizer/engines/records.rb'
         | 
    
        data/Gemfile
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 | 
            -
             | 
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            source 'https://rubygems.org'
         | 
| 2 4 |  | 
| 3 5 | 
             
            # Specify your gem's dependencies in fixturizer.gemspec
         | 
| 4 | 
            -
            gemspec
         | 
| 5 6 |  | 
| 6 | 
            -
             | 
| 7 | 
            -
            gem "rspec", "~> 3.0"
         | 
| 7 | 
            +
            gemspec
         | 
    
        data/Rakefile
    CHANGED
    
    | @@ -1,6 +1,61 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
            require "rspec/core/rake_task"
         | 
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 3 2 |  | 
| 3 | 
            +
            require 'bundler/gem_tasks'
         | 
| 4 | 
            +
            require 'rspec/core/rake_task'
         | 
| 5 | 
            +
            require 'rubocop/rake_task'
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            require 'yard'
         | 
| 8 | 
            +
            require 'yard/rake/yardoc_task'
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            require 'code_statistics'
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            RuboCop::RakeTask.new
         | 
| 4 13 | 
             
            RSpec::Core::RakeTask.new(:spec)
         | 
| 5 14 |  | 
| 6 | 
            -
            task : | 
| 15 | 
            +
            task default: :spec
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            require 'version'
         | 
| 18 | 
            +
            require 'rake/version_task'
         | 
| 19 | 
            +
            Rake::VersionTask.new
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            YARD::Rake::YardocTask.new do |t|
         | 
| 22 | 
            +
              t.files = ['lib/**/*.rb', '-', 'doc/**/*', 'spec/**/*_spec.rb']
         | 
| 23 | 
            +
              t.options += ['-o', 'yardoc']
         | 
| 24 | 
            +
            end
         | 
| 25 | 
            +
            YARD::Config.load_plugin('yard-rspec')
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            namespace :yardoc do
         | 
| 28 | 
            +
              task :clobber do
         | 
| 29 | 
            +
                begin
         | 
| 30 | 
            +
                  rm_r 'yardoc'
         | 
| 31 | 
            +
                rescue StandardError
         | 
| 32 | 
            +
                  nil
         | 
| 33 | 
            +
                end
         | 
| 34 | 
            +
                begin
         | 
| 35 | 
            +
                  rm_r '.yardoc'
         | 
| 36 | 
            +
                rescue StandardError
         | 
| 37 | 
            +
                  nil
         | 
| 38 | 
            +
                end
         | 
| 39 | 
            +
                begin
         | 
| 40 | 
            +
                  rm_r 'pkg'
         | 
| 41 | 
            +
                rescue StandardError
         | 
| 42 | 
            +
                  nil
         | 
| 43 | 
            +
                end
         | 
| 44 | 
            +
              end
         | 
| 45 | 
            +
            end
         | 
| 46 | 
            +
            task clobber: 'yardoc:clobber'
         | 
| 47 | 
            +
             | 
| 48 | 
            +
            desc 'Run CVE security audit over bundle'
         | 
| 49 | 
            +
            task :audit do
         | 
| 50 | 
            +
              system('bundle audit')
         | 
| 51 | 
            +
            end
         | 
| 52 | 
            +
             | 
| 53 | 
            +
            desc 'Run dead line of code detection'
         | 
| 54 | 
            +
            task :debride do
         | 
| 55 | 
            +
              system('debride -w .debride_whitelist .')
         | 
| 56 | 
            +
            end
         | 
| 57 | 
            +
             | 
| 58 | 
            +
            desc 'Run SBOM CycloneDX Xml format file'
         | 
| 59 | 
            +
            task :sbom do
         | 
| 60 | 
            +
              system('cyclonedx-ruby -p .')
         | 
| 61 | 
            +
            end
         | 
    
        data/VERSION
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            0.4.1
         | 
    
        data/bin/console
    CHANGED
    
    | @@ -1,7 +1,8 @@ | |
| 1 1 | 
             
            #!/usr/bin/env ruby
         | 
| 2 | 
            +
            # frozen_string_literal: true
         | 
| 2 3 |  | 
| 3 | 
            -
            require  | 
| 4 | 
            -
            require  | 
| 4 | 
            +
            require 'bundler/setup'
         | 
| 5 | 
            +
            require 'fixturizer'
         | 
| 5 6 |  | 
| 6 7 | 
             
            # You can add fixtures and/or initialization code here to make experimenting
         | 
| 7 8 | 
             
            # with your gem easier. You can also use a different console, if you like.
         | 
| @@ -10,5 +11,5 @@ require "fixturizer" | |
| 10 11 | 
             
            # require "pry"
         | 
| 11 12 | 
             
            # Pry.start
         | 
| 12 13 |  | 
| 13 | 
            -
            require  | 
| 14 | 
            +
            require 'irb'
         | 
| 14 15 | 
             
            IRB.start(__FILE__)
         |