posting_duo 0.0.15 → 0.0.19

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 +51 -26
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff482dbd87ff4dbf4573dd9b91c508f472d2c157e8fc19f2ec556341ed469519
4
- data.tar.gz: 603e38712d43e0cd2332453ced12d141444f8ed7255b0d7870cdd86b341591c7
3
+ metadata.gz: 703a0b11e348758c46a6a57a2cb8ce255108c398a8ddc85bedc143c3e06a3773
4
+ data.tar.gz: d5f31dd4d44b143885d36578c3f24624d56861d26df74257349c753bd641ccad
5
5
  SHA512:
6
- metadata.gz: d8f4a4997c55b3cdf86687dfe9cff974363eff59faebf153c98425ca3269b062054e1bac46a751b73d134c2f4d77c11be74969c6895257d689b2dcbe3ec0d0cf
7
- data.tar.gz: 1f221c7c73a3ef0b66a16d122cd4b5c1b9d45a77f78f810031383390548f0ca93b9ec0c75ce44ccf98b4b27c31eb1737739963eec0c0590a48baeeed3602a38f
6
+ metadata.gz: cdfa75c2102326cf1445dd0e54489022e8253025034431f934e697a3228150ad1cb9128fd06ac86101db9e751373547693de68fbf91fa716e37bd5251cf09a67
7
+ data.tar.gz: 2648e2ee10dfc4ab165c0cfd85cd29aee5df72e463ea94a8243b0d7b6bd5c5fd43df61606ab3d49ad92bf1f8b43642c214d2649f0726400952aaaec29f04257b
data/lib/posting_duo.rb CHANGED
@@ -44,7 +44,6 @@ class Naver
44
44
  options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.59 Safari/537.36') # user-agent 위조
45
45
  options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
46
46
  options.add_argument('--ignore-certificate-errors') #SSL 인증서 오류를 무시하도록 설정합니다
47
- options.excludeSwitches('--enable-automation') #자동화된 테스트...제거
48
47
  options.add_argument('--disable-web-security') #웹 보안을 비활성화합니다
49
48
  options.add_argument('--allow-running-insecure-content') #HTTPS 사이트에서 HTTP 컨텐츠를 실행할 수 있도록 허용합니다.
50
49
  options.add_argument('--no-sandbox') #Chrome에서 샌드박스 모드를 비활성화합니다.
@@ -85,7 +84,6 @@ class Naver
85
84
  options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.59 Safari/537.36') # user-agent 위조
86
85
  options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
87
86
  options.add_argument('--ignore-certificate-errors') #SSL 인증서 오류를 무시하도록 설정합니다
88
- options.excludeSwitches('--enable-automation') #자동화된 테스트...제거
89
87
  options.add_argument('--disable-web-security') #웹 보안을 비활성화합니다
90
88
  options.add_argument('--allow-running-insecure-content') #HTTPS 사이트에서 HTTP 컨텐츠를 실행할 수 있도록 허용합니다.
91
89
  options.add_argument('--no-sandbox') #Chrome에서 샌드박스 모드를 비활성화합니다.
@@ -115,7 +113,6 @@ class Naver
115
113
  options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.59 Safari/537.36') # user-agent 위조
116
114
  options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
117
115
  options.add_argument('--ignore-certificate-errors') #SSL 인증서 오류를 무시하도록 설정합니다
118
- options.excludeSwitches('--enable-automation') #자동화된 테스트...제거
119
116
  options.add_argument('--disable-web-security') #웹 보안을 비활성화합니다
120
117
  options.add_argument('--allow-running-insecure-content') #HTTPS 사이트에서 HTTP 컨텐츠를 실행할 수 있도록 허용합니다.
121
118
  options.add_argument('--no-sandbox') #Chrome에서 샌드박스 모드를 비활성화합니다.
@@ -8722,10 +8719,15 @@ class Wordpress
8722
8719
 
8723
8720
  @captcha_key = captcha_key
8724
8721
  begin
