cafe_basics 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.
- checksums.yaml +4 -4
- data/lib/cafe_basics.rb +34 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 365dcae1ab571d2bf457915d86cf4fd15be440154b45619cf3a75e927adbec72
|
4
|
+
data.tar.gz: 8fb8c85f280a1d08448538ec79498e8081d2baa93fa98e15ceb16e08fdf9e050
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3ef08f5f88837c6b432b95cdd1282d2bb29c35b166bc39887cc0d07da1724284d899b4c4e18c100277171723ef1408ae8e982dbd01dc9a28cc3165c4340efac
|
7
|
+
data.tar.gz: b8d8cfa4946333350c6dc1a4c01b80e0ef671e142bbf61570f3cc16b1b27b216e793b9f4bb52f6bf321eb6d98df644bbdf1b39256fffeb1ffd1ead0cc75f2e67
|
data/lib/cafe_basics.rb
CHANGED
@@ -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
|
@@ -2933,11 +2926,42 @@ class Wordpress
|
|
2933
2926
|
end
|
2934
2927
|
end
|
2935
2928
|
|
2929
|
+
#if @data['포스트설정']['지도로변경'].checked?
|
2930
|
+
# @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
|
2931
|
+
# content = content.split(i.force_encoding('utf-8')).join("<koreamap>"+@data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+"</koreamap>")
|
2932
|
+
# end
|
2933
|
+
#end
|
2936
2934
|
if @data['포스트설정']['지도로변경'].checked?
|
2937
|
-
|
2938
|
-
|
2935
|
+
# 지도 주소와 사용자 설정 단어들을 가져옵니다.
|
2936
|
+
map_address = @data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8')
|
2937
|
+
|
2938
|
+
# 여러 단어로 설정된 '지도로변경단어'를 분리하여 배열로 저장
|
2939
|
+
change_words = @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',')
|
2940
|
+
|
2941
|
+
# content를 각 줄로 분할
|
2942
|
+
content_lines = content.split("\n")
|
2943
|
+
|
2944
|
+
content_lines.each_with_index do |line, index|
|
2945
|
+
# 각 단어에 대해 처리
|
2946
|
+
change_words.each do |change_word|
|
2947
|
+
# 'change_word'가 포함된 줄에 대해서만 처리
|
2948
|
+
if line.include?(change_word)
|
2949
|
+
# 설정된 단어 뒤에 괄호가 있는지 확인
|
2950
|
+
if line.include?("[") && line.include?("]")
|
2951
|
+
# 괄호 안의 주소를 찾아서 그 주소는 그대로 두고, 지도로 변경된 주소로 교체
|
2952
|
+
address_in_brackets = line.match(/\[(.*?)\]/)[1] # 괄호 안의 주소를 추출
|
2953
|
+
content_lines[index] = "<koreamap>#{address_in_brackets}</koreamap>"
|
2954
|
+
else
|
2955
|
+
# 괄호가 없다면 @data['포스트설정']['지도주소']를 추가
|
2956
|
+
content_lines[index] = "<koreamap>#{map_address}</koreamap>"
|
2957
|
+
end
|
2958
|
+
end
|
2959
|
+
end
|
2939
2960
|
end
|
2940
|
-
|
2961
|
+
|
2962
|
+
# 다시 content로 합치기
|
2963
|
+
content = content_lines.join("\n")
|
2964
|
+
end
|
2941
2965
|
|
2942
2966
|
if @data['포스트설정']['인용구변경'].checked?
|
2943
2967
|
if @data['포스트설정']['인용구문구설정'].checked?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cafe_basics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
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-
|
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
|