posting_duo 3.111.010 → 3.111.013

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/posting_duo.rb +175 -260
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dc6c520189da98a8d367cb0ade857f60a72631ae0ae4f6c6d9a704329c97a62
4
- data.tar.gz: 4296f207310926768f90ffdd913ec9e596d233c58988f040a69e7f32881c3600
3
+ metadata.gz: a5d822c7044b56fc799bab10790b7d66789cdfbca78ff77237797066516f3f23
4
+ data.tar.gz: a75b34e8c12d9c57f660b870f771794d92560afed23392c84f61b34d74d23529
5
5
  SHA512:
6
- metadata.gz: 431a41d7cfc2cd42d1e25f73d00645b2388cbb5e5c6b0f7d1e27445e520e4ed54ef308d6bd5c1e8d6a5495a4b187188fb7fd28ffc8cb2d8e2b3de0b1393798a1
7
- data.tar.gz: b0c2e8efa4402246d7fd50a5893c195381bc5d51e064d8a10d8d639f95ed8f5a6d86bc77a19097b2d1de7cc60031124f864fdcd6f172904515805d1dc3030fee
6
+ metadata.gz: c37f29d2f33ab200f0c18df1b798b393532fff20d61597f021ae915587438cc7f3ab7e9d44b7912210288c3b166e2e4092419d75527d7d7341655cb141e681b4
7
+ data.tar.gz: ba5e47f6e5edb8613ca65925533a9c23ae22f316243b1c0b3d572c044c02f4494a41a7b27609d86acfdda2ddc74aeebc4b96ab5b398497982827011a908ae6b6
data/lib/posting_duo.rb CHANGED
@@ -6891,11 +6891,19 @@ begin
6891
6891
  puts '-[√] 닉네임 26코드 타겟.......'.yellow
6892
6892
  rescue
6893
6893
  begin
6894
+ @driver.find_element(xpath: '//input[@type="text" and @title="글쓴이"]').clear
6895
+ sleep(1)
6894
6896
  @driver.find_element(xpath: '//input[@type="text" and @title="글쓴이"]').send_keys(user_id)
6895
6897
  sleep(1)
6896
6898
  puts '-[√] 닉네임 27코드 타겟.......'.yellow
6897
6899
  rescue
6898
-
6900
+ begin
6901
+ @driver.find_element(xpath: '//input[@type="text" and @name="member_display"]').send_keys(user_id)
6902
+ sleep(1)
6903
+ puts '-[√] 닉네임 28코드 타겟.......'.yellow
6904
+ rescue
6905
+
6906
+ end
6899
6907
  end
6900
6908
  end
6901
6909
  end
@@ -7046,7 +7054,13 @@ begin
7046
7054
  sleep(1)
7047
7055
  puts '-[√] 패스워드 21코드 타겟.......'.yellow
7048
7056
  rescue
7049
-
7057
+ begin
7058
+ @driver.find_element(:id, 'userPw').send_keys(user_pw)
7059
+ sleep(1)
7060
+ puts '-[√] 패스워드 22코드 타겟.......'.yellow
7061
+ rescue
7062
+
7063
+ end
7050
7064
  end
7051
7065
  end
7052
7066
  end
@@ -7071,7 +7085,7 @@ begin
7071
7085
  sleep(1)
7072
7086
  end
7073
7087
  ##<─────────────────────────────────────────────────────────────────────패스워드 입력 코드 부분
7074
-
7088
+
7075
7089
  ##패스워드 입력 2차 코드 부분─────────────────────────────────────────────────────────────────────>
7076
7090
  begin
7077
7091
  @driver.find_element(:xpath, '//*[@for="blogPostPassword2"]').send_keys(user_pw)
@@ -8240,12 +8254,22 @@ end
8240
8254
  @driver.find_element(:xpath, '//*[@id="wr_content-html"]').click
8241
8255
  rescue
8242
8256
  begin
