nblog_duo 0.0.63 → 0.0.67

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/nblog_duo.rb +34 -10
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 857e0fcb6a167f4547ed718eeff26da29c3506d4cc3e8b3e7291d60e6042b1a3
4
- data.tar.gz: 2082ea5537919d1ca80dd0148ffc0b943ab4f34a7a4910f469833d13132da11c
3
+ metadata.gz: 32be681d6aa2c5ea7f576ee6a65a2743432ac7556eb7a689cbfeb91756f83c94
4
+ data.tar.gz: a568440813e460a2fd872a7d42add1edf779df54a009f0627ad1fbc6ef8e13a1
5
5
  SHA512:
6
- metadata.gz: 8407a60ca79af5af2c4dee652ca5e2037e1520a05a7cf0547aff0cd338e0ef40a9fc705373b26451a1b05ab77c7a8ef3857428dc0524ac8fd58bc5b925ec3f49
7
- data.tar.gz: f2c7d5bd694791756aadc7dc992e2c084db5362c0212a709af5a3cfb91d2819df7a9eaf384ee5a060f6723eb8de9e2eb52f1431f06015576a39566e47b2966e2
6
+ metadata.gz: 690967f42eb6c90231410f570d4769b7a1855b631f4080691d970592846bfb826a28f154e01cda9e5c46a56241dc87197bcbe52f02015eccfcc2db24e9f8a040
7
+ data.tar.gz: 1bcb4daa76ea1d8a89bf392b00c824d50809fd984f16f408c746a2c6986190d9174d7e7e510191269ac695cdf6b14cd5dcc21ba2b32f593ae65331fa143db3e3
data/lib/nblog_duo.rb CHANGED
@@ -230,8 +230,6 @@ class Naver
230
230
  options.add_argument('--disable-gpu')
231
231
  options.add_argument('--remote-debugging-port=9222')
232
232
  options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
233
- options.add_argument('--disable-blink-features=AutomationControlled') # JavaScript로 navigator.webdriver 숨기기
234
-
235
233
  # 'capabilities'과 'options' 배열로 설정
236
234
  capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
237
235
  capabilities["goog:chromeOptions"] = options.as_json
@@ -258,9 +256,6 @@ class Naver
258
256
  options.add_argument('--disable-gpu')
259
257
  options.add_argument('--remote-debugging-port=9222')
260
258
  options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
261
-
262
- options.add_argument('--disable-blink-features=AutomationControlled') # JavaScript로 navigator.webdriver 숨기기
263
-
264
259
  # 'capabilities'과 'options' 배열로 설정
265
260
  capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
266
261
  capabilities["goog:chromeOptions"] = options.as_json
@@ -284,8 +279,6 @@ class Naver
284
279
  options.add_argument('--disable-gpu')
285
280
  options.add_argument('--remote-debugging-port=9222')
286
281
  options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
287
- options.add_argument('--disable-blink-features=AutomationControlled') # JavaScript로 navigator.webdriver 숨기기
288
-
289
282
  # 'capabilities'과 'options' 배열로 설정
290
283
  capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
291
284
  capabilities["goog:chromeOptions"] = options.as_json
@@ -3187,11 +3180,42 @@ class Wordpress
3187
3180
  end
3188
3181
  end
3189
3182
 
3183
+ #if @data['포스트설정']['지도로변경'].checked?
3184
+ # @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
3185
+ # content = content.split(i.force_encoding('utf-8')).join("<koreamap>"+@data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+"</koreamap>")
3186
+ # end
3187
+ #end
3190
3188
  if @data['포스트설정']['지도로변경'].checked?
3191
- @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
3192
- content = content.split(i.force_encoding('utf-8')).join("<koreamap>"+@data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+"</koreamap>")
3189
+ # 지도 주소와 사용자 설정 단어들을 가져옵니다.
3190
+ map_address = @data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8')
3191
+
3192
+ # 여러 단어로 설정된 '지도로변경단어'를 분리하여 배열로 저장
3193
+ change_words = @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',')
3194
+
3195
+ # content를 각 줄로 분할
3196
+ content_lines = content.split("\n")
3197
+
3198
+ content_lines.each_with_index do |line, index|
3199
+ # 각 단어에 대해 처리
3200
+ change_words.each do |change_word|
3201
+ # 'change_word'가 포함된 줄에 대해서만 처리
3202
+ if line.include?(change_word)
3203
+ # 설정된 단어 뒤에 괄호가 있는지 확인
3204
+ if line.include?("[") && line.include?("]")
3205
+ # 괄호 안의 주소를 찾아서 그 주소는 그대로 두고, 지도로 변경된 주소로 교체
3206
+ address_in_brackets = line.match(/\[(.*?)\]/)[1] # 괄호 안의 주소를 추출
3207
+ content_lines[index] = "<koreamap>#{address_in_brackets}</koreamap>"
3208
+ else
3209
+ # 괄호가 없다면 @data['포스트설정']['지도주소']를 추가
3210
+ content_lines[index] = "<koreamap>#{map_address}</koreamap>"
3211
+ end
3212
+ end
3213
+ end
3193
3214
  end
3194
- end
3215
+
3216
+ # 다시 content로 합치기
3217
+ content = content_lines.join("\n")
3218
+ end
3195
3219
 
3196
3220
  if @data['포스트설정']['인용구변경'].checked?
3197
3221
  if @data['포스트설정']['인용구문구설정'].checked?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nblog_duo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.63
4
+ version: 0.0.67
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