wp_posting_duo 0.0.1 → 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 +27 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f773b74eebc88bfb08110bc86dfdca44fd4691275333724bd9c8a18b23f0dbda
4
- data.tar.gz: e6880f6a1019bbb295da1f53783151f4b74a848befc3876932c062c8bfd485f2
3
+ metadata.gz: f1cb4f149042a682b91d238851c8c25987205163a407d85b9a8e926799c69cec
4
+ data.tar.gz: aae789d19521465e6a960341a72effe0c486ddd493b10e7a5f3aebf3761feaf9
5
5
  SHA512:
6
- metadata.gz: a8140786af1458ae6b6d8437833fbfa200f2d05f8e8c8e34e63db8adcd5ec48971a299689b22c975e8f82e4de644390462fd7e9bb5db5805121ac54e4f780a94
7
- data.tar.gz: 8ef114249fc92bb730440d6b65469e890061d8a056e465b74da12f95410ad6d20896fe3b7d0573ad74a3b74ae90b1e80792379087d2f87a8e49784a8a1a8739d
6
+ metadata.gz: 5fe7df87ea12055fbd76acda4cb834ac1151b479cb72f1c044156a582a20f9bdd839944b12b93f463bd5a45396bc7e32cb0867e7213fa706e921fd6bdaf7005a
7
+ data.tar.gz: fb959af20e28c265f1fa2e408c98b369d0bcf37db83e50c24195d6bb63afb4cf5763dd5d56dda162a647974defede663a2b6719fe5092f3c0fc65b0256d9c5ab
@@ -956,6 +956,11 @@ class Wordpress
956
956
  if @data['포스트설정']['내용과자동생성'].checked? == false and @data['포스트설정']['내용을자동생성'].checked? == false and @data['포스트설정']['막글삽입'].checked? == true
957
957
  snumber = @data['포스트설정']['막글삽입시작숫자'].text.to_s.to_i
958
958
  enumber = @data['포스트설정']['막글삽입끝숫자'].text.to_s.to_i
959
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
960
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
961
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
962
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
963
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
959
964
  last_text = @data['포스트설정']['막글'][0..rand(snumber..enumber)].split(' ').shuffle.join(' ')
960
965
  content22 = last_text.split(' ')
961
966
  else
@@ -1361,6 +1366,11 @@ class Wordpress
1361
1366
  else
1362
1367
  snumber = @data['포스트설정']['막글삽입시작숫자'].text.to_s.to_i
1363
1368
  enumber = @data['포스트설정']['막글삽입끝숫자'].text.to_s.to_i
1369
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
1370
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
1371
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
1372
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
1373
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
1364
1374
  last_text = @data['포스트설정']['막글'][0..rand(snumber..enumber)].split(' ').shuffle.join(' ')
1365
1375
 
1366
1376
  if @data['포스트설정']['막글삽입2'].checked?
@@ -2257,17 +2267,27 @@ class Wordpress
2257
2267
  }
2258
2268
  button('폴더째로불러오기'){
2259
2269
  stretchy false
2260
- on_clicked{
2270
+ on_clicked {
2261
2271
  path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')
2262
- Dir.entries(@data['이미지설정']['폴더경로'].text.to_s).each do |file|
2263
- if file == '.' or file == '..'
2264
2272
 
2265
- else
2266
- @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
2267
2282
  end
2283
+
2284
+ # 마지막 빈 항목 추가 후 제거 (원래 로직에 맞춰)
2285
+ @data['이미지설정']['이미지'] << []
2286
+ @data['이미지설정']['이미지'].pop
2287
+ else
2288
+ # 경로가 존재하지 않으면 경고 메시지 출력
2289
+ puts "경로가 존재하지 않습니다: #{path}"
2268
2290
  end
2269
- @data['이미지설정']['이미지'] << []
2270
- @data['이미지설정']['이미지'].pop
2271
2291
  }
2272
2292
  }
2273
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.1
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-22 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