8243
-
8244
- html_bb = @driver.find_element(:xpath, '//*[@id="fwrite"]/div[2]/ul/li/label')
8245
- @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8246
- puts '-[√] HTML 코드 28 code.......'.yellow
8247
- sleep(1)
8248
- @driver.find_element(:xpath, '//*[@id="fwrite"]/div[2]/ul/li/label').click
8257
+
8258
+ html_bb = @driver.find_element(xpath: '//*[@id="fwrite"]/div[2]/ul/li/label')
8259
+
8260
+ # 텍스트 확인
8261
+ if html_bb.text.include?("비밀글")
8262
+ puts "비밀글 항목이므로 클릭하지 않음"
8263
+ raise #턴 넘김
8264
+ else
8265
+ html_bb = @driver.find_element(:xpath, '//*[@id="fwrite"]/div[2]/ul/li/label')
8266
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8267
+ sleep(1)
8268
+ @driver.find_element(:xpath, '//*[@id="fwrite"]/div[2]/ul/li/label').click
8269
+ sleep(1)
8270
+ puts '-[√] HTML 코드 28 code.......'.yellow
8271
+ end
8272
+
8249
8273
  rescue
8250
8274
  begin
8251
8275
  @driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="NamoSE_Ifr__editor"]'))
@@ -8260,7 +8284,7 @@ end
8260
8284
  @driver.switch_to.default_content()
8261
8285
  html_bb = @driver.find_element(:xpath, '//*[@type="radio" and @name="rg_html_use" and @value="1"]')
8262
8286
  @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8263
- puts '-[√] HTML 코드 28 code.......'.yellow
8287
+ puts '-[√] HTML 코드 30 code.......'.yellow
8264
8288
  sleep(1)
8265
8289
  @driver.find_element(:xpath, '//*[@type="radio" and @name="rg_html_use" and @value="1"]').click
8266
8290
  rescue
@@ -8274,7 +8298,7 @@ end
8274
8298
  sleep(1)
8275
8299
  @driver.find_element(:xpath, '//*[@title="HTML 편집기"]').click
8276
8300
  @driver.switch_to.default_content()
8277
- puts '-[√] HTML 코드 29 code.......'.yellow
8301
+ puts '-[√] HTML 코드 31 code.......'.yellow
8278
8302
  sleep(1)
8279
8303
  rescue
8280
8304
  begin
@@ -8284,7 +8308,7 @@ end
8284
8308
  #아이프레임 나오기
8285
8309
  sleep(1)
8286
8310
  @driver.find_element(:xpath, '//*[@type="checkbox" and @name="ctype" and @value="H"]').click
8287
- puts '-[√] HTML 코드 30 code.......'.yellow
8311
+ puts '-[√] HTML 코드 32 code.......'.yellow
8288
8312
  sleep(1)
8289
8313
  rescue
8290
8314
  begin
@@ -8295,7 +8319,7 @@ end
8295
8319
  html_bb = @driver.find_element(:xpath, '//*[@class="combobox_mode"]').click
8296
8320
  sleep(1.5)
8297
8321
  html_bb = @driver.find_element(:xpath, '//*[@key="Html"]').click
8298
- puts '-[√] HTML 코드 31 code.......'.yellow
8322
+ puts '-[√] HTML 코드 33 code.......'.yellow
8299
8323
  sleep(1)
8300
8324
  rescue
8301
8325
  begin
@@ -8303,7 +8327,7 @@ end
8303
8327
  @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8304
8328
  sleep(1)
8305
8329
  html_bb = @driver.find_element(:xpath, '//*[@name="use_html"]').click
8306
- puts '-[√] HTML 코드 32 code.......'.yellow
8330
+ puts '-[√] HTML 코드 34 code.......'.yellow
8307
8331
  sleep(1)
8308
8332
  rescue
8309
8333
  begin
@@ -8311,7 +8335,7 @@ end
8311
8335
  @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8312
8336
  sleep(1)
8313
8337
  html_bb = @driver.find_element(:xpath, '//*[@class="note-btn btn-codeview note-codeview-keep"]').click
