jekyll-chatgpt-translate 0.0.39 → 0.0.40

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: b4ab44177f3ba1b8eb9fb9f705734c130a5aa50447fa3e40f746d43a0fbb2c74
4
- data.tar.gz: 2516780138d056a38a1f8aac70fad9e4606043fb6d9808fdf7224d4e3a3e08c4
3
+ metadata.gz: 8ce1b67a78ab62d8ff281da23c8d1c5c63d5b07934e42e49fcfa07886c9ced32
4
+ data.tar.gz: 39e13d4901343a950d4c3a5d21b6fdca94723efbba1bfb18fe5f82c0cb26c4ff
5
5
  SHA512:
6
- metadata.gz: 7b3dba562f9860cfb1c00198770ed637a75c85216e87b9f36bb4520d212ed8cdfb9b3332601571addab38b81011b92a24408c4142fe31130d75f94d09a4f62d6
7
- data.tar.gz: b679a82e6e19e3954c3676c6b81ef240fadda14aa06c490577bcb51d2c5f9d39c7ee8b708cc998617101be95c4d3747a29976b006e7cdb8ed68dedb72d4ce482
6
+ metadata.gz: afe4e8981572c052dfabe2ed084f6e3eaaf7321297ca1d53cc750be81351429a1d7e7a2479da8d60008019224d8e29dd922437b19fa554729faccf533d61908d
7
+ data.tar.gz: 652431c0c7ec9153994b25ee4f480ebf374bddb77c6500bd451364cc38d4b4578ed3fe6acf83f4c55dc359b41a931626baef8a8257f907f0649044ce9559ae94
@@ -13,7 +13,7 @@ jobs:
13
13
  strategy:
14
14
  matrix:
15
15
  os: [ubuntu-20.04, macos-12, windows-2022]
16
- ruby: [2.7, 3.1]
16
+ ruby: [3.1]
17
17
  runs-on: ${{ matrix.os }}
18
18
  steps:
19
19
  - uses: actions/checkout@v4
data/Gemfile CHANGED
@@ -27,9 +27,9 @@ gemspec
27
27
 
28
28
  gem 'cucumber', '9.0.2', require: false
29
29
  gem 'kramdown-parser-gfm', '1.1.0', require: false
30
- gem 'minitest', '5.19.0', require: false
31
- gem 'rake', '13.0.6', require: false
32
- gem 'rubocop', '1.56.4', require: false
33
- gem 'rubocop-rspec', '2.24.0', require: false
30
+ gem 'minitest', '5.20.0', require: false
31
+ gem 'rake', '13.1.0', require: false
32
+ gem 'rubocop', '1.57.2', require: false
33
+ gem 'rubocop-rspec', '2.25.0', require: false
34
34
  gem 'simplecov', '0.22.0', require: false
35
35
  gem 'webmock', '3.19.1', require: false
data/README.md CHANGED
@@ -9,7 +9,8 @@ works for [my blog](https://github.com/yegor256/ru.yegor256.com),
9
9
  for example [this page](https://ru.yegor256.com/2023-08-13-dictators.html) is translated to
10
10
  [English](https://ru.yegor256.com/english/2023-08-13-dictators.html).
11
11
 
12
- Install it first:
12
+ Install it first (you need [Ruby 3+](https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/)
13
+ and [Jekyll 3+](https://jekyllrb.com/)):
13
14
 
14
15
  ```
15
16
  gem install jekyll-chatgpt-translate
@@ -26,9 +26,9 @@ require 'English'
26
26
 
27
27
  Gem::Specification.new do |s|
28
28
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
29
- s.required_ruby_version = '>= 2.6'
29
+ s.required_ruby_version = '>= 3.0'
30
30
  s.name = 'jekyll-chatgpt-translate'
31
- s.version = '0.0.39'
31
+ s.version = '0.0.40'
32
32
  s.license = 'MIT'
33
33
  s.summary = 'Translate Jekyll Pages Through ChatGPT'
34
34
  s.description = [
@@ -46,6 +46,7 @@ Gem::Specification.new do |s|
46
46
  s.add_runtime_dependency 'iri', '>= 0'
47
47
  s.add_runtime_dependency 'iso-639', '>= 0'
48
48
  s.add_runtime_dependency 'jekyll', '>= 3'
49
+ s.add_runtime_dependency 'json', '>= 2'
49
50
  s.add_runtime_dependency 'redcarpet', '>= 3'
50
51
  s.add_runtime_dependency 'ruby-openai', '>= 5'
51
52
  s.add_runtime_dependency 'tiktoken_ruby', '>= 0.0.6'
@@ -23,6 +23,7 @@
23
23
  # SOFTWARE.
24
24
 
25
25
  require 'jekyll'
26
+ require 'json'
26
27
  require 'openai'
27
28
  require 'iso-639'
28
29
  require 'tiktoken_ruby'
@@ -131,7 +132,7 @@ class GptTranslate::ChatGPT
131
132
  temperature: 0.7
132
133
  }
133
134
  )
134
- answer = response.dig('choices', 0, 'message', 'content')
135
+ answer = JSON.parse(response).dig('choices', 0, 'message', 'content')
135
136
  if answer.nil?
136
137
  Jekyll.logger.error("No content returned by ChatGPT: #{response}")
137
138
  raise 'No content returned by ChatGPT'
@@ -23,5 +23,5 @@
23
23
  # SOFTWARE.
24
24
 
25
25
  module GptTranslate
26
- VERSION = '0.0.39'
26
+ VERSION = '0.0.40'
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-chatgpt-translate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.39
4
+ version: 0.0.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-02 00:00:00.000000000 Z
11
+ date: 2023-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: humanize
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: json
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '2'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '2'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: redcarpet
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -165,7 +179,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
165
179
  requirements:
166
180
  - - ">="
167
181
  - !ruby/object:Gem::Version
168
- version: '2.6'
182
+ version: '3.0'
169
183
  required_rubygems_version: !ruby/object:Gem::Requirement
170
184
  requirements:
171
185
  - - ">="