jekyll-chatgpt-translate 0.0.34 → 0.0.35
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 841ab37ebdb5e4049f301883bd5d3c411dbf7719824c52f8fa3f3604aebb0109
|
4
|
+
data.tar.gz: e553ef7cdf4564adba5128bf9bb7eea90c59f7724fa72986427a5e31e7bf2bb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9a6c85190c260ba4770691f4810cbe775f6ae3b2aafba67f5f0081fb540e2a86dc817ae65fccb857643e39d446e4c62b2a98dabe8ce43a46df8a6786ac59b1b
|
7
|
+
data.tar.gz: dba3c7a5bd214a8f970fa623d7dc46779928ddf334fa10f3ca42cfafb61f9a7fae580cd86ed0f11d55f1a08082e0f04eead95ab098481231940e94216cdacaa0
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
29
29
|
s.required_ruby_version = '>= 2.6'
|
30
30
|
s.name = 'jekyll-chatgpt-translate'
|
31
|
-
s.version = '0.0.
|
31
|
+
s.version = '0.0.35'
|
32
32
|
s.license = 'MIT'
|
33
33
|
s.summary = 'Translate Jekyll Pages Through ChatGPT'
|
34
34
|
s.description = [
|
@@ -52,7 +52,8 @@ class GptTranslate::ChatGPT
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def translate(markdown, min: 32)
|
55
|
-
GptTranslate::Pars.new(markdown).to_a.map do |
|
55
|
+
GptTranslate::Pars.new(markdown).to_a.map do |pa|
|
56
|
+
par = pa.dup
|
56
57
|
par.strip!
|
57
58
|
if @source == @target
|
58
59
|
Jekyll.logger.debug("No need to translate from #{@source.inspect} to #{@target.inspect}: #{par.inspect}")
|
data/test/test_pars.rb
CHANGED
@@ -37,6 +37,10 @@ class GptTranslate::ParsTest < Minitest::Test
|
|
37
37
|
assert_equal(2, GptTranslate::Pars.new("\n\n\nHello,\n\n**world**\n!\n\n").to_a.size)
|
38
38
|
end
|
39
39
|
|
40
|
+
def test_returns_unfrozen_strings
|
41
|
+
GptTranslate::Pars.new("Hi, world!\n\n```\ntest\n```\n\nBye\n").to_a.map(&:strip!)
|
42
|
+
end
|
43
|
+
|
40
44
|
def test_understands_code_block
|
41
45
|
pars = GptTranslate::Pars.new("Hello:\n\n```java\na\n\nb\n\nc\n```\n\nz").to_a
|
42
46
|
assert_equal(3, pars.size)
|