Skip to content

Commit

Permalink
bump default ruby to 3.3.5, bump default rails to 7.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
onshi committed Sep 4, 2024
1 parent 393b003 commit 87b86de
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.4
ARG RUBY_VERSION=3.3.5
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.4
ARG RUBY_VERSION=3.3.5
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.2.3", "7.1.3", None, None);
let command = DockerClient::build_image("3.3.5", "7.2.1", None, None);

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

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

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

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

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

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

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

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

#[test]
fn run_image() {
let command = DockerClient::run_image("3.2.3", "7.1.3", vec!["my_app".to_string()]);
let command = DockerClient::run_image("3.3.5", "7.2.1", 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.2.3-7.1.3",
"rails-new-3.3.5-7.2.1",
"rails",
"new",
"my_app",
Expand All @@ -192,7 +192,7 @@ mod tests {

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

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

Expand All @@ -203,7 +203,7 @@ mod tests {
&[
"run",
"--rm",
"rails-new-3.2.3-7.1.3",
"rails-new-3.3.5-7.2.1",
"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.4")]
#[clap(long, short = 'u', default_value = "3.3.5")]
pub ruby_version: String,
#[clap(long, short = 'r', default_value = "7.2.0")]
#[clap(long, short = 'r', default_value = "7.2.1")]
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.4");
assert_eq!(rails_version, "7.2.0");
assert_eq!(ruby_version, "3.3.5");
assert_eq!(rails_version, "7.2.1");

Ok(())
}
Expand Down

0 comments on commit 87b86de

Please sign in to comment.