posting_zon 0.0.15 → 0.0.20

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_zon.rb +50 -24
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32e7e6e3eec3266844140dae770b3a6f2c4dc921c7a49217d428525553d56e0f
4
- data.tar.gz: a760148ab99d7913ab29ffa6311a244dafb39944319f308de30dbaad56cd39a6
3
+ metadata.gz: 803c059efe6512bfdbdef05938844737d3dca5b9c62ffb8fa0125cdeef9fb634
4
+ data.tar.gz: e9cee93045e8b3a55c3a1118ce7ecef9c27c3de6b33f45600498d1fd0e3995cd
5
5
  SHA512:
6
- metadata.gz: da505f0712967cd337b43aa37b728e1d3f33fbd289e48e8c878bde70d1353fd037b546f2ee20df978711bd02820c9cfa5c51ebbe52da7881340a41ba359ca0a6
7
- data.tar.gz: bcccf4281df69f6fa723b44c5964bc509681b587c17c32593fb70c2cce8149418a367175c159c091dd19cc0d34397f45adf19b563788106a7755c9c3c6a21de0
6
+ metadata.gz: 9f1991df25a5b8feefde4a13ad844c5a112fb2e8459b62ffa7f51c99694f30fa6285355ba92708a70cc2efed58ab499f12a6eb00487983e077654cee4051cee0
7
+ data.tar.gz: 72530855f775bdc9d7c21595b88764c007789e5c353f5f33eb69355aeecce891974b42d4ba5c3d034cee7818e8570982a257e0d25eb102bcca18e40b385141a1
data/lib/posting_zon.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에서 샌드박스 모드를 비활성화합니다.
@@ -144,7 +141,6 @@ class Naver
144
141
  end
145
142
  end
146
143
 
147
-
148
144
 
149
145
 
150
146
  def login(proxy)
@@ -8652,10 +8648,15 @@ class Wordpress
8652
8648
 
8653
8649
  @captcha_key = captcha_key
8654
8650
  begin
8655
- Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
8656
- @driver = Selenium::WebDriver.for :chrome
8651
+ capabilities = [options]
8652
+
8653
+ # 드라이버 초기화 (capabilities 사용)
8654
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
8657
8655
  rescue
8658
- @driver = Selenium::WebDriver.for :chrome
8656
+ capabilities = [options]
8657
+
8658
+ # 드라이버 초기화 (capabilities 사용)
8659
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
8659
8660
  end
8660
8661
  end
8661
8662
 
@@ -10381,18 +10382,33 @@ class Wordpress
10381
10382
  }
10382
10383
  button('   폴더째로 불러오기   '){
10383
10384
  stretchy false
10384
- on_clicked{
10385
- path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')
10386
- Dir.entries(@data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')).each do |file|
10387
- if file == '.' or file == '..'
10385
+ on_clicked {
10386
+ path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')
10388
10387
 
10389
- else
10390
- file_data = File.open(path+'/'+file,'r', :encoding => 'utf-8').read()
10391
- @data['내용설정']['내용'] << [false, file, file_data]
10388
+ # 경로가 유효한지 확인
10389
+ if Dir.exist?(path)
10390
+ Dir.entries(path).each do |file|
10391
+ if file == '.' or file == '..'
10392
+ next
10393
+ else
10394
+ begin
10395
+ # 파일을 열고 내용을 읽어서 추가
10396
+ file_data = File.open(path + '/' + file, 'r', encoding: 'utf-8').read
10397
+ @data['내용설정']['내용'] << [false, file, file_data]
10398
+ rescue => e
10399
+ # 파일을 열 수 없는 경우, 오류 메시지 출력
10400
+ puts "파일을 열 수 없습니다: #{file}, 오류: #{e.message}"
10401
+ end
10402
+ end
10392
10403
  end
10404
+
10405
+ # 내용 배열에서 마지막 빈 항목 제거
10406
+ @data['내용설정']['내용'] << []
10407
+ @data['내용설정']['내용'].pop
10408
+ else
10409
+ # 경로가 유효하지 않을 경우, 오류 메시지 출력
10410
+ puts "경로가 존재하지 않습니다: #{path}"
10393
10411
  end
10394
- @data['내용설정']['내용'] << []
10395
- @data['내용설정']['내용'].pop
10396
10412
  }
10397
10413
  }
10398
10414
  }
@@ -10479,17 +10495,27 @@ class Wordpress
10479
10495
  }
10480
10496
  button('폴더째로불러오기'){
10481
10497
  stretchy false
10482
- on_clicked{
10483
- path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')
10484
- Dir.entries(@data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')).each do |file|
10485
- if file == '.' or file == '..'
10498
+ on_clicked {
10499
+ path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')
10486
10500
 
10487
- else
10488
- @data['이미지설정']['이미지'] << [false, file, path+"\\"+file.force_encoding('utf-8')]
10501
+ # 경로가 유효한지 확인
10502
+ if Dir.exist?(path)
10503
+ Dir.entries(path).each do |file|
10504
+ if file == '.' or file == '..'
10505
+ next
10506
+ else
10507
+ # 폴더 내의 파일을 이미지 리스트에 추가
10508
+ @data['이미지설정']['이미지'] << [false, file, path + "\\" + file.force_encoding('utf-8')]
10509
+ end
10489
10510
  end
10511
+
10512
+ # 마지막 빈 항목 추가 후 제거 (원래 로직에 맞춰)
10513
+ @data['이미지설정']['이미지'] << []
10514
+ @data['이미지설정']['이미지'].pop
10515
+ else
10516
+ # 경로가 존재하지 않으면 경고 메시지 출력
10517
+ puts "경로가 존재하지 않습니다: #{path}"
10490
10518
  end
10491
- @data['이미지설정']['이미지'] << []
10492
- @data['이미지설정']['이미지'].pop
10493
10519
  }
10494
10520
  }
10495
10521
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posting_zon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon