cafe_basics_duo 0.0.51 → 0.0.53

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_basics_duo.rb +34 -10
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d5adc1d0918824e0d5cadaf746e8eaab19c627bed0ab07ff45bd42e2e631dc8
4
- data.tar.gz: 1a7b5ae5b17be69abad640e976df60a459d233c93d5af0d952dd7ab1ac8946ac
3
+ metadata.gz: 93723a984d0dccded52d2a5f1e663692f89062c6b15c1b667d3c32fc8a5b4022
4
+ data.tar.gz: acf5a7fe88855c2f2538c0068fc9dee5fbfa981f152ac51a1618adfa2249007f
5
5
  SHA512:
6
- metadata.gz: 2facbd7fc6a988a5a0d420f4afdf286ff76e3e59e07ca8d39ab385ef4552cc468ecdc864b2152aab8e43b34d19ef2a7ff8014d4ba8d7e2b810d0f4eafca176f7
7
- data.tar.gz: e42dad0a696418eb8584e5c3b5dead7189b85875f29e35e33b6f66b63a767c8a18e9ba1c2adf44c53484c51dc005bcf62ce12b346476850813d41dfb36765317
6
+ metadata.gz: b7fd209d32b72669184dfe546b78adf8d9b69c5749e56f915c0a49d6126e48dbf2967612f4bb0eb1a258a512fd31abd78f0df37ce74fc1b2b01cd1e49d84590e
7
+ data.tar.gz: ef047638a5089b6d4e6ed4a5eb440e1716002f6b3ff7f698e9af338e200485052ffdb1850f2b70a44a7ad0388f0f55fb7d86cd3e11bcd3dde9cff2542ae91904
@@ -235,8 +235,6 @@ class Naver
235
235
  options.add_argument('--disable-gpu')
236
236
  options.add_argument('--remote-debugging-port=9222')
237
237
  options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
238
- options.add_argument('--disable-blink-features=AutomationControlled') # JavaScript로 navigator.webdriver 숨기기
239
-
240
238
  # 'capabilities'과 'options' 배열로 설정
241
239
  capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
242
240
  capabilities["goog:chromeOptions"] = options.as_json
@@ -263,9 +261,6 @@ class Naver
263
261
  options.add_argument('--disable-gpu')
264
262
  options.add_argument('--remote-debugging-port=9222')
265
263
  options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
266
-
267
- options.add_argument('--disable-blink-features=AutomationControlled') # JavaScript로 navigator.webdriver 숨기기
268
-
269
264
  # 'capabilities'과 'options' 배열로 설정
270
265
  capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
271
266
  capabilities["goog:chromeOptions"] = options.as_json
@@ -289,8 +284,6 @@ class Naver
289
284
  options.add_argument('--disable-gpu')
290
285
  options.add_argument('--remote-debugging-port=9222')
291
286
  options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
292
- options.add_argument('--disable-blink-features=AutomationControlled') # JavaScript로 navigator.webdriver 숨기기
293
-
294
287
  # 'capabilities'과 'options' 배열로 설정
295
288
  capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
296
289
  capabilities["goog:chromeOptions"] = options.as_json
@@ -3002,11 +2995,42 @@ class Wordpress
3002
2995
  end
3003
2996
  end
3004
2997
 
2998
+ #if @data['포스트설정']['지도로변경'].checked?
2999
+ # @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
3000
+ # content = content.split(i.force_encoding('utf-8')).join("<koreamap>"+@data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+"</koreamap>")
3001
+ # end
3002
+ #end
3005
3003
  if @data['포스트설정']['지도로변경'].checked?
3006
- @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
3007
- content = content.split(i.force_encoding('utf-8')).join("<koreamap>"+@data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+"</koreamap>")
3004
+ # 지도 주소와 사용자 설정 단어들을 가져옵니다.
3005
+ map_address = @data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8')
3006
+
3007
+ # 여러 단어로 설정된 '지도로변경단어'를 분리하여 배열로 저장
3008
+ change_words = @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',')
3009
+
3010
+ # content를 각 줄로 분할
3011
+ content_lines = content.split("\n")
3012
+
3013
+ content_lines.each_with_index do |line, index|
3014
+ # 각 단어에 대해 처리
3015
+ change_words.each do |change_word|
3016
+ # 'change_word'가 포함된 줄에 대해서만 처리
3017
+ if line.include?(change_word)
3018
+ # 설정된 단어 뒤에 괄호가 있는지 확인
3019
+ if line.include?("[") && line.include?("]")
3020
+ # 괄호 안의 주소를 찾아서 그 주소는 그대로 두고, 지도로 변경된 주소로 교체
3021
+ address_in_brackets = line.match(/\[(.*?)\]/)[1] # 괄호 안의 주소를 추출
3022
+ content_lines[index] = "<koreamap>#{address_in_brackets}</koreamap>"
3023
+ else
3024
+ # 괄호가 없다면 @data['포스트설정']['지도주소']를 추가
3025
+ content_lines[index] = "<koreamap>#{map_address}</koreamap>"
3026
+ end
3027
+ end
3028
+ end
3008
3029
  end
3009
- end
3030
+
3031
+ # 다시 content로 합치기
3032
+ content = content_lines.join("\n")
3033
+ end
3010
3034
 
3011
3035
  if @data['포스트설정']['인용구변경'].checked?
3012
3036
  if @data['포스트설정']['인용구문구설정'].checked?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cafe_basics_duo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.51
4
+ version: 0.0.53
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-10 00:00:00.000000000 Z
11
+ date: 2025-02-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: File to Clipboard gem
14
14
  email: mymin26@naver.com