cafe_buy_duo 0.1.55 → 0.1.57

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/cafe_buy_duo.rb +21 -13
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e3fa15289ffaa9e4d4a8e63f5265686f3140e018031382cf339e18aca728701
4
- data.tar.gz: 71c0e1f53c2ad1ea7dd7dbf6d303065b820bfa2200d702a6e4e229974f5403d9
3
+ metadata.gz: daca90772351291588281982417819cb4c4495f75ad006913fb381ee769f286b
4
+ data.tar.gz: 7ea28b1ff196b6711218a1f2c24c91db54c759f45f54acdaab029b41e8b03c4e
5
5
  SHA512:
6
- metadata.gz: 3a2485806831d6e4b6c22a4bd4afd8875c88d33a386854adbf509c46b4c03e9817fb5f55cd8b819f75e9aad41bce307c5d37930bc19c226edc3258caae38375b
7
- data.tar.gz: dea6ecf9bbd2dff434404cb0716ac613e681c6cfd020d909775a7a41bec335e91b1b86708f162d288f3d428403feee33b176bb1ef3377f29fdc2c46c27f1ccb0
6
+ metadata.gz: 036ce7d7b170cbb50be5dc18dbaac10763bebdb1ad771facc40c56bea1122295c38a5abef6638a7e1d75a4baf10144001ee47731f658a4b99d8a38dc497cbc1d
7
+ data.tar.gz: 97a251307074658c0507fcfddfe42111105df0bc78ce6408e41079b4f739f15564824101be36fea341129ea4c460323b44b343ebe11304a6d470a5fd0a08278c
data/lib/cafe_buy_duo.rb CHANGED
@@ -511,19 +511,29 @@ class Naver
511
511
  begin
512
512
  wait = Selenium::WebDriver::Wait.new(:timeout => 7)
513
513
  #요소가 나타날 때까지 3초 동안 기다립니다.
514
- wait.until { @driver.find_element(:xpath, '//*[@for="switch"]') }
515
- sleep(1.5)
516
- @driver.find_element(:xpath, '//*[@id="login_keep_wrap"]/div[1]/label').click
517
- sleep(1.5)
518
- @driver.find_element(:xpath, '//*[@id="id"]').click
514
+ wait.until { @driver.find_element(:xpath, '//*[@id="id" and @name="id"]') }
515
+ @driver.find_element(:xpath, '//*[@id="id" and @name="id"]').click
519
516
  Clipboard.copy(user_id)
520
517
  @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
521
518
  sleep(1.5)
522
- @driver.find_element(:xpath, '//*[@id="pw"]').click
519
+ @driver.find_element(:xpath, '//*[@id="pw" and @name="pw"]').click
523
520
  Clipboard.copy(user_pw)
524
521
  @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
525
522
  sleep(1.5)
526
- @driver.find_element(:xpath, '//*[@id="log.login"]').click
523
+
524
+ begin
525
+ smart_level_value = @driver.find_element(id: 'smart_LEVEL').attribute('value')
526
+ if smart_level_value == '1'
527
+ @driver.find_element(xpath: '//label[@for="switch" and @class="switch_btn"]').click
528
+ sleep(1.5)
529
+ end
530
+ rescue
531
+ end
532
+
533
+ wait = Selenium::WebDriver::Wait.new(:timeout => 3)
534
+ #요소가 나타날 때까지 3초 동안 기다립니다.
535
+ wait.until { @driver.find_element(xpath: '//button[@type="submit" and @id="log.login"]') }
536
+ @driver.find_element(xpath: '//button[@type="submit" and @id="log.login"]').click
527
537
  sleep(2.5)
528
538
  rescue => e
529
539
  puts '-[√] 로딩 지연 접속 실패.......'.red
@@ -536,9 +546,8 @@ class Naver
536
546
  puts "Failed to close tab: #{e.message}"
537
547
  end
538
548
  end
539
- @driver.quit
540
549
  return 0
541
-
550
+ @driver.quit
542
551
  end
543
552
 
544
553
  else
@@ -546,9 +555,9 @@ class Naver
546
555
  end
547
556
 
548
557
  begin
549
- wait = Selenium::WebDriver::Wait.new(:timeout => 3)
558
+ wait = Selenium::WebDriver::Wait.new(:timeout => 5)
550
559
  #요소가 나타날 때까지 3초 동안 기다립니다.
551
- wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__btn_logout___bsTOJ"]') }
560
+ wait.until { @driver.find_element(:xpath, '//*[@type="button" and @class="MyView-module__btn_logout___bsTOJ"]') }
552
561
 
553
562
  rescue => e
554
563
  puts '-[√] 로그인 실패.......'.red
@@ -561,9 +570,8 @@ class Naver
561
570
  puts "Failed to close tab: #{e.message}"
562
571
  end
563
572
  end
564
- @driver.quit
565
573
  return 0
566
-
574
+ @driver.quit
567
575
  end
568
576
  end
569
577
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cafe_buy_duo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.55
4
+ version: 0.1.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-02 00:00:00.000000000 Z
10
+ date: 2025-07-08 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: File to Clipboard gem
13
13
  email: mymin26@naver.com