fixturizer 0.1.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.debride_whitelist +7 -0
  3. data/.rubocop.yml +80 -0
  4. data/Gemfile +4 -4
  5. data/Rakefile +58 -3
  6. data/VERSION +1 -0
  7. data/bin/console +4 -3
  8. data/bom.xml +802 -0
  9. data/fixturizer.gemspec +34 -16
  10. data/lib/dependencies.rb +10 -0
  11. data/lib/fixturizer/adapters/init.rb +3 -0
  12. data/lib/fixturizer/adapters/mongoid.rb +52 -0
  13. data/lib/fixturizer/configuration.rb +22 -0
  14. data/lib/fixturizer/engines/datasets.rb +46 -0
  15. data/lib/fixturizer/engines/init.rb +3 -0
  16. data/lib/fixturizer/engines/models.rb +73 -0
  17. data/lib/fixturizer/engines/records.rb +23 -0
  18. data/lib/fixturizer/getters/init.rb +28 -0
  19. data/lib/fixturizer/getters/json.rb +16 -0
  20. data/lib/fixturizer/getters/yaml.rb +16 -0
  21. data/lib/fixturizer/rake/manage.rb +3 -1
  22. data/lib/fixturizer/rake/rules/database.rake +13 -9
  23. data/lib/fixturizer/rspec/helpers/database.rb +27 -0
  24. data/lib/fixturizer/rspec/helpers/datasets.rb +19 -0
  25. data/lib/fixturizer/rspec/helpers/getter.rb +24 -0
  26. data/lib/fixturizer/rspec/helpers/records.rb +19 -0
  27. data/lib/fixturizer/rspec/helpers/serializer.rb +25 -0
  28. data/lib/fixturizer/rspec/matchers/database_be_correctly_dropped.rb +16 -0
  29. data/lib/fixturizer/rspec/matchers/database_be_correctly_populated.rb +16 -0
  30. data/lib/fixturizer/rspec/prepare.rb +6 -0
  31. data/lib/fixturizer/serializers/init.rb +30 -0
  32. data/lib/fixturizer/serializers/json.rb +18 -0
  33. data/lib/fixturizer/serializers/yaml.rb +15 -0
  34. data/lib/fixturizer/services.rb +51 -0
  35. data/lib/fixturizer/settings.rb +13 -0
  36. data/lib/fixturizer/version.rb +5 -1
  37. data/lib/fixturizer.rb +10 -109
  38. data/samples/.rspec +3 -0
  39. data/samples/Gemfile +17 -0
  40. data/samples/Rakefile +28 -0
  41. data/samples/app.rb +43 -0
  42. data/samples/config/rules.yml +52 -0
  43. data/samples/config.ru +10 -0
  44. data/samples/spec/app_spec.rb +168 -0
  45. data/samples/spec/fixtures/data.json +10 -0
  46. data/samples/spec/fixtures/data.yml +6 -0
  47. data/samples/spec/spec_helper.rb +23 -0
  48. metadata +218 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab10d4fabe09191e653897a9b9f56a2e2b6ca877bff029f0088a9b7b8e8b4f9a
4
- data.tar.gz: 124246f423b1252d8469efcedbe0291ace136ef2748108d675b5730617cae423
3
+ metadata.gz: 2b32aa16a54c913b66e8d68df00c968faea177694473669e1041e5f120158641
4
+ data.tar.gz: 7896981fd9376c0929896894f306bd47653058aecaffb9f293df3143f9ebe3e0
5
5
  SHA512:
6
- metadata.gz: cb2aa87307709f9ba955921c7b8b084780999e169285e82ea98c1bbd53741278b4f0c44368071b695e04358e9583146f1a7c25e2c17a95d823e0ee074d68526f
7
- data.tar.gz: 4a48949150074bd679b4f14a1014735e68953b7d4f45bb6d6c62c1e70e75284d2e3c5cd8a0b6dde1bb3882e8d2d735fe11bd469be862d5477e6ce3cb37e06acc
6
+ metadata.gz: 11f9ea54665b8be2fe7c2db16b0805d683d348f144d6cd7367dbecf04b562c78a6429b394c2511913882b6a926f267829f2efda6442364548fb38d629415b76f
7
+ data.tar.gz: 1a4714aa619eeef6ff7142a848b5d8d04d452a577353827d34ea463d0bebc4e77592256ce631139bdd2b9ab086eecc00ab388269ffefb7585c01fa2c0b12373e
@@ -0,0 +1,7 @@
1
+ post
2
+ dataset
3
+ generated
4
+ data
5
+ init
6
+ configuration_filename=
7
+ log_target=
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
- source 'https://artifactory-iva.si.francetelecom.fr/artifactory/api/gems/gemsproxy/'
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
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
7
+ gemspec
data/Rakefile CHANGED
@@ -1,6 +1,61 @@
1
- require "bundler/gem_tasks"
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 :default => :spec
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 "bundler/setup"
4
- require "fixturizer"
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 "irb"
14
+ require 'irb'
14
15
  IRB.start(__FILE__)