nblog_zon 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_zon.rb +34 -10
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ca36b0fe8b268337d4c28ec3dc35522a87c41cbfc933c14be07cd376e1650c8
4
- data.tar.gz: c33148e61f13e5a174795f005e76668c05e2faa40241c2cc37cbad7301b41ece
3
+ metadata.gz: ec86b6aa062283df60959225666f4a40b670e20bab4b19d975b0dcaa22e58bfa
4
+ data.tar.gz: 456d60dca768623caf8b7a72d56ad45afe387129736e71b3968c2d36743a15bb
5
5
  SHA512:
6
- metadata.gz: 614b7e0ba725ad4a4d3461d97ca81fad1381576cf48dde835192e3c9cfa0cf203817ed0a39bed55b2e11261f78b04b2428e99f336ab0ff22340a565e1fea2861
7
- data.tar.gz: 912194165b3216b3a2d87cfc2bfc1fb2a4cbd73ac2ab2c37f776be84661a8797964911425fa5d25fa21c8ba7f824c4aef867e99aa76f9b95bacd49e559d9631d
6
+ metadata.gz: 9608a0376cac1e0f037faac07881f3d218261a39cee45f9f998c9b0b06bb940687b56ad30e0a9e7965f9e0ba8710d4be9ab15dfcd3f9c556d59bebe25ee01215
7
+ data.tar.gz: 2fe95554265109c57b12a2523f7bea07dd7f9a3189fb14fe15415cd8006332d5445b5ff541df8fc06acce50a748dd64a6aa3827d3f075517f3aac53e3549a66e
data/lib/nblog_zon.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
@@ -3121,11 +3114,42 @@ class Wordpress
3121
3114
  end
3122
3115
  end
3123
3116
 
3117
+ #if @data['포스트설정']['지도로변경'].checked?
3118
+ # @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
3119
+ # content = content.split(i.force_encoding('utf-8')).join("<koreamap>"+@data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+"</koreamap>")
3120
+ # end
3121
+ #end
3124
3122
  if @data['포스트설정']['지도로변경'].checked?
3125
- @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
3126
- content = content.split(i.force_encoding('utf-8')).join("<koreamap>"+@data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+"</koreamap>")
3123
+ # 지도 주소와 사용자 설정 단어들을 가져옵니다.
3124
+ map_address = @data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8')
3125
+
3126
+ # 여러 단어로 설정된 '지도로변경단어'를 분리하여 배열로 저장
3127
+ change_words = @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',')
3128
+
3129
+ # content를 각 줄로 분할
3130
+ content_lines = content.split("\n")
3131
+
3132
+ content_lines.each_with_index do |line, index|
3133
+ # 각 단어에 대해 처리
3134
+ change_words.each do |change_word|
3135
+ # 'change_word'가 포함된 줄에 대해서만 처리
3136
+ if line.include?(change_word)
3137
+ # 설정된 단어 뒤에 괄호가 있는지 확인
3138
+ if line.include?("[") && line.include?("]")
3139
+ # 괄호 안의 주소를 찾아서 그 주소는 그대로 두고, 지도로 변경된 주소로 교체
3140
+ address_in_brackets = line.match(/\[(.*?)\]/)[1] # 괄호 안의 주소를 추출
3141
+ content_lines[index] = "<koreamap>#{address_in_brackets}</koreamap>"
3142
+ else
3143
+ # 괄호가 없다면 @data['포스트설정']['지도주소']를 추가
3144
+ content_lines[index] = "<koreamap>#{map_address}</koreamap>"
3145
+ end
3146
+ end
3147
+ end
3127
3148
  end
3128
- end
3149
+
3150
+ # 다시 content로 합치기
3151
+ content = content_lines.join("\n")
3152
+ end
3129
3153
 
3130
3154
  if @data['포스트설정']['인용구변경'].checked?
3131
3155
  if @data['포스트설정']['인용구문구설정'].checked?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nblog_zon
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: rnjstnswp123@naver.com