cafe_basics_duo 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_basics_duo.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: 254da32d83fd097f8d5ae9e26d4c3c306c4afbfbbe37f6e57a8529a577cf202f
|
4
|
+
data.tar.gz: c6d2b84d4404ed78ab26a0e5e892d5b45422c94876223d85e2fdfde8dd9749cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22a2b190f6907f9030b9ba07d68297b2c56725b9f42c65273479ba47765e96adc4ce8789306f5bc493c4b90fe51dc4cabe84524a573df4aad294f5b01a26e0cc
|
7
|
+
data.tar.gz: df99d99bcf10e80010526e0e0a0fb3abe361930114f17af054c30cf7dbdbdd04d971952d0eb4204d38a28de77e4ac1023e5d3cda4a316dbbf6342f13d8867b59
|
data/lib/cafe_basics_duo.rb
CHANGED
@@ -3621,15 +3621,34 @@ class Wordpress
|
|
3621
3621
|
# title = content.split("\n")[0]
|
3622
3622
|
#end
|
3623
3623
|
if @data['포스트설정']['내용첫줄제목에입력'].checked?
|
3624
|
-
# 콘텐츠를 줄 단위로 분리
|
3625
3624
|
content_lines = content.split("\n")
|
3626
|
-
|
3627
|
-
|
3628
|
-
|
3629
|
-
|
3630
|
-
|
3631
|
-
|
3632
|
-
|
3625
|
+
|
3626
|
+
title = content_lines.find do |line|
|
3627
|
+
line = line.strip
|
3628
|
+
!line.empty? && !line.start_with?('<img src=')
|
3629
|
+
end
|
3630
|
+
|
3631
|
+
title ||= content_lines[1]
|
3632
|
+
|
3633
|
+
if title
|
3634
|
+
# 마침표(.) 포함 첫 문장 추출
|
3635
|
+
first_part = title[/.*?\./]
|
3636
|
+
first_part = first_part ? first_part.strip : title.strip
|
3637
|
+
|
3638
|
+
# 200bytes 제한 (한글 100자 내외)
|
3639
|
+
bytes_limit = 200
|
3640
|
+
truncated = ""
|
3641
|
+
current_bytes = 0
|
3642
|
+
|
3643
|
+
first_part.each_char do |char|
|
3644
|
+
char_bytes = char.bytesize
|
3645
|
+
break if current_bytes + char_bytes > bytes_limit
|
3646
|
+
truncated << char
|
3647
|
+
current_bytes += char_bytes
|
3648
|
+
end
|
3649
|
+
|
3650
|
+
title = truncated
|
3651
|
+
end
|
3633
3652
|
end
|
3634
3653
|
|
3635
3654
|
if @data['포스트설정']['제목을내용첫줄입력'].checked?
|
@@ -3653,6 +3672,25 @@ class Wordpress
|
|
3653
3672
|
@data['table'] << []
|
3654
3673
|
@data['table'].pop
|
3655
3674
|
|
3675
|
+
# content를 줄 단위로 쪼갬
|
3676
|
+
lines = content.lines
|
3677
|
+
|
3678
|
+
# 맨 앞부터 빈 줄(공백 또는 빈 문자열) 갯수 계산
|
3679
|
+
empty_line_count = 0
|
3680
|
+
lines.each do |line|
|
3681
|
+
if line.strip.empty?
|
3682
|
+
empty_line_count += 1
|
3683
|
+
else
|
3684
|
+
break
|
3685
|
+
end
|
3686
|
+
end
|
3687
|
+
|
3688
|
+
# 앞 빈 줄 제거
|
3689
|
+
lines = lines.drop(empty_line_count)
|
3690
|
+
|
3691
|
+
# 다시 content로 합침
|
3692
|
+
content = lines.join
|
3693
|
+
|
3656
3694
|
p option
|
3657
3695
|
|
3658
3696
|
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_basics_duo
|
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
|