tayo 0.1.4 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 166ca254315cc9367c02dd958314e11de98d337cae0bf70937269b992e803723
4
- data.tar.gz: 875bc6262635b986a1e3568bae0995a368fbb09c5eea379b261256d115b70f03
3
+ metadata.gz: 1b9c646b5ccd013b01cf686073be821ecbfec142863d6f2b3e01cf38ca46ef46
4
+ data.tar.gz: 535e89571f276369392c22a36758cd119b9d8c9a20900af488acf1f2a5ddb91a
5
5
  SHA512:
6
- metadata.gz: 757abefd9e9bfcdf97fe03f3b5138dcba358b0fd390d8947150dcb6f7b5c5e514258d11995caabada8eaee169020a127d9a070d7fbb4e9f7d5aebd3594bc61e3
7
- data.tar.gz: 776ecb2e875fc598beb66387a70d847aa69ea68d0e35d4df3cc29d69c10b2d0949d693eb500ce2c9823d402e7c29763d93a294b90e6aac7bfcd64532af109c74
6
+ metadata.gz: e40986acccc2fcd4c429bd5ff99e007b6136de237c493f89620ef49d5a8e48e1123c80e5da134825d42ffa9805c334dbb9b4645c555a88f9d9075d814d8916b8
7
+ data.tar.gz: 523adadbf90dacc6bea8d30d1e1c9aac2f11d61dd7fb45ae7ff7f3cc3df6b2e5b74e9ba28f53e6216f7a5cd1b6391c40c00658ae7529b0eeeea67c0ed7cad61a
@@ -160,22 +160,26 @@ module Tayo
160
160
  end
161
161
 
162
162
  def fix_dockerfile_bootsnap_issue
163
- return unless File.exist?("Dockerfile")
164
-
165
- dockerfile_content = File.read("Dockerfile")
166
- original_content = dockerfile_content.dup
167
-
168
- # bootsnap precompile 관련 라인들을 찾아서 제거
169
- # 주석과 RUN 명령을 함께 제거
170
- if dockerfile_content.include?("bootsnap precompile")
171
- # 주석 라인 제거
172
- dockerfile_content.gsub!(/^#.*bootsnap.*faster boot times.*\n/i, "")
173
- # RUN 명령 제거
174
- dockerfile_content.gsub!(/^RUN bundle exec bootsnap precompile.*\n/i, "")
163
+ dockerfile_path = "Dockerfile"
164
+ return unless File.exist?(dockerfile_path)
165
+
166
+ original_content = File.read(dockerfile_path)
167
+ lines = original_content.split("\n")
168
+
169
+ # 삭제할 패턴들을 정의합니다.
170
+ comment_pattern = /^\s*# Precompile bootsnap code for faster boot times/i
171
+ run_command_pattern = /^\s*RUN bundle exec bootsnap precompile app\/ lib\//i
172
+
173
+ # `reject`를 사용해 패턴과 일치하는 줄들을 한번에 제거합니다.
174
+ filtered_lines = lines.reject do |line|
175
+ line.match?(comment_pattern) || line.match?(run_command_pattern)
175
176
  end
176
-
177
- if dockerfile_content != original_content
178
- File.write("Dockerfile", dockerfile_content)
177
+
178
+ new_content = filtered_lines.join("\n")
179
+
180
+ # 변경된 내용이 있을 경우에만 파일을 다시 씁니다.
181
+ if new_content != original_content
182
+ File.write(dockerfile_path, new_content)
179
183
  puts "✅ Dockerfile에서 bootsnap precompile 부분을 제거했습니다. (빌드 문제 해결)".colorize(:green)
180
184
  puts " - 이는 알려진 빌드 문제를 방지하기 위함입니다.".colorize(:gray)
181
185
  end
data/lib/tayo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tayo
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.6"
5
5
  end