Skip to content

Commit

Permalink
bump default ruby to 3.3.6, bump default rails to 8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
onshi committed Nov 11, 2024
1 parent 87b86de commit 6f18041
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG RUBY_VERSION=3.3.5
ARG RUBY_VERSION=3.3.6
FROM ruby:${RUBY_VERSION}

ARG NODE_VERSION=22
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.unix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG RUBY_VERSION=3.3.5
ARG RUBY_VERSION=3.3.6
FROM ruby:${RUBY_VERSION}

ARG USER_ID=1000
Expand Down
32 changes: 16 additions & 16 deletions src/docker_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ mod tests {

#[test]
fn build_image() {
let command = DockerClient::build_image("3.3.5", "7.2.1", None, None);
let command = DockerClient::build_image("3.3.6", "8.0.0", None, None);

assert_eq!(command.get_program(), "docker");

Expand All @@ -101,19 +101,19 @@ mod tests {
&[
"build",
"--build-arg",
"RUBY_VERSION=3.3.5",
"RUBY_VERSION=3.3.6",
"--build-arg",
"RAILS_VERSION=7.2.1",
"RAILS_VERSION=8.0.0",
"-t",
"rails-new-3.3.5-7.2.1",
"rails-new-3.3.6-8.0.0",
"-",
]
);
}

#[test]
fn build_image_with_user_id() {
let command = DockerClient::build_image("3.3.5", "7.2.1", Some(1000), None);
let command = DockerClient::build_image("3.3.6", "8.0.0", Some(1000), None);

assert_eq!(command.get_program(), "docker");

Expand All @@ -124,21 +124,21 @@ mod tests {
&[
"build",
"--build-arg",
"RUBY_VERSION=3.3.5",
"RUBY_VERSION=3.3.6",
"--build-arg",
"RAILS_VERSION=7.2.1",
"RAILS_VERSION=8.0.0",
"--build-arg",
"USER_ID=1000",
"-t",
"rails-new-3.3.5-7.2.1",
"rails-new-3.3.6-8.0.0",
"-",
]
);
}

#[test]
fn build_image_with_group_id() {
let command = DockerClient::build_image("3.3.5", "7.2.1", None, Some(1000));
let command = DockerClient::build_image("3.3.6", "8.0.0", None, Some(1000));

assert_eq!(command.get_program(), "docker");

Expand All @@ -149,21 +149,21 @@ mod tests {
&[
"build",
"--build-arg",
"RUBY_VERSION=3.3.5",
"RUBY_VERSION=3.3.6",
"--build-arg",
"RAILS_VERSION=7.2.1",
"RAILS_VERSION=8.0.0",
"--build-arg",
"GROUP_ID=1000",
"-t",
"rails-new-3.3.5-7.2.1",
"rails-new-3.3.6-8.0.0",
"-",
]
);
}

#[test]
fn run_image() {
let command = DockerClient::run_image("3.3.5", "7.2.1", vec!["my_app".to_string()]);
let command = DockerClient::run_image("3.3.6", "8.0.0", vec!["my_app".to_string()]);

assert_eq!(command.get_program(), "docker");

Expand All @@ -182,7 +182,7 @@ mod tests {
&format!("{}:{}", current_dir, current_dir),
"-w",
current_dir,
"rails-new-3.3.5-7.2.1",
"rails-new-3.3.6-8.0.0",
"rails",
"new",
"my_app",
Expand All @@ -192,7 +192,7 @@ mod tests {

#[test]
fn get_help() {
let command = DockerClient::get_help("3.3.5", "7.2.1");
let command = DockerClient::get_help("3.3.6", "8.0.0");

assert_eq!(command.get_program(), "docker");

Expand All @@ -203,7 +203,7 @@ mod tests {
&[
"run",
"--rm",
"rails-new-3.3.5-7.2.1",
"rails-new-3.3.6-8.0.0",
"rails",
"new",
"--help",
Expand Down
8 changes: 4 additions & 4 deletions src/rails_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ pub struct Cli {
#[clap(trailing_var_arg = true, required = true)]
/// arguments passed to `rails new`
pub args: Vec<String>,
#[clap(long, short = 'u', default_value = "3.3.5")]
#[clap(long, short = 'u', default_value = "3.3.6")]
pub ruby_version: String,
#[clap(long, short = 'r', default_value = "7.2.1")]
#[clap(long, short = 'r', default_value = "8.0.0")]
pub rails_version: String,

#[command(subcommand)]
Expand Down Expand Up @@ -54,8 +54,8 @@ mod tests {
let ruby_version = m.get_one::<String>("ruby_version").unwrap();
let rails_version = m.get_one::<String>("rails_version").unwrap();

assert_eq!(ruby_version, "3.3.5");
assert_eq!(rails_version, "7.2.1");
assert_eq!(ruby_version, "3.3.6");
assert_eq!(rails_version, "8.0.0");

Ok(())
}
Expand Down

0 comments on commit 6f18041

Please sign in to comment.