tayo 0.1.9 → 0.1.11

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: 656932f35e6ed0b14e993cd2960e974b14b46d8b291a246413ff66c4b1fcdad4
4
- data.tar.gz: 90c7be3808b81f77cddb142073ec96bb9c17109aaf86e45e24d7e419f5917186
3
+ metadata.gz: 2b925f8aa2d0555113bba7ca0f1ed1e2a4f7b923f4f8cd5f7ebc2ed0abb0a5df
4
+ data.tar.gz: 42fe13a69f4c8b9bca65b2d46f8bfe501e34f2c350658d75e277dc1fb2005268
5
5
  SHA512:
6
- metadata.gz: b9fce8e10ab4b42ea3a26839e4100463fa2a72b4c3f752edf48e8350c1899befc517814ab1ff923062ac54671a6015b0424f25e9c17d195b6bc548389348b207
7
- data.tar.gz: 9df5dae317418b2e3f474d5fd731cb29d83cd90ea89e10a3ef439dfc46762abb9f9b3ac4099ed36f4fcfe8ab4a8a68347a782142176c95319a2269f2839e02f8
6
+ metadata.gz: 13ce503cf8c8d0fd7c0ec6588cbf699d0713c01e6b1d9c26fa1b7c0339c4c1747b93b959e5e5071e9213ec28d6e2aa634032511f4ae921f5fbfeb2fd4ab5bac8
7
+ data.tar.gz: d131a5928299a44bf63b2a0e1c65ebcf12113643120fc5d2f5a2084643b7e05de9388e34575ffddc3ad1e1804268051ce4fdd8df5213609b5e0361a6f447b304
data/README.md CHANGED
@@ -23,7 +23,6 @@ tayo init
23
23
  이 명령어는 다음 작업들을 수행합니다:
24
24
 
25
25
  - **OrbStack 설치 확인**: Docker 컨테이너를 실행하기 위한 OrbStack이 설치되어 있는지 확인합니다
26
- - **Gemfile 수정**: development 그룹에 tayo gem을 추가합니다
27
26
  - **Bundle 설치**: 의존성을 설치합니다
28
27
  - **Linux 플랫폼 추가**: `x86_64-linux`와 `aarch64-linux` 플랫폼을 Gemfile.lock에 추가합니다
29
28
  - **Dockerfile 생성**: Rails 7 기본 Dockerfile이 없으면 생성합니다
@@ -13,15 +13,13 @@ module Tayo
13
13
  puts "❌ Rails 프로젝트가 아닙니다. Rails 프로젝트 루트에서 실행해주세요.".colorize(:red)
14
14
  return
15
15
  end
16
-
16
+ commit_initial_state
17
17
  check_orbstack
18
- add_to_gemfile
19
- bundle_install
20
- add_linux_platform
21
- create_welcome_page
22
- commit_changes
18
+ create_welcome_page
23
19
  clear_docker_cache
24
-
20
+ ensure_dockerfile_exists
21
+ disable_bootsnap_in_dockerfile
22
+ commit_changes
25
23
  puts "✅ Tayo가 성공적으로 설정되었습니다!".colorize(:green)
26
24
  end
27
25
 
@@ -67,74 +65,6 @@ module Tayo
67
65
  end
68
66
  end
69
67
  end
70
-
71
- def add_to_gemfile
72
- gemfile_content = File.read("Gemfile")
73
-
74
- if gemfile_content.include?("tayo")
75
- puts "ℹ️ Tayo가 이미 Gemfile에 있습니다.".colorize(:yellow)
76
- return
77
- end
78
-
79
- development_group = gemfile_content.match(/group :development do\n(.*?)\nend/m)
80
-
81
- if development_group
82
- updated_content = gemfile_content.sub(
83
- /group :development do\n/,
84
- "group :development do\n gem 'tayo'\n"
85
- )
86
- else
87
- updated_content = gemfile_content + "\n\ngroup :development do\n gem 'tayo'\nend\n"
88
- end
89
-
90
- File.write("Gemfile", updated_content)
91
- puts "✅ Gemfile에 Tayo를 추가했습니다.".colorize(:green)
92
- end
93
-
94
- def bundle_install
95
- puts "📦 bundle install을 실행합니다...".colorize(:yellow)
96
- system("bundle install")
97
- end
98
-
99
- def add_linux_platform
100
- puts "🐧 Linux 플랫폼을 확인하고 추가합니다...".colorize(:yellow)
101
-
102
- # Gemfile.lock 파일 확인
103
- unless File.exist?("Gemfile.lock")
104
- puts "⚠️ Gemfile.lock 파일이 없습니다. bundle install을 먼저 실행해주세요.".colorize(:yellow)
105
- return
106
- end
107
-
108
- gemfile_lock_content = File.read("Gemfile.lock")
109
- platforms_needed = []
110
-
111
- # 필요한 플랫폼 확인
112
- unless gemfile_lock_content.include?("x86_64-linux")
113
- platforms_needed << "x86_64-linux"
114
- end
115
-
116
- unless gemfile_lock_content.include?("aarch64-linux")
117
- platforms_needed << "aarch64-linux"
118
- end
119
-
120
- if platforms_needed.empty?
121
- puts "✅ 필요한 Linux 플랫폼이 이미 추가되어 있습니다.".colorize(:green)
122
- return
123
- end
124
-
125
- # 플랫폼 추가
126
- platforms_needed.each do |platform|
127
- puts "📦 #{platform} 플랫폼을 추가합니다...".colorize(:yellow)
128
- if system("bundle lock --add-platform #{platform}")
129
- puts "✅ #{platform} 플랫폼이 추가되었습니다.".colorize(:green)
130
- else
131
- puts "❌ #{platform} 플랫폼 추가에 실패했습니다.".colorize(:red)
132
- end
133
- end
134
-
135
- # Dockerfile 확인 및 생성
136
- ensure_dockerfile_exists
137
- end
138
68
 
