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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '098a40d3039dca1ba3223e0685268fcb0e6af7258fa6fd80c51e3904b45ef14b'
4
- data.tar.gz: 6696721c2aeb3bf6a149dad936f1ede485e875a17720542bdea1b7a2528c6fae
3
+ metadata.gz: a054d416016543c46db065ca032c1df9d3947d25c44f383bd692ed991d5c6ea7
4
+ data.tar.gz: da2546a278137b99f89997b458badefa2e0784c0816e789fd44a53d9ecc478e5
5
5
  SHA512:
6
- metadata.gz: 3b8c06d6c551fb4a31ffb9da180fb7657db9aebc68f5f879ffb950ec57ee2f086a824c89a0124158ddd354dd5f21efb353efaf55ec784042632a463276a13bbd
7
- data.tar.gz: 974638244f55935524944f2f6ce14455f9c12c77671825094034999ef87e1aaff563b426d8e3f02f389355a242bb1c2d4e3e36af8e5cba3cd73a6b464b869c36
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
- task default: %i[]
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
@@ -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
- return unless File.exist?("Dockerfile")
164
-
165
- dockerfile_content = File.read("Dockerfile")
166
- original_content = dockerfile_content.dup
167
-
168
- # Dockerfile์„ ๋ผ์ธ๋ณ„๋กœ ์ฒ˜๋ฆฌ
169
- lines = dockerfile_content.split("\n")
170
- filtered_lines = []
171
- skip_next = false
172
-
173
- lines.each_with_index do |line, index|
174
- # bootsnap ๊ด€๋ จ ์ฃผ์„ ์ฐพ๊ธฐ
175
- if line.match?(/^\s*#.*bootsnap.*faster boot times/i)
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") + "\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("Dockerfile", new_content)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tayo
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.7"
5
5
  end