8725
- Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
8726
- @driver = Selenium::WebDriver.for :chrome
8722
+ capabilities = [options]
8723
+
8724
+ # 드라이버 초기화 (capabilities 사용)
8725
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
8727
8726
  rescue
8728
- @driver = Selenium::WebDriver.for :chrome
8727
+ capabilities = [options]
8728
+
8729
+ # 드라이버 초기화 (capabilities 사용)
8730
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
8729
8731
  end
8730
8732
  end
8731
8733
 
@@ -10456,19 +10458,33 @@ class Wordpress
10456
10458
  text "내용폴더경로 ex)C:\\내용\\폴더1"
10457
10459
  }
10458
10460
  button('   폴더째로 불러오기   '){
10459
- stretchy false
10460
- on_clicked{
10461
- path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')
10462
- Dir.entries(@data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')).each do |file|
10463
- if file == '.' or file == '..'
10461
+ on_clicked {
10462
+ path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')
10464
10463
 
10465
- else
10466
- file_data = File.open(path+'/'+file,'r', :encoding => 'utf-8').read()
10467
- @data['내용설정']['내용'] << [false, file, file_data]
10464
+ # 경로가 유효한지 확인
10465
+ if Dir.exist?(path)
10466
+ Dir.entries(path).each do |file|
10467
+ if file == '.' or file == '..'
10468
+ next
10469
+ else
10470
+ begin
10471
+ # 파일을 열고 내용을 읽어서 추가
10472
+ file_data = File.open(path + '/' + file, 'r', encoding: 'utf-8').read
10473
+ @data['내용설정']['내용'] << [false, file, file_data]
10474
+ rescue => e
10475
+ # 파일을 열 수 없는 경우, 오류 메시지 출력
10476
+ puts "파일을 열 수 없습니다: #{file}, 오류: #{e.message}"
10477
+ end
10478
+ end
10468
10479
  end
10480
+
10481
+ # 내용 배열에서 마지막 빈 항목 제거
10482
+ @data['내용설정']['내용'] << []
10483
+ @data['내용설정']['내용'].pop
10484
+ else
10485
+ # 경로가 유효하지 않을 경우, 오류 메시지 출력
10486
+ puts "경로가 존재하지 않습니다: #{path}"
10469
10487
  end
10470
- @data['내용설정']['내용'] << []
10471
- @data['내용설정']['내용'].pop
10472
10488
  }
10473
10489
  }
10474
10490
  }
@@ -10553,19 +10569,28 @@ class Wordpress
10553
10569
  stretchy false
10554
10570
  text "사진폴더경로 ex)C:\\사진\\폴더2"
10555
10571
  }
10556
- button('폴더째로불러오기'){
10557
- stretchy false
10558
- on_clicked{
10559
- path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')
10560
- Dir.entries(@data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')).each do |file|
10561
- if file == '.' or file == '..'
10572
+ button('폴더째로 불러오기') {
10573
+ on_clicked {
10574
+ path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')
10562
10575
 
10563
- else
10564
- @data['이미지설정']['이미지'] << [false, file, path+"\\"+file.force_encoding('utf-8')]
10576
+ # 경로가 유효한지 확인
10577
+ if Dir.exist?(path)
10578
+ Dir.entries(path).each do |file|
10579
+ if file == '.' or file == '..'
10580
+ next
10581
+ else
10582
+ # 폴더 내의 파일을 이미지 리스트에 추가
10583
+ @data['이미지설정']['이미지'] << [false, file, path + "\\" + file.force_encoding('utf-8')]
10584
+ end
10565
10585
  end
10586
+
10587
+ # 마지막 빈 항목 추가 후 제거 (원래 로직에 맞춰)
10588
+ @data['이미지설정']['이미지'] << []
10589
+ @data['이미지설정']['이미지'].pop
10590
+ else
10591
+ # 경로가 존재하지 않으면 경고 메시지 출력
10592
+ puts "경로가 존재하지 않습니다: #{path}"
10566
10593
  end
10567
- @data['이미지설정']['이미지'] << []
10568
- @data['이미지설정']['이미지'].pop
10569
10594
  }
10570
10595
  }
10571
10596
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posting_duo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon