Hello community,
here is the log from the commit of package rubygem-factory_girl for
openSUSE:Factory checked in at 2017-11-01 11:09:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-factory_girl (Old)
and /work/SRC/openSUSE:Factory/.rubygem-factory_girl.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-factory_girl"
Wed Nov 1 11:09:31 2017 rev:16 rq:537506 version:4.9.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-factory_girl/rubygem-factory_girl.changes
2017-10-17 01:52:52.845415066 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-factory_girl.new/rubygem-factory_girl.changes
2017-11-01 11:09:30.586054985 +0100
@@ -1,0 +2,9 @@
+Thu Oct 26 09:59:24 UTC 2017 - [email protected]
+
+- updated to version 4.9.0
+ see installed NEWS
+
+ 4.9.0 (October 23, 2017)
+ Deprecate factory_girl in favor of factory_bot
+
+-------------------------------------------------------------------
Old:
----
factory_girl-4.8.1.gem
New:
----
factory_girl-4.9.0.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-factory_girl.spec ++++++
--- /var/tmp/diff_new_pack.9sFUsH/_old 2017-11-01 11:09:31.122035407 +0100
+++ /var/tmp/diff_new_pack.9sFUsH/_new 2017-11-01 11:09:31.122035407 +0100
@@ -24,7 +24,7 @@
#
Name: rubygem-factory_girl
-Version: 4.8.1
+Version: 4.9.0
Release: 0
%define mod_name factory_girl
%define mod_full_name %{mod_name}-%{version}
++++++ factory_girl-4.8.1.gem -> factory_girl-4.9.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/GETTING_STARTED.md new/GETTING_STARTED.md
--- old/GETTING_STARTED.md 2017-09-28 12:58:50.000000000 +0200
+++ new/GETTING_STARTED.md 2017-10-23 22:28:22.000000000 +0200
@@ -986,14 +986,12 @@
desc "Verify that all FactoryGirl factories are valid"
task lint: :environment do
if Rails.env.test?
- begin
- DatabaseCleaner.start
+ DatabaseCleaner.cleaning do
FactoryGirl.lint
- ensure
- DatabaseCleaner.clean
end
else
system("bundle exec rake factory_girl:lint RAILS_ENV='test'")
+ exit $?.exitstatus
end
end
end
@@ -1030,6 +1028,12 @@
FactoryGirl.lint factories_to_lint, traits: true
```
+You can also specify the strategy used for linting:
+
+```ruby
+FactoryGirl.lint strategy: :build
+```
+
Custom Construction
-------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Gemfile.lock new/Gemfile.lock
--- old/Gemfile.lock 2017-09-28 12:58:50.000000000 +0200
+++ new/Gemfile.lock 2017-10-23 22:28:22.000000000 +0200
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- factory_girl (4.8.1)
+ factory_girl (4.9.0)
activesupport (>= 3.0.0)
GEM
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LICENSE new/LICENSE
--- old/LICENSE 2017-09-28 12:58:50.000000000 +0200
+++ new/LICENSE 2017-10-23 22:28:22.000000000 +0200
@@ -1,4 +1,4 @@
-Copyright (c) 2008-2016 Joe Ferris and thoughtbot, inc.
+Copyright (c) 2008-2017 Joe Ferris and thoughtbot, inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/NEWS new/NEWS
--- old/NEWS 2017-09-28 12:58:50.000000000 +0200
+++ new/NEWS 2017-10-23 22:28:22.000000000 +0200
@@ -1,3 +1,6 @@
+4.9.0 (October 23, 2017)
+ Deprecate factory_girl in favor of factory_bot
+
4.8.1 (September 28, 2017)
Explicitly define `#destroyed?` within the `Stub` strategy to return `nil`
instead of raising
Update various dependencies
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2017-09-28 12:58:50.000000000 +0200
+++ new/README.md 2017-10-23 22:28:22.000000000 +0200
@@ -78,7 +78,7 @@
License
-------
-factory_girl is Copyright © 2008-2016 Joe Ferris and thoughtbot. It is free
+factory_girl is Copyright © 2008-2017 Joe Ferris and thoughtbot. It is free
software, and may be redistributed under the terms specified in the
[LICENSE](/LICENSE) file.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/UPGRADE_FROM_FACTORY_GIRL.md
new/UPGRADE_FROM_FACTORY_GIRL.md
--- old/UPGRADE_FROM_FACTORY_GIRL.md 1970-01-01 01:00:00.000000000 +0100
+++ new/UPGRADE_FROM_FACTORY_GIRL.md 2017-10-23 22:28:22.000000000 +0200
@@ -0,0 +1,48 @@
+# Upgrade from factory\_girl
+
+Upgrading your codebase should involve only a few steps, and in most cases, it
+involves updating the Gemfile, factories file(s), and support file configuring
+the testing framework.
+
+## Modify your Gemfile
+
+Replace references to factory\_girl\_rails or factory\_girl with
+factory\_bot\_rails or factory\_bot. Both new gems are available starting at
+version 4.8.2.
+
+```ruby
+# Gemfile
+
+# old
+group :development, :test do
+ gem "factory_girl_rails"
+ # or
+ gem "factory_girl"
+end
+
+# new
+group :development, :test do
+ gem "factory_bot_rails"
+ # or
+ gem "factory_bot"
+end
+```
+
+## Replace All Constant References
+
+A global find-and-replace of `FactoryGirl` to `FactoryBot` across the codebase
+to replace all references with the new constant should do the trick. For
+example, on OS X:
+
+```sh
+grep -e FactoryGirl **/*.rake **/*.rb -l | xargs sed -i ""
"s|FactoryGirl|FactoryBot|"
+```
+
+## Replace All Path References
+
+If you're requiring files from factory\_girl or factory\_girl\_rails directly,
+you'll have to update the paths.
+
+```sh
+grep -e factory_girl **/*.rake **/*.rb -l | xargs sed -i ""
"s|factory_girl|factory_bot|"
+```
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gemfiles/3.2.gemfile.lock
new/gemfiles/3.2.gemfile.lock
--- old/gemfiles/3.2.gemfile.lock 2017-09-28 12:58:50.000000000 +0200
+++ new/gemfiles/3.2.gemfile.lock 2017-10-23 22:28:22.000000000 +0200
@@ -18,7 +18,7 @@
PATH
remote: ../
specs:
- factory_girl (4.8.1)
+ factory_girl (4.9.0)
activesupport (>= 3.0.0)
GEM
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gemfiles/4.0.gemfile.lock
new/gemfiles/4.0.gemfile.lock
--- old/gemfiles/4.0.gemfile.lock 2017-09-28 12:58:50.000000000 +0200
+++ new/gemfiles/4.0.gemfile.lock 2017-10-23 22:28:22.000000000 +0200
@@ -1,7 +1,7 @@
PATH
remote: ../
specs:
- factory_girl (4.8.1)
+ factory_girl (4.9.0)
activesupport (>= 3.0.0)
GEM
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gemfiles/4.1.gemfile.lock
new/gemfiles/4.1.gemfile.lock
--- old/gemfiles/4.1.gemfile.lock 2017-09-28 12:58:50.000000000 +0200
+++ new/gemfiles/4.1.gemfile.lock 2017-10-23 22:28:22.000000000 +0200
@@ -1,7 +1,7 @@
PATH
remote: ../
specs:
- factory_girl (4.8.1)
+ factory_girl (4.9.0)
activesupport (>= 3.0.0)
GEM
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gemfiles/4.2.gemfile.lock
new/gemfiles/4.2.gemfile.lock
--- old/gemfiles/4.2.gemfile.lock 2017-09-28 12:58:50.000000000 +0200
+++ new/gemfiles/4.2.gemfile.lock 2017-10-23 22:28:22.000000000 +0200
@@ -1,7 +1,7 @@
PATH
remote: ../
specs:
- factory_girl (4.8.1)
+ factory_girl (4.9.0)
activesupport (>= 3.0.0)
GEM
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gemfiles/5.0.gemfile.lock
new/gemfiles/5.0.gemfile.lock
--- old/gemfiles/5.0.gemfile.lock 2017-09-28 12:58:50.000000000 +0200
+++ new/gemfiles/5.0.gemfile.lock 2017-10-23 22:28:22.000000000 +0200
@@ -1,7 +1,7 @@
PATH
remote: ../
specs:
- factory_girl (4.8.1)
+ factory_girl (4.9.0)
activesupport (>= 3.0.0)
GEM
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/factory_girl/evaluation.rb
new/lib/factory_girl/evaluation.rb
--- old/lib/factory_girl/evaluation.rb 2017-09-28 12:58:50.000000000 +0200
+++ new/lib/factory_girl/evaluation.rb 2017-10-23 22:28:22.000000000 +0200
@@ -4,7 +4,8 @@
class Evaluation
include Observable
- def initialize(attribute_assigner, to_create)
+ def initialize(evaluator, attribute_assigner, to_create)
+ @evaluator = evaluator
@attribute_assigner = attribute_assigner
@to_create = to_create
end
@@ -12,7 +13,10 @@
delegate :object, :hash, to: :@attribute_assigner
def create(result_instance)
- @to_create[result_instance]
+ case @to_create.arity
+ when 2 then @to_create[result_instance, @evaluator]
+ else @to_create[result_instance]
+ end
end
def notify(name, result_instance)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/factory_girl/factory.rb
new/lib/factory_girl/factory.rb
--- old/lib/factory_girl/factory.rb 2017-09-28 12:58:50.000000000 +0200
+++ new/lib/factory_girl/factory.rb 2017-10-23 22:28:22.000000000 +0200
@@ -36,7 +36,8 @@
evaluator = evaluator_class.new(strategy, overrides.symbolize_keys)
attribute_assigner = AttributeAssigner.new(evaluator, build_class,
&compiled_constructor)
- evaluation = Evaluation.new(attribute_assigner, compiled_to_create)
+ evaluation =
+ Evaluation.new(evaluator, attribute_assigner, compiled_to_create)
evaluation.add_observer(CallbacksObserver.new(callbacks, evaluator))
strategy.result(evaluation).tap(&block)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/factory_girl/linter.rb
new/lib/factory_girl/linter.rb
--- old/lib/factory_girl/linter.rb 2017-09-28 12:58:50.000000000 +0200
+++ new/lib/factory_girl/linter.rb 2017-10-23 22:28:22.000000000 +0200
@@ -1,9 +1,10 @@
module FactoryGirl
class Linter
- def initialize(factories_to_lint, linting_strategy)
- @factories_to_lint = factories_to_lint
+ def initialize(factories, linting_strategy, factory_strategy = :create)
+ @factories_to_lint = factories
@linting_method = "lint_#{linting_strategy}"
+ @factory_strategy = factory_strategy
@invalid_factories = calculate_invalid_factories
end
@@ -13,11 +14,10 @@
end
end
- attr_reader :factories_to_lint, :invalid_factories
- private :factories_to_lint, :invalid_factories
-
private
+ attr_reader :factories_to_lint, :invalid_factories, :factory_strategy
+
def calculate_invalid_factories
factories_to_lint.reduce(Hash.new([])) do |result, factory|
errors = send(@linting_method, factory)
@@ -56,7 +56,7 @@
def lint_factory(factory)
result = []
begin
- FactoryGirl.create(factory.name)
+ FactoryGirl.public_send(factory_strategy, factory.name)
rescue => error
result |= [FactoryError.new(error, factory)]
end
@@ -67,7 +67,7 @@
result = []
factory.definition.defined_traits.map(&:name).each do |trait_name|
begin
- FactoryGirl.create(factory.name, trait_name)
+ FactoryGirl.public_send(factory_strategy, factory.name, trait_name)
rescue => error
result |=
[FactoryTraitError.new(error, factory, trait_name)]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/factory_girl/version.rb
new/lib/factory_girl/version.rb
--- old/lib/factory_girl/version.rb 2017-09-28 12:58:50.000000000 +0200
+++ new/lib/factory_girl/version.rb 2017-10-23 22:28:22.000000000 +0200
@@ -1,3 +1,3 @@
module FactoryGirl
- VERSION = '4.8.1'.freeze
+ VERSION = '4.9.0'.freeze
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/factory_girl.rb new/lib/factory_girl.rb
--- old/lib/factory_girl.rb 2017-09-28 12:58:50.000000000 +0200
+++ new/lib/factory_girl.rb 2017-10-23 22:28:22.000000000 +0200
@@ -59,12 +59,14 @@
# Parameters:
# factories - which factories to lint; omit for all factories
# options:
- # traits : true - to lint traits as well as factories
+ # traits: true - to lint traits as well as factories
+ # strategy: :create - to specify the strategy for linting
def self.lint(*args)
options = args.extract_options!
factories_to_lint = args[0] || FactoryGirl.factories
- strategy = options[:traits] ? :factory_and_traits : :factory
- Linter.new(factories_to_lint, strategy).lint!
+ linting_strategy = options[:traits] ? :factory_and_traits : :factory
+ factory_strategy = options[:strategy] || :create
+ Linter.new(factories_to_lint, linting_strategy, factory_strategy).lint!
end
class << self
@@ -152,3 +154,5 @@
FactoryGirl.register_default_strategies
FactoryGirl.register_default_callbacks
+
+ActiveSupport::Deprecation.warn "The factory_girl gem is deprecated. Please
upgrade to factory_bot. See
https://github.com/thoughtbot/factory_bot/blob/v4.9.0/UPGRADE_FROM_FACTORY_GIRL.md
for further instructions."
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2017-09-28 12:58:50.000000000 +0200
+++ new/metadata 2017-10-23 22:28:22.000000000 +0200
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: factory_girl
version: !ruby/object:Gem::Version
- version: 4.8.1
+ version: 4.9.0
platform: ruby
authors:
- Josh Clayton
@@ -9,7 +9,7 @@
autorequire:
bindir: bin
cert_chain: []
-date: 2017-09-28 00:00:00.000000000 Z
+date: 2017-10-23 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: activesupport
@@ -178,6 +178,7 @@
- NEWS
- README.md
- Rakefile
+- UPGRADE_FROM_FACTORY_GIRL.md
- cucumber.yml
- factory_girl.gemspec
- gemfiles/3.2.gemfile