Skip to content

Commit 5687eed

Browse files
committed
bump default ruby to 3.3.5, bump default rails to 7.2.1
1 parent 393b003 commit 5687eed

File tree

4 files changed

+28
-24
lines changed

4 files changed

+28
-24
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG RUBY_VERSION=3.3.4
1+
ARG RUBY_VERSION=3.3.5
22
FROM ruby:${RUBY_VERSION}
33

44
ARG NODE_VERSION=22

Dockerfile.unix

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG RUBY_VERSION=3.3.4
1+
ARG RUBY_VERSION=3.3.5
22
FROM ruby:${RUBY_VERSION}
33

44
ARG USER_ID=1000

src/docker_client.rs

+22-18
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ impl DockerClient {
6565

6666
fn set_workdir(command: &mut Command) {
6767
let path = std::env::current_dir().expect("Failed to get current directory");
68-
let absolute_path = path.canonicalize().expect("Failed to get current directory");
69-
let current_dir = absolute_path.to_str().expect("Failed to get current directory");
68+
let absolute_path = path
69+
.canonicalize()
70+
.expect("Failed to get current directory");
71+
let current_dir = absolute_path
72+
.to_str()
73+
.expect("Failed to get current directory");
7074

7175
command
7276
.arg("-v")
@@ -90,7 +94,7 @@ mod tests {
9094

9195
#[test]
9296
fn build_image() {
93-
let command = DockerClient::build_image("3.2.3", "7.1.3", None, None);
97+
let command = DockerClient::build_image("3.3.5", "7.2.1", None, None);
9498

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

@@ -101,19 +105,19 @@ mod tests {
101105
&[
102106
"build",
103107
"--build-arg",
104-
"RUBY_VERSION=3.2.3",
108+
"RUBY_VERSION=3.3.5",
105109
"--build-arg",
106-
"RAILS_VERSION=7.1.3",
110+
"RAILS_VERSION=7.2.1",
107111
"-t",
108-
"rails-new-3.2.3-7.1.3",
112+
"rails-new-3.3.5-7.2.1",
109113
"-",
110114
]
111115
);
112116
}
113117

114118
#[test]
115119
fn build_image_with_user_id() {
116-
let command = DockerClient::build_image("3.2.3", "7.1.3", Some(1000), None);
120+
let command = DockerClient::build_image("3.3.5", "7.2.1", Some(1000), None);
117121

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

@@ -124,21 +128,21 @@ mod tests {
124128
&[
125129
"build",
126130
"--build-arg",
127-
"RUBY_VERSION=3.2.3",
131+
"RUBY_VERSION=3.3.5",
128132
"--build-arg",
129-
"RAILS_VERSION=7.1.3",
133+
"RAILS_VERSION=7.2.1",
130134
"--build-arg",
131135
"USER_ID=1000",
132136
"-t",
133-
"rails-new-3.2.3-7.1.3",
137+
"rails-new-3.3.5-7.2.1",
134138
"-",
135139
]
136140
);
137141
}
138142

139143
#[test]
140144
fn build_image_with_group_id() {
141-
let command = DockerClient::build_image("3.2.3", "7.1.3", None, Some(1000));
145+
let command = DockerClient::build_image("3.3.5", "7.2.1", None, Some(1000));
142146

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

@@ -149,21 +153,21 @@ mod tests {
149153
&[
150154
"build",
151155
"--build-arg",
152-
"RUBY_VERSION=3.2.3",
156+
"RUBY_VERSION=3.3.5",
153157
"--build-arg",
154-
"RAILS_VERSION=7.1.3",
158+
"RAILS_VERSION=7.2.1",
155159
"--build-arg",
156160
"GROUP_ID=1000",
157161
"-t",
158-
"rails-new-3.2.3-7.1.3",
162+
"rails-new-3.3.5-7.2.1",
159163
"-",
160164
]
161165
);
162166
}
163167

164168
#[test]
165169
fn run_image() {
166-
let command = DockerClient::run_image("3.2.3", "7.1.3", vec!["my_app".to_string()]);
170+
let command = DockerClient::run_image("3.3.5", "7.2.1", vec!["my_app".to_string()]);
167171

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

@@ -182,7 +186,7 @@ mod tests {
182186
&format!("{}:{}", current_dir, current_dir),
183187
"-w",
184188
current_dir,
185-
"rails-new-3.2.3-7.1.3",
189+
"rails-new-3.3.5-7.2.1",
186190
"rails",
187191
"new",
188192
"my_app",
@@ -192,7 +196,7 @@ mod tests {
192196

193197
#[test]
194198
fn get_help() {
195-
let command = DockerClient::get_help("3.2.3", "7.1.3");
199+
let command = DockerClient::get_help("3.3.5", "7.2.1");
196200

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

@@ -203,7 +207,7 @@ mod tests {
203207
&[
204208
"run",
205209
"--rm",
206-
"rails-new-3.2.3-7.1.3",
210+
"rails-new-3.3.5-7.2.1",
207211
"rails",
208212
"new",
209213
"--help",

src/rails_new.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ pub struct Cli {
66
#[clap(trailing_var_arg = true, required = true)]
77
/// arguments passed to `rails new`
88
pub args: Vec<String>,
9-
#[clap(long, short = 'u', default_value = "3.3.4")]
9+
#[clap(long, short = 'u', default_value = "3.3.5")]
1010
pub ruby_version: String,
11-
#[clap(long, short = 'r', default_value = "7.2.0")]
11+
#[clap(long, short = 'r', default_value = "7.2.1")]
1212
pub rails_version: String,
1313

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

57-
assert_eq!(ruby_version, "3.3.4");
58-
assert_eq!(rails_version, "7.2.0");
57+
assert_eq!(ruby_version, "3.3.5");
58+
assert_eq!(rails_version, "7.2.1");
5959

6060
Ok(())
6161
}

0 commit comments

Comments
 (0)