139
69
  def ensure_dockerfile_exists
140
70
  unless File.exist?("Dockerfile")
@@ -151,10 +81,7 @@ module Tayo
151
81
  end
152
82
  else
153
83
  puts "✅ Dockerfile이 이미 존재합니다.".colorize(:green)
154
- end
155
-
156
- # Dockerfile에서 bootsnap 부분 비활성화 (빌드 문제 해결)
157
- disable_bootsnap_in_dockerfile
84
+ end
158
85
  end
159
86
 
160
87
  def disable_bootsnap_in_dockerfile
@@ -328,20 +255,44 @@ module Tayo
328
255
  @welcome_page_created = true
329
256
  end
330
257
 
331
- def commit_changes
258
+ def commit_initial_state
332
259
  # Git 저장소인지 확인
333
260
  unless Dir.exist?(".git")
334
261
  puts "⚠️ Git 저장소가 아닙니다. 커밋을 건너뜁니다.".colorize(:yellow)
335
262
  return
336
263
  end
337
264
 
338
- # Welcome 페이지가 새로 생성된 경우에만 커밋
339
- unless @welcome_page_created
340
- puts "ℹ️ 새로운 변경사항이 없어 커밋을 건너뜁니다.".colorize(:yellow)
265
+ puts "📝 초기 상태를 Git에 커밋합니다...".colorize(:yellow)
266
+
267
+ # Git 상태 확인
268
+ git_status = `git status --porcelain`
269
+
270
+ if git_status.strip.empty?
271
+ puts "ℹ️ 커밋할 변경사항이 없습니다.".colorize(:yellow)
272
+ return
273
+ end
274
+
275
+ # 변경사항 스테이징
276
+ system("git add .")
277
+
278
+ # 커밋
279
+ commit_message = "Save current state before Tayo initialization"
280
+ if system("git commit -m '#{commit_message}'")
281
+ puts "✅ 초기 상태가 커밋되었습니다.".colorize(:green)
282
+ puts " 커밋 메시지: #{commit_message}".colorize(:gray)
283
+ else
284
+ puts "⚠️ 커밋에 실패했습니다.".colorize(:yellow)
285
+ end
286
+ end
287
+
288
+ def commit_changes
289
+ # Git 저장소인지 확인
290
+ unless Dir.exist?(".git")
291
+ puts "⚠️ Git 저장소가 아닙니다. 커밋을 건너뜁니다.".colorize(:yellow)
341
292
  return
342
293
  end
343
294
 
344
- puts "📝 변경사항을 Git에 커밋합니다...".colorize(:yellow)
295
+ puts "📝 Tayo 설정 완료 상태를 Git에 커밋합니다...".colorize(:yellow)
345
296
 
346
297
  # Git 상태 확인
347
298
  git_status = `git status --porcelain`
@@ -355,9 +306,9 @@ module Tayo
355
306
  system("git add .")
356
307
 
357
308
  # 커밋
358
- commit_message = "Add Tayo configuration and Welcome page"
309
+ commit_message = "Complete Tayo initialization with Welcome page and Docker setup"
359
310
  if system("git commit -m '#{commit_message}'")
360
- puts "✅ 변경사항이 커밋되었습니다.".colorize(:green)
311
+ puts "✅ Tayo 설정이 완료되어 커밋되었습니다.".colorize(:green)
361
312
  puts " 커밋 메시지: #{commit_message}".colorize(:gray)
362
313
  else
363
314
  puts "⚠️ 커밋에 실패했습니다.".colorize(:yellow)
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.9"
4
+ VERSION = "0.1.11"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tayo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - 이원섭wonsup Lee/Alfonso