Skip to content

Remove the ffaker sample data dependency#2140

Closed
cbrunsdon wants to merge 1 commit intosolidusio:masterfrom
cbrunsdon:remove_ffaker_dependency
Closed

Remove the ffaker sample data dependency#2140
cbrunsdon wants to merge 1 commit intosolidusio:masterfrom
cbrunsdon:remove_ffaker_dependency

Conversation

@cbrunsdon
Copy link
Copy Markdown
Contributor

Continues the idea of #2082, this removes the dependency of ffaker but
also yanks it out of the sample requirement. I generated a small data
set with 15.times.map { FFaker::Name.first_name } etc.

It should be noted that there isn't any reasonable way to export development dependencies to people, and anyone trying to include our factories will get ffaker missing errors. I personally think thats pretty reasonable in exchange for removing ffaker as a useless runtime dependency in prod.

Comment thread sample/db/samples/addresses.rb Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument.

Comment thread sample/db/samples/addresses.rb Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument.

Comment thread sample/db/samples/addresses.rb Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove debugger entry point binding.pry.

Comment thread sample/db/samples/addresses.rb Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument.

Comment thread sample/db/samples/addresses.rb Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument.

Comment thread sample/db/samples/addresses.rb Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove debugger entry point binding.pry.

@cbrunsdon cbrunsdon force-pushed the remove_ffaker_dependency branch from 7c3117f to 8a02a5c Compare August 9, 2017 01:24
Comment thread sample/db/samples/addresses.rb Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument.

Comment thread sample/db/samples/addresses.rb Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument.

Continues the idea of solidusio#2082, this removes the dependency of ffaker but
also yanks it out of the sample requirement. I generated a small data
set with 15.times.map { FFaker::Name.first_name } etc.
@cbrunsdon cbrunsdon force-pushed the remove_ffaker_dependency branch from 8a02a5c to 433ef54 Compare August 9, 2017 01:27
Copy link
Copy Markdown
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👏

... thats pretty reasonable in exchange for removing ffaker as a useless runtime dependency in prod.

We only require ffaker in one place.

Why not add a guard around the require 'ffaker' line in core/lib/spree/testing_support/sequences.rb?

begin
  require 'ffaker'
rescue LoadError
  abort "Solidus factories require FFaker. Please add `ffaker` to your `Gemfile`"
end

gem 'with_model'
gem 'rspec_junit_formatter'
gem 'rails-controller-testing'
gem 'ffaker'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add require: false here? We don't need to require ffaker every time we boot the dummy apps.

zipcode: 16_804,
country: united_states,
phone: FFaker::PhoneNumber.phone_number)
first_names = ["Sterling", "Jennette", "Salome", "Lyla", "Lola", "Cheree", "Hettie", "Barbie", "Amelia", "Marceline", "Keeley", "Mi", "Karon", "Jessika", "Emmy"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I prefer the %w(Sterling Jennette) syntax for arrays of strings. Also having a new line for each word is far better readable, but this should not block this PR.

@tvdeyen
Copy link
Copy Markdown
Member

tvdeyen commented Aug 9, 2017

We probably want to add a changelog entry

@tvdeyen
Copy link
Copy Markdown
Member

tvdeyen commented Aug 17, 2017

Closed in favor of #2163

@tvdeyen tvdeyen closed this Aug 17, 2017
AlessioRocco added a commit to nebulab/solidus_page_objects that referenced this pull request Sep 22, 2017
See this PR solidusio/solidus#2140 for
reference. This change also works with previous versions of solidus.
AlessioRocco added a commit to nebulab/solidus_page_objects that referenced this pull request Sep 22, 2017
See this PR solidusio/solidus#2140 for
reference. This change also works with previous versions of solidus.
acreilly pushed a commit to acreilly/solidus_auth_devise that referenced this pull request Jan 4, 2019
ffaker was removed as a runtime dependency of Solidus.

polyglot (which is a dependency of deface) is raising a LoadError when
it tries to require ffaker, which is not defined.

PR removing ffaker from Solidus:
solidusio/solidus#2140
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants