Skip to content

Commit

Permalink
Always set the --devcontainer flag when doing Rails new
Browse files Browse the repository at this point in the history
Since rails/rails@a61bfe4 dev container is an opt in feature. When using rails-new we always want to create a dev container, so let's set the --devcontainer flag for the user so they don't have to remember to do it.
  • Loading branch information
andrewn617 committed May 28, 2024
1 parent e510f74 commit 228d763
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/docker_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl DockerClient {
Self::set_workdir(&mut command);
Self::set_image_name(&mut command, ruby_version, rails_version);
Self::set_rails_new(&mut command, args);
Self::set_devcontainer_flag(&mut command);

command
}
Expand Down Expand Up @@ -80,6 +81,10 @@ impl DockerClient {
fn set_rails_new(command: &mut Command, args: Vec<String>) {
command.args(["rails", "new"]).args(args);
}

fn set_devcontainer_flag(command: &mut Command) {
command.args(["--devcontainer"]);
}
}

#[cfg(test)]
Expand Down Expand Up @@ -184,6 +189,7 @@ mod tests {
"rails",
"new",
"my_app",
"--devcontainer",
]
);
}
Expand Down

0 comments on commit 228d763

Please sign in to comment.