8314
- puts '-[√] HTML 코드 32 code.......'.yellow
8338
+ puts '-[√] HTML 코드 35 code.......'.yellow
8315
8339
  sleep(1)
8316
8340
  rescue
8317
8341
  begin
@@ -8324,7 +8348,7 @@ end
8324
8348
  sleep(1)
8325
8349
  @driver.find_element(:xpath, '//*[@data-button-id="html"]').click
8326
8350
  @driver.switch_to.default_content
8327
- puts '-[√] HTML 코드 33 code.......'.yellow
8351
+ puts '-[√] HTML 코드 36 code.......'.yellow
8328
8352
  sleep(1)
8329
8353
  rescue
8330
8354
  begin
@@ -8333,39 +8357,49 @@ end
8333
8357
  @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8334
8358
  sleep(1)
8335
8359
  html_bb = @driver.find_element(xpath: '//a[@href="#htmlEditor" and contains(@onclick, "html")]').click
8336
- puts '-[√] HTML 코드 34 code.......'.yellow
8360
+ puts '-[√] HTML 코드 37 code.......'.yellow
8337
8361
  sleep(1)
8338
8362
  rescue
8339
8363
  begin
8340
8364
  @driver.switch_to.default_content
8341
- if target_element
8342
- # 3. 제목 요소 바로 아래에 체크박스 HTML 삽입
8343
- checkbox_html = <<~HTML
8344
- <div class="custom-control custom-checkbox custom-control-inline">
8345
- <input type="checkbox" name="html" value="html2" id="html" onclick="html_auto_br(this);" class="custom-control-input">
8346
- <label class="custom-control-label" for="html"><span>HTML</span></label>
8347
- </div>
8348
- HTML
8349
- @driver.execute_script("arguments[0].insertAdjacentHTML('afterend', arguments[1]);", target_element, checkbox_html)
8350
- puts '체크박스 HTML 강제 적용.......'.green
8351
- sleep(1)
8352
-
8353
- # 4. 삽입한 체크박스 스크롤하여 화면 중앙으로 이동
8354
- html_checkbox = @driver.find_element(:xpath, '//*[@type="checkbox" and @name="html"]')
8355
- @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_checkbox)
8356
- sleep(1)
8357
-
8358
- # 5. HTML 토글 버튼 클릭
8359
- @driver.find_element(:xpath, '//*[@type="checkbox" and @name="html"]').click
8360
- puts '-[√] 임의 추가 HTML 코드 01 code.......'.yellow
8365
+ html_bb = @driver.find_element(xpath: '//input[@type="checkbox" and @name="chkhtml"]')
8366
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8367
+ sleep(1)
8368
+ html_bb = @driver.find_element(xpath: '//input[@type="checkbox" and @name="chkhtml"]').click
8369
+ puts '-[√] HTML 코드 38 code.......'.yellow
8361
8370
  sleep(1)
8362
-
8363
- else
8364
- puts "타겟 제목 요소가 없어서 체크박스 삽입 불가".red
8365
- end
8366
8371
  rescue
8367
-
8368
- end
8372
+ begin
8373
+ @driver.switch_to.default_content
8374
+ if target_element
8375
+ # 3. 제목 요소 바로 아래에 체크박스 HTML 삽입
8376
+ checkbox_html = <<~HTML
8377
+ <div class="custom-control custom-checkbox custom-control-inline">
8378
+ <input type="checkbox" name="html" value="html2" id="html" onclick="html_auto_br(this);" class="custom-control-input">
8379
+ <label class="custom-control-label" for="html"><span>HTML</span></label>
8380
+ </div>
8381
+ HTML
8382
+ @driver.execute_script("arguments[0].insertAdjacentHTML('afterend', arguments[1]);", target_element, checkbox_html)
8383
+ puts '체크박스 HTML 강제 적용.......'.green
8384
+ sleep(1)
8385
+
8386
+ # 4. 삽입한 체크박스 스크롤하여 화면 중앙으로 이동
8387
+ html_checkbox = @driver.find_element(:xpath, '//*[@type="checkbox" and @name="html"]')
8388
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_checkbox)
8389
+ sleep(1)
8390
+
8391
+ # 5. HTML 토글 버튼 클릭
8392
+ @driver.find_element(:xpath, '//*[@type="checkbox" and @name="html"]').click
8393
+ puts '-[√] 임의 추가 HTML 코드 01 code.......'.yellow
8394
+ sleep(1)
8395
+
8396
+ else
8397
+ puts "타겟 제목 요소가 없어서 체크박스 삽입 불가".red
8398
+ end
8399
+ rescue
8400
+
8401
+ end
8402
+ end
8369
8403
  end
