cafe_buy 0.1.53 → 0.1.55
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.
- checksums.yaml +4 -4
- data/lib/cafe_buy.rb +46 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b14e8e371491f2be06f04ae67f13dd328dd42a46cc83e79d8690fca5e64009e
|
4
|
+
data.tar.gz: 5308a6bd4f2834e52cec5ed8c49cc441b6f7907f34e3a157ebbf09bd3e0d44e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9231706e9259d4d1c333cc6458ac55add55aaa90b03d85e7c736e32cc785544fbe8ffb00e22085bdf64b4e69dd900ae6382fb1559da82df608acb5910aa3ccfa
|
7
|
+
data.tar.gz: 30a6be435830890e10b4d59f8789bb5792ae5b42b161575af231ca1f4899b4fc127db69ae5f27756360948bc1383c1743a03ad0daecd159d5ae751f1717b3938
|
data/lib/cafe_buy.rb
CHANGED
@@ -3938,15 +3938,34 @@ class Wordpress
|
|
3938
3938
|
# title = content.split("\n")[0]
|
3939
3939
|
#end
|
3940
3940
|
if @data['포스트설정']['내용첫줄제목에입력'].checked?
|
3941
|
-
# 콘텐츠를 줄 단위로 분리
|
3942
3941
|
content_lines = content.split("\n")
|
3943
|
-
|
3944
|
-
|
3945
|
-
|
3946
|
-
|
3947
|
-
|
3948
|
-
|
3949
|
-
|
3942
|
+
|
3943
|
+
title = content_lines.find do |line|
|
3944
|
+
line = line.strip
|
3945
|
+
!line.empty? && !line.start_with?('<img src=')
|
3946
|
+
end
|
3947
|
+
|
3948
|
+
title ||= content_lines[1]
|
3949
|
+
|
3950
|
+
if title
|
3951
|
+
# 마침표(.) 포함 첫 문장 추출
|
3952
|
+
first_part = title[/.*?\./]
|
3953
|
+
first_part = first_part ? first_part.strip : title.strip
|
3954
|
+
|
3955
|
+
# 200bytes 제한 (한글 100자 내외)
|
3956
|
+
bytes_limit = 200
|
3957
|
+
truncated = ""
|
3958
|
+
current_bytes = 0
|
3959
|
+
|
3960
|
+
first_part.each_char do |char|
|
3961
|
+
char_bytes = char.bytesize
|
3962
|
+
break if current_bytes + char_bytes > bytes_limit
|
3963
|
+
truncated << char
|
3964
|
+
current_bytes += char_bytes
|
3965
|
+
end
|
3966
|
+
|
3967
|
+
title = truncated
|
3968
|
+
end
|
3950
3969
|
end
|
3951
3970
|
|
3952
3971
|
if @data['포스트설정']['제목을내용첫줄입력'].checked?
|
@@ -3970,6 +3989,25 @@ class Wordpress
|
|
3970
3989
|
@data['table'] << []
|
3971
3990
|
@data['table'].pop
|
3972
3991
|
|
3992
|
+
# content를 줄 단위로 쪼갬
|
3993
|
+
lines = content.lines
|
3994
|
+
|
3995
|
+
# 맨 앞부터 빈 줄(공백 또는 빈 문자열) 갯수 계산
|
3996
|
+
empty_line_count = 0
|
3997
|
+
lines.each do |line|
|
3998
|
+
if line.strip.empty?
|
3999
|
+
empty_line_count += 1
|
4000
|
+
else
|
4001
|
+
break
|
4002
|
+
end
|
4003
|
+
end
|
4004
|
+
|
4005
|
+
# 앞 빈 줄 제거
|
4006
|
+
lines = lines.drop(empty_line_count)
|
4007
|
+
|
4008
|
+
# 다시 content로 합침
|
4009
|
+
content = lines.join
|
4010
|
+
|
3973
4011
|
p option
|
3974
4012
|
|
3975
4013
|
dd_time = @data['table'][index][9].to_s.force_encoding('utf-8').to_i
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cafe_buy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.55
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-07-02 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: File to Clipboard gem
|
13
13
|
email: mymin26@naver.com
|