ZMediumToMarkdown 2.1.2 → 2.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac8a9198b2843cd4002e114216dbca91408e1a5e3023f9abc12fcb837454efdd
4
- data.tar.gz: 68e2256efd392b79e52cadca9fcc7fca9e322a69b6687a80f67428c16d2a1b50
3
+ metadata.gz: 94a7ba6ab1c472f3aa523a43e9759a7b6a679c6c96885a64385bd182ea1a9f11
4
+ data.tar.gz: e0a26ed5df87ad811c6045d7a7dff7128c00c39039e905eada185dcaede0df9f
5
5
  SHA512:
6
- metadata.gz: 5d4b1a3342bed05f7f792a76bc576864f2805bed3c6a4c438f4c3ce55277fb12f58add04654879d4b3a3cd38e8f025b714c758347be2827e1f3a4a25389d15e7
7
- data.tar.gz: 033fe9bcd71bbe78fbbe0688be810c8b3af4bcb24e62feca8cebd31d7150ab02a9cb089524cf9a4de44c705f3204e37ff0fc51047343f23e4dcaf69e58a12350
6
+ metadata.gz: 867ac5286ef4a8ccd43b11380a2da119dc89d80411f456c83040f500db55a741c72bc4319838ab851cbe5523763d68a40eb7173a8a20598c202ac6e77b3f8fea
7
+ data.tar.gz: 3643376b627e46802f058271512baa01c2b233222c256cfb948b637302085b1b0d4dadb052e322322286ea401438d870826b15a7bf2a80f29bb1cebdbc4c663a
data/lib/Helper.rb CHANGED
@@ -99,22 +99,22 @@ class Helper
99
99
  end
100
100
 
101
101
  def self.createPostInfo(postInfo, isForJekyll)
102
- title = postInfo.title.gsub("[","")
103
- title = title.gsub("]","")
102
+ title = postInfo.title&.gsub("[","")
103
+ title = title&.gsub("]","")
104
104
 
105
105
  tags = ""
106
106
  if !postInfo.tags.nil? && postInfo.tags.length > 0
107
- tags = "\"#{postInfo.tags.map { |tag| tag.gsub("\"", "\\\"") }.join("\",\"")}\""
107
+ tags = "\"#{postInfo.tags.map { |tag| tag&.gsub("\"", "\\\"") }.join("\",\"")}\""
108
108
  end
109
109
 
110
110
  result = "---\n"
111
- result += "title: \"#{title.gsub("\"", "\\\"")}\"\n"
112
- result += "author: \"#{postInfo.creator.gsub("\"", "\\\"")}\"\n"
111
+ result += "title: \"#{title&.gsub("\"", "\\\"")}\"\n"
112
+ result += "author: \"#{postInfo.creator&.gsub("\"", "\\\"")}\"\n"
113
113
  result += "date: #{postInfo.firstPublishedAt.strftime('%Y-%m-%dT%H:%M:%S.%L%z')}\n"
114
114
  result += "last_modified_at: #{postInfo.latestPublishedAt.strftime('%Y-%m-%dT%H:%M:%S.%L%z')}\n"
115
- result += "categories: \"#{postInfo.collectionName.gsub("\"", "\\\"")}\"\n"
115
+ result += "categories: \"#{postInfo.collectionName&.gsub("\"", "\\\"")}\"\n"
116
116
  result += "tags: [#{tags}]\n"
117
- result += "description: \"#{postInfo.description.gsub("\"", "\\\"")}\"\n"
117
+ result += "description: \"#{postInfo.description&.gsub("\"", "\\\"")}\"\n"
118
118
  if !postInfo.previewImage.nil?
119
119
  result += "image:\r\n"
120
120
  result += " path: #{postInfo.previewImage}\r\n"
data/lib/Request.rb CHANGED
@@ -33,7 +33,8 @@ class Request
33
33
  if !location.match? /^(http)/
34
34
  location = "#{uri.scheme}://#{uri.host}#{location}"
35
35
  end
36
- response = self.URL(location, method, data)
36
+
37
+ response = self.URL(location, method, data, retryCount)
37
38
  end
38
39
  end
39
40
  rescue
@@ -238,7 +238,7 @@ class ZMediumFetcher
238
238
 
239
239
  if File.file?(absolutePath)
240
240
  lines = File.foreach(absolutePath).first(15)
241
- if lines.first.start_with?("---")
241
+ if lines.first&.start_with?("---")
242
242
  dateLine = lines.select { |line| line.start_with?("last_modified_at:") }.first
243
243
  if !dateLine.nil?
244
244
  fileLatestPublishedAt = Time.parse(dateLine[/^(last_modified_at:)\s+(\S*)/, 2]).to_i
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ZMediumToMarkdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhgChgLi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-17 00:00:00.000000000 Z
11
+ date: 2023-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri