tayo 0.1.5 โ 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +9 -1
- data/lib/tayo/commands/init.rb +20 -38
- data/lib/tayo/version.rb +1 -1
- data/repomix-output.xml +1690 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a054d416016543c46db065ca032c1df9d3947d25c44f383bd692ed991d5c6ea7
|
4
|
+
data.tar.gz: da2546a278137b99f89997b458badefa2e0784c0816e789fd44a53d9ecc478e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05fbdbfa31cdce3a23e02ddd91df1831de68079a6c947f50d4f74275e2d82ec96cc17281212a58ba3f41c2680b70be8c8f89dd74d74fcb22ff4404dc7870529c
|
7
|
+
data.tar.gz: '09b24998209da3e3c80bedd793289c52d6975b00a8e6878a8fedca010fd3f6c977ec6d90a4e4d66d8026ff5156ffabaa939f048e3bc4c9366f6801178b18fbac'
|
data/Rakefile
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "bundler/gem_tasks"
|
4
|
-
|
4
|
+
require "rake/testtask"
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << "test"
|
8
|
+
t.libs << "lib"
|
9
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
10
|
+
end
|
11
|
+
|
12
|
+
task default: :test
|
data/lib/tayo/commands/init.rb
CHANGED
@@ -136,8 +136,6 @@ module Tayo
|
|
136
136
|
end
|
137
137
|
|
138
138
|
def ensure_dockerfile_exists
|
139
|
-
dockerfile_created = false
|
140
|
-
|
141
139
|
unless File.exist?("Dockerfile")
|
142
140
|
puts "๐ณ Dockerfile์ด ์์ต๋๋ค. ๊ธฐ๋ณธ Dockerfile์ ์์ฑํฉ๋๋ค...".colorize(:yellow)
|
143
141
|
|
@@ -145,7 +143,6 @@ module Tayo
|
|
145
143
|
if system("rails app:update:bin")
|
146
144
|
system("./bin/rails generate dockerfile")
|
147
145
|
puts "โ
Dockerfile์ด ์์ฑ๋์์ต๋๋ค.".colorize(:green)
|
148
|
-
dockerfile_created = true
|
149
146
|
else
|
150
147
|
puts "โ ๏ธ Dockerfile ์์ฑ์ ์คํจํ์ต๋๋ค. ์๋์ผ๋ก ์์ฑํด์ฃผ์ธ์.".colorize(:yellow)
|
151
148
|
puts " ๋ค์ ๋ช
๋ น์ด๋ฅผ ์คํํ์ธ์: ./bin/rails generate dockerfile".colorize(:cyan)
|
@@ -160,43 +157,28 @@ module Tayo
|
|
160
157
|
end
|
161
158
|
|
162
159
|
def fix_dockerfile_bootsnap_issue
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
original_content =
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
skip_next = true # ๋ค์ ๋ผ์ธ๋ ์ ๊ฑฐํ ์ค๋น
|
177
|
-
next # ์ด ๋ผ์ธ์ ์ ๊ฑฐ
|
178
|
-
end
|
179
|
-
|
180
|
-
# bootsnap precompile RUN ๋ช
๋ น ์ฐพ๊ธฐ
|
181
|
-
if line.match?(/^\s*RUN.*bootsnap\s+precompile/i)
|
182
|
-
skip_next = false # ๋ฆฌ์
|
183
|
-
next # ์ด ๋ผ์ธ์ ์ ๊ฑฐ
|
184
|
-
end
|
185
|
-
|
186
|
-
# skip_next๊ฐ true์ด๊ณ ํ์ฌ ๋ผ์ธ์ด RUN bootsnap์ด๋ฉด ์ ๊ฑฐ
|
187
|
-
if skip_next && line.match?(/^\s*RUN.*bootsnap/i)
|
188
|
-
skip_next = false
|
189
|
-
next
|
190
|
-
end
|
191
|
-
|
192
|
-
skip_next = false
|
193
|
-
filtered_lines << line
|
160
|
+
dockerfile_path = "Dockerfile"
|
161
|
+
return unless File.exist?(dockerfile_path)
|
162
|
+
|
163
|
+
original_content = File.read(dockerfile_path)
|
164
|
+
lines = original_content.split("\n")
|
165
|
+
|
166
|
+
# ์ญ์ ํ ํจํด๋ค์ ์ ์ํฉ๋๋ค.
|
167
|
+
comment_pattern = /^\s*# Precompile bootsnap code for faster boot times/i
|
168
|
+
run_command_pattern = /^\s*RUN bundle exec bootsnap precompile app\/ lib\//i
|
169
|
+
|
170
|
+
# `reject`๋ฅผ ์ฌ์ฉํด ํจํด๊ณผ ์ผ์นํ๋ ์ค๋ค์ ํ๋ฒ์ ์ ๊ฑฐํฉ๋๋ค.
|
171
|
+
filtered_lines = lines.reject do |line|
|
172
|
+
line.match?(comment_pattern) || line.match?(run_command_pattern)
|
194
173
|
end
|
195
|
-
|
196
|
-
new_content = filtered_lines.join("\n")
|
197
|
-
|
174
|
+
|
175
|
+
new_content = filtered_lines.join("\n")
|
176
|
+
# ์๋ณธ ํ์ผ์ด ๊ฐํ์ผ๋ก ๋๋ฌ๋ค๋ฉด ์ ํ์ผ๋ ๊ฐํ์ผ๋ก ๋๋๋๋ก
|
177
|
+
new_content += "\n" if original_content.end_with?("\n") && !new_content.end_with?("\n")
|
178
|
+
|
179
|
+
# ๋ณ๊ฒฝ๋ ๋ด์ฉ์ด ์์ ๊ฒฝ์ฐ์๋ง ํ์ผ์ ๋ค์ ์๋๋ค.
|
198
180
|
if new_content != original_content
|
199
|
-
File.write(
|
181
|
+
File.write(dockerfile_path, new_content)
|
200
182
|
puts "โ
Dockerfile์์ bootsnap precompile ๋ถ๋ถ์ ์ ๊ฑฐํ์ต๋๋ค. (๋น๋ ๋ฌธ์ ํด๊ฒฐ)".colorize(:green)
|
201
183
|
puts " - ์ด๋ ์๋ ค์ง ๋น๋ ๋ฌธ์ ๋ฅผ ๋ฐฉ์งํ๊ธฐ ์ํจ์
๋๋ค.".colorize(:gray)
|
202
184
|
end
|
data/lib/tayo/version.rb
CHANGED