cafe_basics 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_basics.rb +34 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0fe5a5d5ee6e894d68e2b301aa35088f9063924b89396a4a58c0d65623bda0fd
4
- data.tar.gz: 3f8558ea077664664842394d1ea7fe6c16118da12ae50c34af2c8cf2ce4f4260
3
+ metadata.gz: 365dcae1ab571d2bf457915d86cf4fd15be440154b45619cf3a75e927adbec72
4
+ data.tar.gz: 8fb8c85f280a1d08448538ec79498e8081d2baa93fa98e15ceb16e08fdf9e050
5
5
  SHA512:
6
- metadata.gz: 9d6d134f6c03999bb13bf846f2f52586de33c20ceee846859fad61b5a3d66fdec2913b5e9fdcdcd836c419c5a74998262537517dbd1a1a1e206155b0d7531b5f
7
- data.tar.gz: ae48f86b04e8eb0016471f2848cca0066fbd749360e9ec976b1b943819255feeb385238e8cb1712247d9f0f60e29e936dc472a1bc77b535d2fa135fb8c6a0179
6
+ metadata.gz: d3ef08f5f88837c6b432b95cdd1282d2bb29c35b166bc39887cc0d07da1724284d899b4c4e18c100277171723ef1408ae8e982dbd01dc9a28cc3165c4340efac
7
+ data.tar.gz: b8d8cfa4946333350c6dc1a4c01b80e0ef671e142bbf61570f3cc16b1b27b216e793b9f4bb52f6bf321eb6d98df644bbdf1b39256fffeb1ffd1ead0cc75f2e67
data/lib/cafe_basics.rb CHANGED
@@ -2926,11 +2926,42 @@ class Wordpress
2926
2926
  end
2927
2927
  end
2928
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
2929
2934
  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>")
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
2932
2960
  end
2933
- end
2961
+
2962
+ # 다시 content로 합치기
2963
+ content = content_lines.join("\n")
2964
+ end
2934
2965
 
2935
2966
  if @data['포스트설정']['인용구변경'].checked?
2936
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.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