posting_zon 0.0.17 → 0.0.20
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/lib/posting_zon.rb +42 -17
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 803c059efe6512bfdbdef05938844737d3dca5b9c62ffb8fa0125cdeef9fb634
|
4
|
+
data.tar.gz: e9cee93045e8b3a55c3a1118ce7ecef9c27c3de6b33f45600498d1fd0e3995cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f1991df25a5b8feefde4a13ad844c5a112fb2e8459b62ffa7f51c99694f30fa6285355ba92708a70cc2efed58ab499f12a6eb00487983e077654cee4051cee0
|
7
|
+
data.tar.gz: 72530855f775bdc9d7c21595b88764c007789e5c353f5f33eb69355aeecce891974b42d4ba5c3d034cee7818e8570982a257e0d25eb102bcca18e40b385141a1
|
data/lib/posting_zon.rb
CHANGED
@@ -10382,18 +10382,33 @@ class Wordpress
|
|
10382
10382
|
}
|
10383
10383
|
button(' 폴더째로 불러오기 '){
|
10384
10384
|
stretchy false
|
10385
|
-
on_clicked{
|
10386
|
-
path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')
|
10387
|
-
Dir.entries(@data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')).each do |file|
|
10388
|
-
if file == '.' or file == '..'
|
10385
|
+
on_clicked {
|
10386
|
+
path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')
|
10389
10387
|
|
10390
|
-
|
10391
|
-
|
10392
|
-
|
10388
|
+
# 경로가 유효한지 확인
|
10389
|
+
if Dir.exist?(path)
|
10390
|
+
Dir.entries(path).each do |file|
|
10391
|
+
if file == '.' or file == '..'
|
10392
|
+
next
|
10393
|
+
else
|
10394
|
+
begin
|
10395
|
+
# 파일을 열고 내용을 읽어서 추가
|
10396
|
+
file_data = File.open(path + '/' + file, 'r', encoding: 'utf-8').read
|
10397
|
+
@data['내용설정']['내용'] << [false, file, file_data]
|
10398
|
+
rescue => e
|
10399
|
+
# 파일을 열 수 없는 경우, 오류 메시지 출력
|
10400
|
+
puts "파일을 열 수 없습니다: #{file}, 오류: #{e.message}"
|
10401
|
+
end
|
10402
|
+
end
|
10393
10403
|
end
|
10404
|
+
|
10405
|
+
# 내용 배열에서 마지막 빈 항목 제거
|
10406
|
+
@data['내용설정']['내용'] << []
|
10407
|
+
@data['내용설정']['내용'].pop
|
10408
|
+
else
|
10409
|
+
# 경로가 유효하지 않을 경우, 오류 메시지 출력
|
10410
|
+
puts "경로가 존재하지 않습니다: #{path}"
|
10394
10411
|
end
|
10395
|
-
@data['내용설정']['내용'] << []
|
10396
|
-
@data['내용설정']['내용'].pop
|
10397
10412
|
}
|
10398
10413
|
}
|
10399
10414
|
}
|
@@ -10480,17 +10495,27 @@ class Wordpress
|
|
10480
10495
|
}
|
10481
10496
|
button('폴더째로불러오기'){
|
10482
10497
|
stretchy false
|
10483
|
-
on_clicked{
|
10484
|
-
path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')
|
10485
|
-
Dir.entries(@data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')).each do |file|
|
10486
|
-
if file == '.' or file == '..'
|
10498
|
+
on_clicked {
|
10499
|
+
path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')
|
10487
10500
|
|
10488
|
-
|
10489
|
-
|
10501
|
+
# 경로가 유효한지 확인
|
10502
|
+
if Dir.exist?(path)
|
10503
|
+
Dir.entries(path).each do |file|
|
10504
|
+
if file == '.' or file == '..'
|
10505
|
+
next
|
10506
|
+
else
|
10507
|
+
# 폴더 내의 파일을 이미지 리스트에 추가
|
10508
|
+
@data['이미지설정']['이미지'] << [false, file, path + "\\" + file.force_encoding('utf-8')]
|
10509
|
+
end
|
10490
10510
|
end
|
10511
|
+
|
10512
|
+
# 마지막 빈 항목 추가 후 제거 (원래 로직에 맞춰)
|
10513
|
+
@data['이미지설정']['이미지'] << []
|
10514
|
+
@data['이미지설정']['이미지'].pop
|
10515
|
+
else
|
10516
|
+
# 경로가 존재하지 않으면 경고 메시지 출력
|
10517
|
+
puts "경로가 존재하지 않습니다: #{path}"
|
10491
10518
|
end
|
10492
|
-
@data['이미지설정']['이미지'] << []
|
10493
|
-
@data['이미지설정']['이미지'].pop
|
10494
10519
|
}
|
10495
10520
|
}
|
10496
10521
|
}
|