cafe_buy 0.0.52 → 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_buy.rb +34 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efbc4b4e45298013009cd3a0b31195f99b600463d5279a52bebb685cc7e2564b
4
- data.tar.gz: f021766606e2257cd0a530fbcda82cf350be7de39a2c1d8cf2d20a000596dab3
3
+ metadata.gz: e540cc3f1a8bf05f04c1512909e670d9e12efe2165cbd4f57eb8b32e85674155
4
+ data.tar.gz: 59746495659750b93390306e1ebed84b3016402de73dfd721fce20a03ae577c7
5
5
  SHA512:
6
- metadata.gz: 2bc97468512d281716c3eaece0f6087f9ac61e3e823a2ade963e793fc369a6dbc7f537e8536f4b6888537d8f9bcaf0863927104e9e692cf0090244895c18f3d8
7
- data.tar.gz: 15134f6e2d2e0a0b96c522a8303e07c5db49d0ef32b9a5a28bb4957674bfba4646ed300452a958ff65618bb8fc0a18bd699fe4d59588419c8f98b22dbc9cae92
6
+ metadata.gz: e1b31d49952fb0af962ffe5d7769ab146d02ed2367c93f25dae0ab5eeb35a805aa6e2a994834e04bea8d076a4ecf41bc1225ffcadc6f7f73fb3f498083118e5d
7
+ data.tar.gz: 8195c729713e9e4099d8389098a3f942611ba3eed135e721c0b6a35875d40b1bc64fa5e475fc9fcf1a931962eca042d679c74b917e39f4c79337ad9f0afc7726
data/lib/cafe_buy.rb CHANGED
@@ -3251,11 +3251,42 @@ class Wordpress
3251
3251
  end
3252
3252
  end
3253
3253
 
3254
+ #if @data['포스트설정']['지도로변경'].checked?
3255
+ # @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
3256
+ # content = content.split(i.force_encoding('utf-8')).join("<koreamap>"+@data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+"</koreamap>")
3257
+ # end
3258
+ #end
3254
3259
  if @data['포스트설정']['지도로변경'].checked?
3255
- @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
3256
- content = content.split(i.force_encoding('utf-8')).join("<koreamap>"+@data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+"</koreamap>")
3260
+ # 지도 주소와 사용자 설정 단어들을 가져옵니다.
3261
+ map_address = @data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8')
3262
+
3263
+ # 여러 단어로 설정된 '지도로변경단어'를 분리하여 배열로 저장
3264
+ change_words = @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',')
3265
+
3266
+ # content를 각 줄로 분할
3267
+ content_lines = content.split("\n")
3268
+
3269
+ content_lines.each_with_index do |line, index|
3270
+ # 각 단어에 대해 처리
3271
+ change_words.each do |change_word|
3272
+ # 'change_word'가 포함된 줄에 대해서만 처리
3273
+ if line.include?(change_word)
3274
+ # 설정된 단어 뒤에 괄호가 있는지 확인
3275
+ if line.include?("[") && line.include?("]")
3276
+ # 괄호 안의 주소를 찾아서 그 주소는 그대로 두고, 지도로 변경된 주소로 교체
3277
+ address_in_brackets = line.match(/\[(.*?)\]/)[1] # 괄호 안의 주소를 추출
3278
+ content_lines[index] = "<koreamap>#{address_in_brackets}</koreamap>"
3279
+ else
3280
+ # 괄호가 없다면 @data['포스트설정']['지도주소']를 추가
3281
+ content_lines[index] = "<koreamap>#{map_address}</koreamap>"
3282
+ end
3283
+ end
3284
+ end
3257
3285
  end
3258
- end
3286
+
3287
+ # 다시 content로 합치기
3288
+ content = content_lines.join("\n")
3289
+ end
3259
3290
 
3260
3291
  if @data['포스트설정']['인용구변경'].checked?
3261
3292
  if @data['포스트설정']['인용구문구설정'].checked?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cafe_buy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.52
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