8370
8404
  end
8371
8405
  end
@@ -12380,6 +12414,35 @@ ss_button = @driver.find_element(xpath: '//span[@class="button"]/input[@type="su
12380
12414
  puts '-[√] 등록을 52번 코드로 시도하였습니다.......'.magenta
12381
12415
  sleep(1)
12382
12416
 
12417
+ rescue
12418
+ begin
12419
+ ss_button = @driver.find_element(xpath: '//button[@type="submit" and contains(@class, "btn_insert") and contains(normalize-space(.), "등록")]')
12420
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
12421
+ sleep(1)
12422
+
12423
+ ss_button = @driver.find_element(xpath: '//button[@type="submit" and contains(@class, "btn_insert") and contains(normalize-space(.), "등록")]').click
12424
+ puts '-[√] 등록을 53번 코드로 시도하였습니다.......'.magenta
12425
+ sleep(1)
12426
+
12427
+ rescue
12428
+ begin
12429
+ ss_button = @driver.find_element(xpath: '//img[contains(@src, "btn_write.gif")]')
12430
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
12431
+ sleep(1)
12432
+
12433
+ ss_button = @driver.find_element(xpath: '//img[contains(@src, "btn_write.gif")]').click
12434
+ puts '-[√] 등록을 54번 코드로 시도하였습니다.......'.magenta
12435
+ sleep(1)
12436
+ '//button[@type="submit" and contains(@class, "kboard-default-button-small") and contains(text(), "저장하기")]'
12437
+ rescue
12438
+ begin
12439
+ ss_button = @driver.find_element(xpath: '//button[@type="submit" and contains(@class, "kboard-default-button-small") and contains(text(), "저장하기")]')
12440
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
12441
+ sleep(1)
12442
+
12443
+ ss_button = @driver.find_element(xpath: '//button[@type="submit" and contains(@class, "kboard-default-button-small") and contains(text(), "저장하기")]').click
12444
+ puts '-[√] 등록을 55번 코드로 시도하였습니다.......'.magenta
12445
+ sleep(1)
12383
12446
 
12384
12447
  rescue
12385
12448
  ########─────────────────────────────▼▼▼▼▼▼▼ 등록버튼 2차 시도 ▼▼▼▼▼▼▼──────────────────────────────#######
@@ -12571,6 +12634,7 @@ end
12571
12634
  end
12572
12635
  end
12573
12636
  end
12637
+ end
12574
12638
  end
12575
12639
  end
12576
12640
  end
@@ -12591,6 +12655,8 @@ end
12591
12655
  end
12592
12656
  end
12593
12657
  end
12658
+ end
12659
+ end
12594
12660
  end
12595
12661
  ########─────────────────────────────▲▲▲▲▲▲▲ 등록버튼 2차 시도 ▲▲▲▲▲▲▲──────────────────────────────#######
12596
12662
  end
@@ -13325,6 +13391,7 @@ class Wordpress
13325
13391
  end
13326
13392
 
13327
13393
 
13394
+
13328
13395
  def color_image
13329
13396
  color = File.open('./color.ini', 'r', :encoding => 'utf-8').read().split("\n")
13330
13397
  image = Magick::Image.new(740, 740) { |k| k.background_color = color.sample }
@@ -13333,187 +13400,79 @@ class Wordpress
13333
13400
 
13334
13401
  def save_image
13335
13402
  if @data['이미지설정']['이미지'].length == 0
13336
- return
13337
- end
13338
-
13339
- if @data['이미지설정']['순서사용'].checked?
13340
- image_path = @data['이미지설정']['이미지'][@image_counter][2]
13341
- @image_counter += 1
13342
- if @image_counter > @data['이미지설정']['이미지'].length - 1
13343
- @image_counter = 0
13344
- end
13403
+
13345
13404
  else
13346
- # 초기화가 안됐거나 다 썼으면 새롭게 섞는다
13347
- @shuffled_images ||= []
13348
- if @shuffled_images.empty?
13349
- @shuffled_images = @data['이미지설정']['이미지'].shuffle
13405
+ if @data['이미지설정']['순서사용'].checked?
13406
+ image_path = @data['이미지설정']['이미지'][@image_counter][2]
13407
+ @image_counter += 1
13408
+ if @image_counter > @data['이미지설정']['이미지'].length-1
13409
+ @image_counter = 0
13410
+ end
13411
+ else
13412
+ image_path = @data['이미지설정']['이미지'].sample[2]
13350
13413
  end
13351
-
13352
- image_path = @shuffled_images.shift[2]
13414
+ img = Magick::Image.read(image_path).first
13415
+ img.write('./image/memory.png')
13353
13416
  end
13354
-
13355
- img = Magick::Image.read(image_path).first
13356
- img.write('./image/memory.png')
13357
13417
  end
13358
13418
 
13359
13419
  def change_image_size(w)
13360
13420
  img = Magick::Image.read('./image/memory.png').first
13361
13421
  width = img.columns
13362
13422
  height = img.rows
13363
-
13364
- # '원본' 선택된 경우, 리사이징을 하지 않고 원본 이미지를 그대로 반환
13365
- if w == 'original'
13366
- return img # 원본 이미지 그대로 반환
13367
- else
13368
- begin
13369
- if @data['image_type'][0].checked? or @data['image_type'][2].checked?
13370
- # 비율을 맞추어 리사이징
13371
- img.resize!(w, w * (height.to_f / width.to_f))
13372
- else
13373
- # 정사각형으로 리사이징
13374
- img.resize!(w, w)
13375
- end
13376
- rescue
13377
- img.resize!(w, w) # 예외 처리 시에도 리사이징
13423
+ begin
13424
+ if @data['image_type'][0].checked? or @data['image_type'][2].checked?
13425
+ img.resize!(w, w*(height.to_f/width.to_f))
13426
+ else
13427
+ img.resize!(w, w)
13378
13428
  end
13429
+ rescue
13430
+ img.resize!(w, w)
13379
13431
  end
13380
-
13381
- # 리사이징된 이미지 저장
13382
13432
  img.write('./image/memory.png')
13383
13433
  end
13384
13434
 
13385
- def wrap_text_to_fit(draw, text, max_width, max_height, font_path, initial_size)
13386
- size = initial_size
13387
- draw.font = font_path
13388
-
13389
- loop do
13390
- draw.pointsize = size
13391
- words = text.chars # 글자 단위로 자름 (한국어 기준)
13392
- lines = []
13393
- line = ""
13394
-
13395
- words.each do |char|
13396
- test_line = line + char
13397
- metrics = draw.get_type_metrics(test_line)
13398
- if metrics.width > max_width
13399
- lines << line
13400
- line = char
13401
- else
13402
- line = test_line
13403
- end
13435
+ def image_text(text1, text2)
13436
+ begin
13437
+ color = File.open('./color.ini', 'r', :encoding => 'utf-8').read().split("\n")
13438
+ font = Dir.entries('./fonts')
13439
+ img = Magick::Image.read('./image/memory.png').first
13440
+ text = Magick::Draw.new
13441
+ color2 = color.sample
13442
+ font2 = './fonts/'+font.sample
13443
+ message = text1.to_s+"\n"+text2.to_s
13444
+ begin
13445
+ size = rand(@data['이미지설정']['이미지글자1크기1'].text.to_i..@data['이미지설정']['이미지글자1크기2'].text.to_i)
13446
+ rescue
13447
+ size = 30
13404
13448
  end
13405
- lines << line unless line.empty?
13406
-
13407
- line_height = draw.get_type_metrics("가").height
13408
- total_height = line_height * lines.size
13409
-
13410
- # 세로 초과 안 하면 성공
13411
- if total_height <= max_height || size <= 10
13412
- return [lines.join("\n"), size]
13413
- else
13414
- size -= 2
13449
+ if @data['이미지설정']['글자그림자'].checked?
13450
+ img.annotate(text, 0,0, +3,+3, message) do
13451
+ text.gravity = Magick::CenterGravity
13452
+ text.pointsize = size
13453
+ text.fill = '#000000'
13454
+ text.font = font2
13455
+ end
13415
13456
  end
13416
- end
13417
- end
13418
-
13419
-
13420
- def image_text(text1, text2)
13421
- begin
13422
- color = File.open('./color.ini', 'r', encoding: 'utf-8').read.split("\n").map(&:strip).reject(&:empty?)
13423
- font_files = Dir.entries('./fonts').select { |f| f.downcase.end_with?('.ttf') }
13424
- font2 = './fonts/' + font_files.sample
13425
-
13426
- # 랜덤 글자색 선택
13427
- color2 = color.sample
13428
-
13429
- # 헬퍼 함수: 색상 문자열 '#RRGGBB' -> [R,G,B] 배열로 변환
13430
- def hex_to_rgb(hex)
13431
- hex = hex.delete('#')
13432
- [hex[0..1], hex[2..3], hex[4..5]].map { |c| c.to_i(16) }
13433
- end
13434
-
13435
- # 헬퍼 함수: 두 RGB 색상의 차이 계산 (간단한 유클리드 거리)
13436
- def color_distance(c1, c2)
13437
- Math.sqrt(
13438
- (c1[0] - c2[0])**2 +
13439
- (c1[1] - c2[1])**2 +
13440
- (c1[2] - c2[2])**2
13441
- )
13442
- end
13443
-
13444
- # 대비가 충분히 되는 테두리 색상 선택
13445
- max_attempts = 10
13446
- stroke_color = nil
13447
- base_rgb = hex_to_rgb(color2)
13448
-
13449
- max_attempts.times do
13450
- candidate = color.sample
13451
- candidate_rgb = hex_to_rgb(candidate)
13452
- dist = color_distance(base_rgb, candidate_rgb)
13453
-
13454
- # 거리(차이) 임계값 100 (0~441 범위) — 필요시 조절 가능
13455
- if dist > 100
13456
- stroke_color = candidate
13457
- break
13458
- end
13459
- end
13460
- stroke_color ||= '#000000' # 만약 충분히 다른 색 없으면 검정색 기본값
13461
13457
 
13462
- img = Magick::Image.read('./image/memory.png').first
13463
- draw = Magick::Draw.new
13464
-
13465
- raw_message = "#{text1}\n#{text2}".strip
13466
- max_width = img.columns * 0.85
13467
- max_height = img.rows * 0.6
13458
+ img.annotate(text, 0,0,0,0, message) do
13459
+ text.gravity = Magick::CenterGravity
13460
+ text.pointsize = size
13461
+ if @data['이미지설정']['글자테두리'].checked?
13462
+ text.stroke_width = 2
13463
+ text.stroke = '#000000'
13464
+ end
13465
+ text.fill = color2
13466
+ text.font = font2
13467
+ end
13468
13468
 
13469
- begin
13470
- size = rand(@data['이미지설정']['이미지글자1크기1'].text.to_i..@data['이미지설정']['이미지글자1크기2'].text.to_i)
13469
+ img.write('./image/memory.png')
13471
13470
  rescue
13472
- size = 30
13473
- end
13474
-
13475
- wrapped_message, adjusted_size = wrap_text_to_fit(draw, raw_message, max_width, max_height, font2, size)
13476
-
13477
- if @data['이미지설정']['글자그림자'].checked?
13478
- img.annotate(draw, 0, 0, 2, 2, wrapped_message) do
13479
- draw.gravity = Magick::CenterGravity
13480
- draw.pointsize = adjusted_size
13481
- draw.fill = '#000000'
13482
- draw.font = font2
13483
- end
13484
- end
13485
-
13486
- if @data['이미지설정']['글자테두리'].checked?
13487
- draw_stroke = Magick::Draw.new
13488
- img.annotate(draw_stroke, 0, 0, 0, 0, wrapped_message) do
13489
- draw_stroke.gravity = Magick::CenterGravity
13490
- draw_stroke.pointsize = adjusted_size
13491
- draw_stroke.fill = 'none'
13492
- draw_stroke.stroke = stroke_color
13493
- draw_stroke.stroke_width = rand(5..10)
13494
- draw_stroke.font = font2
13495
- end
13496
- end
13497
-
13498
- draw2 = Magick::Draw.new
13499
- img.annotate(draw2, 0, 0, 0, 0, wrapped_message) do
13500
- draw2.gravity = Magick::CenterGravity
13501
- draw2.pointsize = adjusted_size
13502
- draw2.fill = color2
13503
- draw2.stroke = 'none'
13504
- draw2.font = font2
13471
+ puts '이미지 폰트 불러오기 오류 재시도...'
13472
+ sleep(3)
13473
+ retry
13505
13474
  end
13506
-
13507
- img.write('./image/memory.png')
13508
-
13509
- rescue => e
13510
- puts "이미지 폰트 불러오기 오류 재시도... (#{e.message})"
13511
- sleep(3)
13512
- retry
13513
13475
  end
13514
- end
13515
-
13516
-
13517
13476
 
13518
13477
  def border()
13519
13478
  color = File.open('./color.ini', 'r',:encoding => 'utf-8').read().split("\n")
@@ -13540,69 +13499,40 @@ class Wordpress
13540
13499
  else
13541
13500
  auto_image()
13542
13501
  end
13543
-
13544
- # '원본'을 포함한 이미지 크기 옵션 추가
13545
- image_size = [480, 740, 650, 550, 480, 'original']
13502
+
13503
+ image_size = [480,740,650,550,480]
13546
13504
  size = 0
13547
-
13548
- for n in 0..5 # 0부터 5까지 반복, '원본' 옵션까지 포함
13505
+ for n in 0..4
13549
13506
  if @data['image_size'][n].checked?
13550
- if n == 5 # '원본'이 선택되었을 경우
13551
- size = 'original'
13552
- elsif n == 0
13553
- size = image_size.sample # 랜덤 선택
13507
+ if n == 0
13508
+ size = image_size.sample
13554
13509
  else
13555
13510
  size = image_size[n]
13556
13511
  end
13557
13512
  end
13558
13513
  end
13559
-
13560
- # '원본'이 선택되지 않았다면 기본 값 설정
13561
13514
  if size == 0
13562
13515
  size = 480
13563
13516
  end
13564
-
13565
- change_image_size(size) # 크기 변경 함수 호출
13566
13517
 
13518
+ change_image_size(size)
13567
13519
 
13568
13520
  if @data['이미지설정']['필터사용'].checked?
13569
13521
  image_filter()
13570
13522
  end
13571
13523
 
13524
+ insert_image_text1 = ''
13525
+ insert_image_text2 = ''
13572
13526
  if @data['이미지설정']['글자삽입1'].checked?
13573
- if @data['이미지설정']['이미지글자1'].length == 0
13574
- image_text_path1 = ''
13575
- else
13576
- if @data['이미지설정']['글자랜덤'].checked?
13577
- image_text_path1 = @data['이미지설정']['이미지글자1'].sample
13578
- else
13579
- image_text_path1 = @data['이미지설정']['이미지글자1'][@image_text_soon1]
13580
- @image_text_soon1 += 1
13581
- if @image_text_soon1 > @data['이미지설정']['이미지글자1'].length - 1
13582
- @image_text_soon1 = 0
13583
- end
13584
- end
13585
- end
13527
+ insert_image_text1 = @data['이미지설정']['이미지글자1'].sample
13586
13528
  end
13587
13529
 
13588
13530
  if @data['이미지설정']['글자삽입2'].checked?
13589
- if @data['이미지설정']['이미지글자2'].length == 0
13590
- image_text_path2 = ''
13591
- else
13592
- if @data['이미지설정']['글자랜덤'].checked?
13593
- image_text_path2 = @data['이미지설정']['이미지글자2'].sample
13594
- else
13595
- image_text_path2 = @data['이미지설정']['이미지글자2'][@image_text_soon2]
13596
- @image_text_soon2 += 1
13597
- if @image_text_soon2 > @data['이미지설정']['이미지글자2'].length - 1
13598
- @image_text_soon2 = 0
13599
- end
13600
- end
13601
- end
13531
+ insert_image_text2 = @data['이미지설정']['이미지글자2'].sample
13602
13532
  end
13603
-
13533
+
13604
13534
  if @data['이미지설정']['글자삽입1'].checked? or @data['이미지설정']['글자삽입2'].checked?
13605
- image_text(image_text_path1, image_text_path2)
13535
+ image_text(insert_image_text1, insert_image_text2)
13606
13536
  end
13607
13537
 
13608
13538
  if @data['이미지설정']['테두리사용'].checked?
@@ -15470,7 +15400,6 @@ class Wordpress
15470
15400
  @data['image_size'][2].checked = false
15471
15401
  @data['image_size'][3].checked = false
15472
15402
  @data['image_size'][4].checked = false
15473
- @data['image_size'][5].checked = false
15474
15403
  end
15475
15404
  }
