posting_duo 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_duo.rb +43 -18
- 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: e469ebd49b2afedc9471484dc2952dbc1fac647c7039b535a2747e581640b584
|
4
|
+
data.tar.gz: 5e7d4890c4ca08b7665f486cdf1bdcf9d79a521d6f1f96de8b4c2332ed4a8cf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e1f8d270d1d2d6554d217f1b6b4171bdb08418514b0a98df4008a3967670b36c2a0750d61849013411183ba78fa36ec0c43f66e4a6f9b1a165cbdd988651408
|
7
|
+
data.tar.gz: 51107cf0930ef09d2807d415b23151551512bbcc0eb9bc7314ebe5caa68133da36ad50842c2bc71f74766dc003de1adf0d9ca519a44d6a14b74b668296c3be06
|
data/lib/posting_duo.rb
CHANGED
@@ -10459,18 +10459,33 @@ class Wordpress
|
|
10459
10459
|
}
|
10460
10460
|
button(' 폴더째로 불러오기 '){
|
10461
10461
|
stretchy false
|
10462
|
-
|
10463
|
-
path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')
|
10464
|
-
|
10465
|
-
|
10466
|
-
|
10467
|
-
|
10468
|
-
|
10469
|
-
|
10462
|
+
on_clicked {
|
10463
|
+
path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')
|
10464
|
+
|
10465
|
+
# 경로가 유효한지 확인
|
10466
|
+
if Dir.exist?(path)
|
10467
|
+
Dir.entries(path).each do |file|
|
10468
|
+
if file == '.' or file == '..'
|
10469
|
+
next
|
10470
|
+
else
|
10471
|
+
begin
|
10472
|
+
# 파일을 열고 내용을 읽어서 추가
|
10473
|
+
file_data = File.open(path + '/' + file, 'r', encoding: 'utf-8').read
|
10474
|
+
@data['내용설정']['내용'] << [false, file, file_data]
|
10475
|
+
rescue => e
|
10476
|
+
# 파일을 열 수 없는 경우, 오류 메시지 출력
|
10477
|
+
puts "파일을 열 수 없습니다: #{file}, 오류: #{e.message}"
|
10478
|
+
end
|
10479
|
+
end
|
10470
10480
|
end
|
10481
|
+
|
10482
|
+
# 내용 배열에서 마지막 빈 항목 제거
|
10483
|
+
@data['내용설정']['내용'] << []
|
10484
|
+
@data['내용설정']['내용'].pop
|
10485
|
+
else
|
10486
|
+
# 경로가 유효하지 않을 경우, 오류 메시지 출력
|
10487
|
+
puts "경로가 존재하지 않습니다: #{path}"
|
10471
10488
|
end
|
10472
|
-
@data['내용설정']['내용'] << []
|
10473
|
-
@data['내용설정']['내용'].pop
|
10474
10489
|
}
|
10475
10490
|
}
|
10476
10491
|
}
|
@@ -10557,17 +10572,27 @@ class Wordpress
|
|
10557
10572
|
}
|
10558
10573
|
button('폴더째로불러오기'){
|
10559
10574
|
stretchy false
|
10560
|
-
on_clicked{
|
10561
|
-
path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')
|
10562
|
-
Dir.entries(@data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')).each do |file|
|
10563
|
-
if file == '.' or file == '..'
|
10575
|
+
on_clicked {
|
10576
|
+
path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')
|
10564
10577
|
|
10565
|
-
|
10566
|
-
|
10578
|
+
# 경로가 유효한지 확인
|
10579
|
+
if Dir.exist?(path)
|
10580
|
+
Dir.entries(path).each do |file|
|
10581
|
+
if file == '.' or file == '..'
|
10582
|
+
next
|
10583
|
+
else
|
10584
|
+
# 폴더 내의 파일을 이미지 리스트에 추가
|
10585
|
+
@data['이미지설정']['이미지'] << [false, file, path + "\\" + file.force_encoding('utf-8')]
|
10586
|
+
end
|
10567
10587
|
end
|
10588
|
+
|
10589
|
+
# 마지막 빈 항목 추가 후 제거 (원래 로직에 맞춰)
|
10590
|
+
@data['이미지설정']['이미지'] << []
|
10591
|
+
@data['이미지설정']['이미지'].pop
|
10592
|
+
else
|
10593
|
+
# 경로가 존재하지 않으면 경고 메시지 출력
|
10594
|
+
puts "경로가 존재하지 않습니다: #{path}"
|
10568
10595
|
end
|
10569
|
-
@data['이미지설정']['이미지'] << []
|
10570
|
-
@data['이미지설정']['이미지'].pop
|
10571
10596
|
}
|
10572
10597
|
}
|
10573
10598
|
}
|