nblog_duo 111.120.003 → 111.120.005
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/nblog_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: 76def0a49a36e9251c9be08af5f3843cd22d35f2c7a27d0e0fa837194db92236
|
4
|
+
data.tar.gz: bf3f94327a2caf50bcb23db5d8e0cb716fab3de4cf3353b0099eff415cf77881
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f30e1f0db3dcc850b995fb23c2ef46b74ebea34b46bccf1e3fed174a87e5ce47b93e2a70adda736aeaa8312401f5415b8272c95db8b338625f303978b52a6850
|
7
|
+
data.tar.gz: 2c709f923361390f2391b1b5668370ba5e44d5532232d5c2aa1b21e11287affb7bf13cb5250942b8b5010cd35cef12cd86ed5e014d55a64dd53f9e4964f0b65b
|
data/lib/nblog_duo.rb
CHANGED
@@ -3951,15 +3951,34 @@ class Wordpress
|
|
3951
3951
|
# title = content.split("\n")[0]
|
3952
3952
|
#end
|
3953
3953
|
if @data['포스트설정']['내용첫줄제목에입력'].checked?
|
3954
|
-
# 콘텐츠를 줄 단위로 분리
|
3955
3954
|
content_lines = content.split("\n")
|
3956
|
-
|
3957
|
-
|
3958
|
-
|
3959
|
-
|
3960
|
-
|
3961
|
-
|
3962
|
-
|
3955
|
+
|
3956
|
+
title = content_lines.find do |line|
|
3957
|
+
line = line.strip
|
3958
|
+
!line.empty? && !line.start_with?('<img src=')
|
3959
|
+
end
|
3960
|
+
|
3961
|
+
title ||= content_lines[1]
|
3962
|
+
|
3963
|
+
if title
|
3964
|
+
# 마침표(.) 포함 첫 문장 추출
|
3965
|
+
first_part = title[/.*?\./]
|
3966
|
+
first_part = first_part ? first_part.strip : title.strip
|
3967
|
+
|
3968
|
+
# 200bytes 제한 (한글 100자 내외)
|
3969
|
+
bytes_limit = 200
|
3970
|
+
truncated = ""
|
3971
|
+
current_bytes = 0
|
3972
|
+
|
3973
|
+
first_part.each_char do |char|
|
3974
|
+
char_bytes = char.bytesize
|
3975
|
+
break if current_bytes + char_bytes > bytes_limit
|
3976
|
+
truncated << char
|
3977
|
+
current_bytes += char_bytes
|
3978
|
+
end
|
3979
|
+
|
3980
|
+
title = truncated
|
3981
|
+
end
|
3963
3982
|
end
|
3964
3983
|
|
3965
3984
|
if @data['포스트설정']['제목을내용첫줄입력'].checked?
|
@@ -3992,6 +4011,25 @@ class Wordpress
|
|
3992
4011
|
@data['table'] << []
|
3993
4012
|
@data['table'].pop
|
3994
4013
|
|
4014
|
+
# content를 줄 단위로 쪼갬
|
4015
|
+
lines = content.lines
|
4016
|
+
|
4017
|
+
# 맨 앞부터 빈 줄(공백 또는 빈 문자열) 갯수 계산
|
4018
|
+
empty_line_count = 0
|
4019
|
+
lines.each do |line|
|
4020
|
+
if line.strip.empty?
|
4021
|
+
empty_line_count += 1
|
4022
|
+
else
|
4023
|
+
break
|
4024
|
+
end
|
4025
|
+
end
|
4026
|
+
|
4027
|
+
# 앞 빈 줄 제거
|
4028
|
+
lines = lines.drop(empty_line_count)
|
4029
|
+
|
4030
|
+
# 다시 content로 합침
|
4031
|
+
content = lines.join
|
4032
|
+
|
3995
4033
|
dd_time = @data['table'][index][10].to_s.force_encoding('utf-8').to_i
|
3996
4034
|
#template_no = @data['table'][index][7].to_s.force_encoding('utf-8').to_i
|
3997
4035
|
naver.update(title,content,option,soosick_1,soosick_2, dd_time)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nblog_duo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 111.120.
|
4
|
+
version: 111.120.005
|
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
|