nblog_duo 0.0.65 → 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 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f471b3aaa413eed22f426de8a72f2a9e06d82a5b3deeba27d15b1dee2f7e26b0
4
- data.tar.gz: dd5fc466d2782c1e0f409c1ac2d81949e4db0bbb5496158717a5c8946a921e57
3
+ metadata.gz: 32be681d6aa2c5ea7f576ee6a65a2743432ac7556eb7a689cbfeb91756f83c94
4
+ data.tar.gz: a568440813e460a2fd872a7d42add1edf779df54a009f0627ad1fbc6ef8e13a1
5
5
  SHA512:
6
- metadata.gz: bc4c4264f4632ec38686b6cfbecf7797cf74790cc1aede5bb0b8912a38236fc59e2755b3188fd5b7e4a61578e35dee91dfdc769ba51e01a941a63bbaf517ea4e
7
- data.tar.gz: f6a84d15fb52e7669851f85564537b3e90225dcf4d0b4d83688546934b98ddd5cd0aed4061bcf192d04559278b82821b3a04848e7a1440d5782d326dbd1e4dd9
6
+ metadata.gz: 690967f42eb6c90231410f570d4769b7a1855b631f4080691d970592846bfb826a28f154e01cda9e5c46a56241dc87197bcbe52f02015eccfcc2db24e9f8a040
7
+ data.tar.gz: 1bcb4daa76ea1d8a89bf392b00c824d50809fd984f16f408c746a2c6986190d9174d7e7e510191269ac695cdf6b14cd5dcc21ba2b32f593ae65331fa143db3e3
data/lib/nblog_duo.rb CHANGED
@@ -3180,11 +3180,42 @@ class Wordpress
3180
3180
  end
3181
3181
  end
3182
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
3183
3188
  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>")
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
3186
3214
  end
3187
- end
3215
+
3216
+ # 다시 content로 합치기
3217
+ content = content_lines.join("\n")
3218
+ end
3188
3219
 
3189
3220
  if @data['포스트설정']['인용구변경'].checked?
3190
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.65
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