You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suspenders includes itself in the generated application's Gemfile
Suspenders generators run in the context of the generated applications
Generated applications include Suspenders as a development dependency
Given the last item, if we're running Suspenders in development, we'd end up with two copies of it: the development copy and a gem copy. The problem is that:
The development copy will start up Suspenders
Generators, since they run in the context of an application, will be picked up from the gem
Therefore, running bin/suspenders in development may put us in a situation where the development copy has changes that the gem copy does not, which means our code changes would not fully apply.
To prevent such a mismatch, the existing solution is to run Suspenders with --path, which inserts a path option in the Gemfile:
gem"suspenders",path: "..."
To activate this behavior, running bin/suspenders with a --path option is necessary:
bin/suspenders myapp --path=$HOME/suspenders
That is not an intuitive solution and may trip up developers working on suspenders, which won't always remember to use --path. What if we could infer when to use a path option in the Gemfile by detecting if we're running in development? We can certainly do that.
The text was updated successfully, but these errors were encountered:
thiagoa
changed the title
Automate or document running bin/suspenders in development
Automate bin/suspenders in development environment without --path
Jul 22, 2022
Some facts:
Gemfile
Given the last item, if we're running Suspenders in development, we'd end up with two copies of it: the development copy and a gem copy. The problem is that:
Therefore, running
bin/suspenders
in development may put us in a situation where the development copy has changes that the gem copy does not, which means our code changes would not fully apply.To prevent such a mismatch, the existing solution is to run Suspenders with
--path
, which inserts apath
option in the Gemfile:To activate this behavior, running
bin/suspenders
with a--path
option is necessary:bin/suspenders myapp --path=$HOME/suspenders
That is not an intuitive solution and may trip up developers working on suspenders, which won't always remember to use
--path
. What if we could infer when to use apath
option in the Gemfile by detecting if we're running in development? We can certainly do that.The text was updated successfully, but these errors were encountered: