wp_posting_duo 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_duo.rb +17 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 196d20faaf24c699f6e7471bea38f86da11fb663a06af776e3d3e982842a4242
4
- data.tar.gz: c81d7137659a6e91ef9d8689cb195723a3a9acb1831903f31e5b31882ee31acf
3
+ metadata.gz: f1cb4f149042a682b91d238851c8c25987205163a407d85b9a8e926799c69cec
4
+ data.tar.gz: aae789d19521465e6a960341a72effe0c486ddd493b10e7a5f3aebf3761feaf9
5
5
  SHA512:
6
- metadata.gz: 2c758397e6b8cecdc794fdb73d4ae45c73760569a5b0ae08cd204ba1b31404a7c09711e89ac993ae3a92cdff594a988cb903a074c76db93f9be4b389635c4a77
7
- data.tar.gz: f4bf9c0349474a9ba7079b0571575f89ec1295ff3a7979e04d7957ed9346eccdc9038b9c8daf21047d5953af16fab37985a2ecc12fb24e34388df4dd5aac6855
6
+ metadata.gz: 5fe7df87ea12055fbd76acda4cb834ac1151b479cb72f1c044156a582a20f9bdd839944b12b93f463bd5a45396bc7e32cb0867e7213fa706e921fd6bdaf7005a
7
+ data.tar.gz: fb959af20e28c265f1fa2e408c98b369d0bcf37db83e50c24195d6bb63afb4cf5763dd5d56dda162a647974defede663a2b6719fe5092f3c0fc65b0256d9c5ab
@@ -2267,17 +2267,27 @@ class Wordpress
2267
2267
  }
2268
2268
  button('폴더째로불러오기'){
2269
2269
  stretchy false
2270
- on_clicked{
2270
+ on_clicked {
2271
2271
  path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')
2272
- Dir.entries(@data['이미지설정']['폴더경로'].text.to_s).each do |file|
2273
- if file == '.' or file == '..'
2274
2272
 
2275
- else
2276
- @data['이미지설정']['이미지'] << [false, file, path+"\\"+file.force_encoding('utf-8')]
2273
+ # 경로가 유효한지 확인
2274
+ if Dir.exist?(path)
2275
+ Dir.entries(path).each do |file|
2276
+ if file == '.' or file == '..'
2277
+ next
2278
+ else
2279
+ # 폴더 내의 파일을 이미지 리스트에 추가
2280
+ @data['이미지설정']['이미지'] << [false, file, path + "\\" + file.force_encoding('utf-8')]
2281
+ end
2277
2282
  end
2283
+
2284
+ # 마지막 빈 항목 추가 후 제거 (원래 로직에 맞춰)
2285
+ @data['이미지설정']['이미지'] << []
2286
+ @data['이미지설정']['이미지'].pop
2287
+ else
2288
+ # 경로가 존재하지 않으면 경고 메시지 출력
2289
+ puts "경로가 존재하지 않습니다: #{path}"
2278
2290
  end
2279
- @data['이미지설정']['이미지'] << []
2280
- @data['이미지설정']['이미지'].pop
2281
2291
  }
2282
2292
  }
2283
2293
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wp_posting_duo
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: 2024-01-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: File to Clipboard gem
14
14
  email: mymin26@naver.com