rom-factory 0.10.1 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
1
  ## 0.10.1 2019-12-28
2
2
 
3
+
3
4
  ### Added
4
5
 
5
6
  - Support for faker 2 (@ianks)
@@ -8,13 +9,15 @@
8
9
 
9
10
  - Keyword warnings reported by Ruby 2.7 (@flash-gordon)
10
11
 
12
+
11
13
  [Compare v0.10.0...v0.10.1](https://github.com/rom-rb/rom-factory/compare/v0.10.0...v0.10.1)
12
14
 
13
15
  ## 0.10.0 2019-12-11
14
16
 
17
+
15
18
  ### Added
16
19
 
17
- * `struct_namespace` option is supported by factory builders (@graceful-potato)
20
+ - `struct_namespace` option is supported by factory builders (@graceful-potato)
18
21
 
19
22
  ``` ruby
20
23
  factories.define(:user, struct_namespace: MyApp::Entities) do |f|
@@ -24,98 +27,106 @@
24
27
 
25
28
  ### Fixed
26
29
 
27
- * Support building structs when child assoc does not define parent (@psparrow)
28
- * Fixed `TupleEvaluator#struct_attrs` for non-standard output schema (@AMHOL)
30
+ - Support building structs when child assoc does not define parent (@psparrow)
31
+ - Fixed `TupleEvaluator#struct_attrs` for non-standard output schema (@AMHOL)
32
+
29
33
 
30
34
  [Compare v0.9.1...v0.10.0](https://github.com/rom-rb/rom-factory/compare/v0.9.1...v0.10.0)
31
35
 
32
36
  ## 0.9.1 2019-10-23
33
37
 
38
+
34
39
  ### Fixed
35
40
 
36
- * Attributes of a struct are no longer accidentally passed to their associations (@psparrow)
41
+ - Attributes of a struct are no longer accidentally passed to their associations (@psparrow)
42
+
37
43
 
38
44
  [Compare v0.9.0...v0.9.1](https://github.com/rom-rb/rom-factory/compare/v0.9.0...v0.9.1)
39
45
 
40
46
  ## 0.9.0 2019-08-12
41
47
 
48
+
42
49
  ### Added
43
50
 
44
- * When attributes hash includes unknown attributes, a `ROM::Factory::UnknownAttributeError` will be raised (@rawburt)
51
+ - When attributes hash includes unknown attributes, a `ROM::Factory::UnknownAttributeError` will be raised (@rawburt)
52
+
45
53
 
46
54
  [Compare v0.8.0...v0.9.0](https://github.com/rom-rb/rom-factory/compare/v0.8.0...v0.9.0)
47
55
 
48
56
  ## 0.8.0 2019-04-24
49
57
 
58
+
50
59
  ### Fixed
51
60
 
52
- * Loaded association structs are no longer rejected by output schemas (issue #34) (flash-gordon + solnic)
61
+ - Loaded association structs are no longer rejected by output schemas (issue #34) (flash-gordon + solnic)
62
+
53
63
 
54
64
  [Compare v0.7.0...v0.8.0](https://github.com/rom-rb/rom-factory/compare/v0.7.0...v0.8.0)
55
65
 
56
66
  ## 0.7.0 2018-11-17
57
67
 
68
+
58
69
  ### Added
59
70
 
60
- * Support for traits (v-kolesnikov)
61
- * Support building structs with associations (@ianks)
71
+ - Support for traits (v-kolesnikov)
72
+ - Support building structs with associations (@ianks)
62
73
 
63
74
  ### Fixed
64
75
 
65
- * Overwritten attributes with dependencies (JanaVPetrova)
76
+ - Overwritten attributes with dependencies (JanaVPetrova)
77
+
66
78
 
67
79
  [Compare v0.6.0...v0.7.0](https://github.com/rom-rb/rom-factory/compare/v0.6.0...v0.7.0)
68
80
 
69
81
  ## 0.6.0 2018-01-31
70
82
 
83
+
71
84
  ### Added
72
85
 
73
- * Support for factories with custom struct namespaces (solnic)
86
+ - Support for factories with custom struct namespaces (solnic)
74
87
 
75
- ### Changed
88
+ ### Fixed
76
89
 
77
- * Accessing a factory which is not defined will result in `FactoryNotDefinedError` exception (GustavoCaso + solnic)
90
+ - Using dependent attributes with sequences works correctly, ie `f.sequence(:login) { |i, name| "name-#{i}"}` (solnic)
78
91
 
79
- ### Fixed
92
+ ### Changed
80
93
 
81
- * Using dependent attributes with sequences works correctly, ie `f.sequence(:login) { |i, name| "name-#{i}"}` (solnic)
94
+ - Accessing a factory which is not defined will result in `FactoryNotDefinedError` exception (GustavoCaso + solnic)
82
95
 
83
96
  [Compare v0.5.0...v0.6.0](https://github.com/rom-rb/rom-factory/compare/v0.5.0...v0.6.0)
84
97
 
85
98
  ## 0.5.0 2017-10-24
86
99
 
100
+
87
101
  ### Added
88
102
 
89
- * Updated to rom 4.0 (solnic)
90
- * Support for `has_many` and `has_one` associations (solnic)
91
- * Support for attributes depending on values from other attributes (solnic)
92
- * Support for `rand` inside the generator block (flash-gordon)
103
+ - Updated to rom 4.0 (solnic)
104
+ - Support for `has_many` and `has_one` associations (solnic)
105
+ - Support for attributes depending on values from other attributes (solnic)
106
+ - Support for `rand` inside the generator block (flash-gordon)
93
107
 
94
108
  ### Changed
95
109
 
96
- * Depends on `rom-core` now (solnic)
110
+ - Depends on `rom-core` now (solnic)
97
111
 
98
112
  [Compare v0.4.0...v0.5.0](https://github.com/rom-rb/rom-factory/compare/v0.4.0...v0.5.0)
99
113
 
100
- ## v0.4.0 2017-03-03
114
+ ## 0.4.0 2017-03-03
101
115
 
102
- This is a revamp of the original `rom_factory` gem which adds new features and
103
116
  improves internals.
104
117
 
105
118
  ### Added
106
119
 
107
- * Support for defining multiple factories via `MyFactory = ROM::Factory.configure { |c| ... }` (solnic)
108
- * Support for builder inheritence via `define(admin: :user) { |f| ... }` (solnic)
109
- * Support for generating in-memory structs via `MyFactory.structs[:user]` that are not persisted (solnic)
110
- * Support for `belongs_to` associations via `f.association(:user)` (solnic)
111
- * New DSL for defining builders `MyFactory.define(:user) { |f| ... }` which infers default relation name (solnic)
112
- * New factory method `MyFactory#[]` ie `MyFactory[:user, name: "Jane"]` (solnic)
113
- * New `fake` helper which uses faker gem under the hood ie `f.email { fake(:internet, :email) }` (solnic)
120
+ - Support for defining multiple factories via `MyFactory = ROM::Factory.configure { |c| ... }` (solnic)
121
+ - Support for builder inheritence via `define(admin: :user) { |f| ... }` (solnic)
122
+ - Support for generating in-memory structs via `MyFactory.structs[:user]` that are not persisted (solnic)
123
+ - Support for `belongs_to` associations via `f.association(:user)` (solnic)
124
+ - New DSL for defining builders `MyFactory.define(:user) { |f| ... }` which infers default relation name (solnic)
125
+ - New factory method `MyFactory#[]` ie `MyFactory[:user, name: "Jane"]` (solnic)
126
+ - New `fake` helper which uses faker gem under the hood ie `f.email { fake(:internet, :email) }` (solnic)
114
127
 
115
128
  ### Changed
116
129
 
117
- * `Rom::Factory::Config.configure` was replaced with `ROM::Factory.configure` (solnic)
118
- * Global factory config and builders are gone (solnic)
119
- * Structs are now based on dry-struct (solnic)
120
-
121
- [Compare v0.3.1...v0.4.0](https://github.com/rom-rb/rom-factory/compare/v0.3.1...v0.4.0)
130
+ - `Rom::Factory::Config.configure` was replaced with `ROM::Factory.configure` (solnic)
131
+ - Global factory config and builders are gone (solnic)
132
+ - Structs are now based on dry-struct (solnic)
@@ -10,4 +10,4 @@ Project maintainers have the right and responsibility to remove, edit, or reject
10
10
 
11
11
  Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
12
 
13
- This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct](https://www.contributor-covenant.org/version/1/4/code-of-conduct)
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.4.0, available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct](https://www.contributor-covenant.org/version/1/4/code-of-conduct)
@@ -22,7 +22,7 @@ Other requirements:
22
22
  2) Follow the style conventions of the surrounding code. In most cases, this is standard ruby style.
23
23
  3) Add API documentation if it's a new feature
24
24
  4) Update API documentation if it changes an existing feature
25
- 5) Bonus points for sending a PR to [github.com/rom-rb/rom-rb.org](github.com/rom-rb/rom-rb.org) which updates user documentation and guides
25
+ 5) Bonus points for sending a PR which updates user documentation in the `docsite` directory
26
26
 
27
27
  # Asking for help
28
28
 
data/Gemfile CHANGED
@@ -4,7 +4,9 @@ source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
6
 
7
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
7
+ eval_gemfile 'Gemfile.devtools'
8
+
9
+ gem 'faker', "~> #{ENV['FAKER'].eql?('faker-1') ? '1.7' : '2.8'}"
8
10
 
9
11
  gem 'rake', '~> 12.0'
10
12
  gem 'rspec', '~> 3.0'
@@ -16,14 +18,11 @@ end
16
18
  group :test do
17
19
  gem 'rom-sql', github: 'rom-rb/rom-sql', branch: 'master'
18
20
  gem 'inflecto'
19
- gem 'pry-byebug', platforms: :mri
20
- gem 'pry', platforms: :jruby
21
- gem 'codeclimate-test-reporter'
22
- gem 'simplecov'
21
+ gem 'pry-byebug', '~> 3.8', platforms: :ruby
22
+ gem 'pry', '~> 0.12.0', '<= 0.13'
23
23
 
24
- gem 'pg', '~> 0.21', platforms: [:mri, :truffleruby]
24
+ gem 'pg', '~> 0.21', platforms: :ruby
25
25
  gem 'jdbc-postgres', platforms: :jruby
26
- gem 'warning'
27
26
  end
28
27
 
29
28
  group :tools do
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ # this file is managed by rom-rb/devtools project
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ group :test do
8
+ # 0.18.x breaks codacy result parser
9
+ gem "simplecov", "0.17.1", require: false, platforms: :ruby
10
+
11
+ gem "codacy-coverage", require: false, platforms: :ruby
12
+
13
+ gem "warning" if RUBY_VERSION >= "2.4.0"
14
+ end
15
+
16
+ group :tools do
17
+ # this is the same version that we use on codacy
18
+ gem "rubocop", "0.71.0"
19
+ end
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-2019 rom-rb team
3
+ Copyright (c) 2015-2020 rom-rb team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -1,64 +1,29 @@
1
1
  [gem]: https://rubygems.org/gems/rom-factory
2
2
  [actions]: https://github.com/rom-rb/rom-factory/actions
3
- [codeclimate]: https://codeclimate.com/github/rom-rb/rom-factory
3
+ [codacy]: https://www.codacy.com/gh/rom-rb/rom-factory
4
+ [chat]: https://rom-rb.zulipchat.com
4
5
  [inchpages]: http://inch-ci.org/github/rom-rb/rom-factory
5
6
 
6
- # rom-factory
7
+ # rom-factory [![Join the chat at https://rom-rb.zulipchat.com](https://img.shields.io/badge/rom--rb-join%20chat-%23346b7a.svg)][chat]
7
8
 
8
9
  [![Gem Version](https://badge.fury.io/rb/rom-factory.svg)][gem]
9
10
  [![CI Status](https://github.com/rom-rb/rom-factory/workflows/ci/badge.svg)][actions]
10
- [![Code Climate](https://codeclimate.com/github/rom-rb/rom-factory/badges/gpa.svg)][codeclimate]
11
- [![Test Coverage](https://codeclimate.com/github/rom-rb/rom-factory/badges/coverage.svg)][codeclimate]
11
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/5fd26fae687549218458879b1a607e18)][codacy]
12
+ [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/5fd26fae687549218458879b1a607e18)][codacy]
12
13
  [![Inline docs](http://inch-ci.org/github/rom-rb/rom-factory.svg?branch=master)][inchpages]
13
14
 
14
- Data generator with support for persistence backends, built on top of [rom-rb](http://rom-rb.org) and [dry-rb](http://dry-rb.org).
15
+ ## Links
15
16
 
16
- More information:
17
+ * [User documentation](http://rom-rb.org/learn/rom-factory)
18
+ * [API documentation](http://rubydoc.info/gems/rom-factory)
17
19
 
18
- - [API docs](http://rubydoc.info/gems/rom-factory)
20
+ ## Supported Ruby versions
19
21
 
20
- ## Installation
22
+ This library officially supports the following Ruby versions:
21
23
 
22
- Add this line to your application's Gemfile:
23
-
24
- ```ruby
25
- gem 'rom-factory'
26
- ```
27
-
28
- And then execute:
29
-
30
- $ bundle
31
-
32
- Or install it yourself as:
33
-
34
- $ gem install rom-factory
35
-
36
- ### Performance
37
-
38
- Seems like this thing is a bit faster than other popular factory gems:
39
-
40
- ```
41
- Warming up --------------------------------------
42
- rom-factory 1.000 i/100ms
43
- factory_girl 1.000 i/100ms
44
- fabrication 1.000 i/100ms
45
- Calculating -------------------------------------
46
- rom-factory 1.550 (± 0.0%) i/s - 8.000 in 5.166227s
47
- factory_girl 0.982 (± 0.0%) i/s - 5.000 in 5.098193s
48
- fabrication 1.011 (± 0.0%) i/s - 6.000 in 5.942209s
49
-
50
- Comparison:
51
- rom-factory: 1.5 i/s
52
- fabrication: 1.0 i/s - 1.53x slower
53
- factory_girl: 1.0 i/s - 1.58x slower
54
- ```
55
-
56
- > See [benchmarks/basic.rb](https://github.com/rom-rb/rom-factory/blob/master/benchmarks/basic.rb)
57
-
58
- ## Credits
59
-
60
- This project was originally created by [Jānis Miezītis](https://github.com/janjiss) and eventually moved to `rom-rb` organization.
24
+ * MRI >= `2.4`
25
+ * jruby >= `9.2`
61
26
 
62
27
  ## License
63
28
 
64
- See `LICENSE.txt` file.
29
+ See `LICENSE` file.
@@ -0,0 +1,76 @@
1
+ ---
2
+ - version: 0.10.2
3
+ date: "2020-04-05"
4
+ fixed:
5
+ - Fix more keyword warnings (@flash-gordon)
6
+ - version: 0.10.1
7
+ date: '2019-12-28'
8
+ added:
9
+ - 'Support for faker 2 (@ianks)'
10
+ fixed:
11
+ - Keyword warnings reported by Ruby 2.7 (@flash-gordon)
12
+ - version: 0.10.0
13
+ date: '2019-12-11'
14
+ added:
15
+ - |-
16
+ `struct_namespace` option is supported by factory builders (@graceful-potato)
17
+
18
+ ``` ruby
19
+ factories.define(:user, struct_namespace: MyApp::Entities) do |f|
20
+ # ...
21
+ end
22
+ ```
23
+ fixed:
24
+ - Support building structs when child assoc does not define parent (@psparrow)
25
+ - 'Fixed `TupleEvaluator#struct_attrs` for non-standard output schema (@AMHOL)'
26
+ - version: 0.9.1
27
+ date: '2019-10-23'
28
+ fixed:
29
+ - Attributes of a struct are no longer accidentally passed to their associations (@psparrow)
30
+ - version: 0.9.0
31
+ date: '2019-08-12'
32
+ added:
33
+ - 'When attributes hash includes unknown attributes, a `ROM::Factory::UnknownAttributeError` will be raised (@rawburt)'
34
+ - version: 0.8.0
35
+ date: '2019-04-24'
36
+ fixed:
37
+ - 'Loaded association structs are no longer rejected by output schemas (issue #34) (flash-gordon + solnic)'
38
+ - version: 0.7.0
39
+ date: '2018-11-17'
40
+ added:
41
+ - Support for traits (v-kolesnikov)
42
+ - Support building structs with associations (@ianks)
43
+ fixed:
44
+ - Overwritten attributes with dependencies (JanaVPetrova)
45
+ - version: 0.6.0
46
+ date: '2018-01-31'
47
+ added:
48
+ - Support for factories with custom struct namespaces (solnic)
49
+ changed:
50
+ - 'Accessing a factory which is not defined will result in `FactoryNotDefinedError` exception (GustavoCaso + solnic)'
51
+ fixed:
52
+ - 'Using dependent attributes with sequences works correctly, ie `f.sequence(:login) { |i, name| "name-#{i}"}` (solnic)'
53
+ - version: 0.5.0
54
+ date: '2017-10-24'
55
+ added:
56
+ - Updated to rom 4.0 (solnic)
57
+ - 'Support for `has_many` and `has_one` associations (solnic)'
58
+ - Support for attributes depending on values from other attributes (solnic)
59
+ - 'Support for `rand` inside the generator block (flash-gordon)'
60
+ changed:
61
+ - 'Depends on `rom-core` now (solnic)'
62
+ - version: 0.4.0
63
+ date: '2017-03-03'
64
+ summary: improves internals.
65
+ added:
66
+ - 'Support for defining multiple factories via `MyFactory = ROM::Factory.configure { |c| ... }` (solnic)'
67
+ - 'Support for builder inheritence via `define(admin: :user) { |f| ... }` (solnic)'
68
+ - 'Support for generating in-memory structs via `MyFactory.structs[:user]` that are not persisted (solnic)'
69
+ - 'Support for `belongs_to` associations via `f.association(:user)` (solnic)'
70
+ - 'New DSL for defining builders `MyFactory.define(:user) { |f| ... }` which infers default relation name (solnic)'
71
+ - 'New factory method `MyFactory#[]` ie `MyFactory[:user, name: "Jane"]` (solnic)'
72
+ - 'New `fake` helper which uses faker gem under the hood ie `f.email { fake(:internet, :email) }` (solnic)'
73
+ changed:
74
+ - "`Rom::Factory::Config.configure` was replaced with `ROM::Factory.configure` (solnic)"
75
+ - Global factory config and builders are gone (solnic)
76
+ - Structs are now based on dry-struct (solnic)
@@ -104,6 +104,7 @@ module ROM
104
104
  def fake(*args)
105
105
  ::ROM::Factory.fake(*args)
106
106
  end
107
+ ruby2_keywords(:fake) if respond_to?(:ruby2_keywords, true)
107
108
 
108
109
  def trait(name, parents = [], &block)
109
110
  _traits[name] = DSL.new(
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ROM
4
4
  module Factory
5
- VERSION = '0.10.1'
5
+ VERSION = '0.10.2'
6
6
  end
7
7
  end
@@ -0,0 +1,2 @@
1
+ name: rom-factory
2
+ codacy_id: 5fd26fae687549218458879b1a607e18
@@ -33,6 +33,4 @@ Gem::Specification.new do |spec|
33
33
  spec.add_dependency "dry-core", "~> 0.4"
34
34
  spec.add_dependency 'faker', '>= 1.7', '< 3.0'
35
35
  spec.add_dependency 'rom-core', '~> 5.0'
36
-
37
- spec.add_development_dependency 'appraisal'
38
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom-factory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janis Miezitis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-12-28 00:00:00.000000000 Z
12
+ date: 2020-04-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dry-configurable
@@ -73,20 +73,6 @@ dependencies:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '5.0'
76
- - !ruby/object:Gem::Dependency
77
- name: appraisal
78
- requirement: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- type: :development
84
- prerelease: false
85
- version_requirements: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
76
  description: ''
91
77
  email:
92
78
  - janjiss@gmail.com
@@ -95,13 +81,14 @@ executables: []
95
81
  extensions: []
96
82
  extra_rdoc_files: []
97
83
  files:
98
- - ".codeclimate.yml"
84
+ - ".devtools/templates/changelog.erb"
99
85
  - ".github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md"
100
86
  - ".github/ISSUE_TEMPLATE/----please-don-t-report-feature-requests-via-issues.md"
101
87
  - ".github/ISSUE_TEMPLATE/---a-detailed-bug-report.md"
102
88
  - ".github/ISSUE_TEMPLATE/---bug-report.md"
103
89
  - ".github/ISSUE_TEMPLATE/---feature-request.md"
104
- - ".github/workflows/custom_ci.yml"
90
+ - ".github/workflows/ci.yml"
91
+ - ".github/workflows/custom/ci.yml"
105
92
  - ".github/workflows/docsite.yml"
106
93
  - ".github/workflows/sync_configs.yml"
107
94
  - ".gitignore"
@@ -113,16 +100,14 @@ files:
113
100
  - CODE_OF_CONDUCT.md
114
101
  - CONTRIBUTING.md
115
102
  - Gemfile
103
+ - Gemfile.devtools
116
104
  - LICENSE
117
105
  - LICENSE.txt
118
106
  - README.md
119
107
  - Rakefile
120
108
  - benchmarks/basic.rb
109
+ - changelog.yml
121
110
  - docsite/source/index.html.md
122
- - gemfiles/faker_1.gemfile
123
- - gemfiles/faker_1.gemfile.lock
124
- - gemfiles/faker_2.gemfile
125
- - gemfiles/faker_2.gemfile.lock
126
111
  - lib/rom-factory.rb
127
112
  - lib/rom/factory.rb
128
113
  - lib/rom/factory/attribute_registry.rb
@@ -140,6 +125,7 @@ files:
140
125
  - lib/rom/factory/sequences.rb
141
126
  - lib/rom/factory/tuple_evaluator.rb
142
127
  - lib/rom/factory/version.rb
128
+ - project.yml
143
129
  - rom-factory.gemspec
144
130
  homepage: https://github.com/rom-rb/rom-factory
145
131
  licenses: