wp_posting_zon 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/wp_posting_zon.rb +17 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8d28449e883d3a5b1e709079a181818ed9531779de717131d80e433f8888562
4
- data.tar.gz: 65c1fb2875081395cc4f8cf6dc1acdb96d118b741af672e4d9c5ef3218abd1ea
3
+ metadata.gz: 90696d79e57c50464e4d6ef3278261617a1fbb15990365b5c9da07f8dbeed5cd
4
+ data.tar.gz: a6d5cc1cccac9fe3c5bdc8c064f7874d7b3c8e86c9733ce3828c10f81d1ffe87
5
5
  SHA512:
6
- metadata.gz: 6ec399fd22560ccdd795373ae7760d5df416ff6d456cdc87f43fca6ff9bbaa9f60fc3885ee9cb5fc54fa711c355e3986171ba655f475269fd01b7671ca7c2a65
7
- data.tar.gz: 7d5057e27b64d6e7bc1ac88a9e5cc58f44688bd3a1f7ee77f6ea1d565436eccc0209a3f31ca46de16e8554f5ab3ce1633520092982a9d7a27e289238407815ea
6
+ metadata.gz: ec7085474ca62d8cb9d73ebc5eb4f5827e2a5d1d5eb7537a7f7f03080036a0f74191aa88146379e9f1bae7d1b6a294dc170decd2fcc886a84f90156bcaaff160
7
+ data.tar.gz: cc08cb475aad2a23ed8a48e3c17e1ced3f155d953a6877cc05753c3d88415ab73f7621b7c0b5a54174fd41af813c7c68b38fee6c2fb44045f4718ed05b1afa86
@@ -2196,17 +2196,27 @@ class Wordpress
2196
2196
  }
2197
2197
  button('폴더째로불러오기'){
2198
2198
  stretchy false
2199
- on_clicked{
2199
+ on_clicked {
2200
2200
  path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')
2201
- Dir.entries(@data['이미지설정']['폴더경로'].text.to_s).each do |file|
2202
- if file == '.' or file == '..'
2203
2201
 
2204
- else
2205
- @data['이미지설정']['이미지'] << [false, file, path+"\\"+file.force_encoding('utf-8')]
2202
+ # 경로가 유효한지 확인
2203
+ if Dir.exist?(path)
2204
+ Dir.entries(path).each do |file|
2205
+ if file == '.' or file == '..'
2206
+ next
2207
+ else
2208
+ # 폴더 내의 파일을 이미지 리스트에 추가
2209
+ @data['이미지설정']['이미지'] << [false, file, path + "\\" + file.force_encoding('utf-8')]
2210
+ end
2206
2211
  end
2212
+
2213
+ # 마지막 빈 항목 추가 후 제거 (원래 로직에 맞춰)
2214
+ @data['이미지설정']['이미지'] << []
2215
+ @data['이미지설정']['이미지'].pop
2216
+ else
2217
+ # 경로가 존재하지 않으면 경고 메시지 출력
2218
+ puts "경로가 존재하지 않습니다: #{path}"
2207
2219
  end
2208
- @data['이미지설정']['이미지'] << []
2209
- @data['이미지설정']['이미지'].pop
2210
2220
  }
2211
2221
  }
2212
2222
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wp_posting_zon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-30 00:00:00.000000000 Z
11
+ date: 2025-01-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: File to Clipboard gem
14
14
  email: mymin26@naver.com