15476
15405
  }
@@ -15481,7 +15410,6 @@ class Wordpress
15481
15410
  @data['image_size'][2].checked = false
15482
15411
  @data['image_size'][3].checked = false
15483
15412
  @data['image_size'][4].checked = false
15484
- @data['image_size'][5].checked = false
15485
15413
  end
15486
15414
  }
15487
15415
  }
@@ -15492,7 +15420,6 @@ class Wordpress
15492
15420
  @data['image_size'][0].checked = false
15493
15421
  @data['image_size'][3].checked = false
15494
15422
  @data['image_size'][4].checked = false
15495
- @data['image_size'][5].checked = false
15496
15423
  end
15497
15424
  }
15498
15425
  }
@@ -15503,7 +15430,6 @@ class Wordpress
15503
15430
  @data['image_size'][2].checked = false
15504
15431
  @data['image_size'][0].checked = false
15505
15432
  @data['image_size'][4].checked = false
15506
- @data['image_size'][5].checked = false
15507
15433
  end
15508
15434
  }
15509
15435
  }
@@ -15514,21 +15440,10 @@ class Wordpress
15514
15440
  @data['image_size'][2].checked = false
15515
15441
  @data['image_size'][3].checked = false
15516
15442
  @data['image_size'][0].checked = false
15517
- @data['image_size'][5].checked = false
15518
- end
15519
- }
15520
- }
15521
- @data['image_size'][5] = checkbox('원본 px'){
15522
- on_toggled{
15523
- if @data['image_size'][5].checked?
15524
- @data['image_size'][1].checked = false
15525
- @data['image_size'][2].checked = false
15526
- @data['image_size'][3].checked = false
15527
- @data['image_size'][0].checked = false
15528
- @data['image_size'][4].checked = false
15529
15443
  end
15530
15444
  }
15531
15445
  }
15446
+
15532
15447
  }
15533
15448
  }
15534
15449
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posting_duo
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.111.010
4
+ version: 3.111.013
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-06-27 00:00:00.000000000 Z
10
+ date: 2025-07-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: File to Clipboard gem
13
13
  email: mymin26@naver.com