jekyll-import 0.17.1 → 0.18.0

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: 03a3cb18b4503380a2ad39b5ef8807fa545dbd3732f7539ebcefdd95ec832460
4
- data.tar.gz: 9146357cd5440e9d19ec28d6a94cd2dc0731debec05536e95dfde1addcfadfd3
3
+ metadata.gz: d3f964d35053d8b6d57507e51d0f6512da6090196fbc64d5b27707841bd911dd
4
+ data.tar.gz: 6473e0c7e9619af1e666c845337bff7f553ec104106bfec56f366c5623446431
5
5
  SHA512:
6
- metadata.gz: 7fbd25bc7478bde73ad6acc5f56c8156ac16c036c2e6f45ee015dbd213a255394171d6d9e5f86acc53f1193c993584dd40111997ec6663101479c913eb635794
7
- data.tar.gz: ffb932a6866e9b4d5256cdb78fa7d48fa95226e83a3f860b3825853cbf44a753adbba1bc49515e63f5a5925aa4a2fa829d6ac441e2fb46fa8af7d5a7ac25744b
6
+ metadata.gz: f549ada882d1255c0bcb35a7945b19101de4b7b2c352ae13631b452da9f3dd59fd5dc36f45a51cf815c4c15c89f04575eba7d172d222e3bc21a18c42857e2796
7
+ data.tar.gz: bc2dd8ed440e6df361aefcf6059a9762e9692d1726b95a4748498819626e595f7c36a7d7d09acf10fa79b22f79b344e7f89f6207f2bbdd4825db131164c16e39
@@ -45,7 +45,9 @@ module JekyllImport
45
45
  page = post[:page]
46
46
 
47
47
  # the publish date if the post has been published, creation date otherwise
48
- date = Time.at(post[draft ? :created_at : :published_at].to_i)
48
+ # The database stores timestamps in milliseconds, so we need to divide by 1000
49
+ # to get time in seconds.
50
+ date = Time.at(post[draft ? :created_at : :published_at].to_i / 1000)
49
51
 
50
52
  if page
51
53
  # the filename under which the page is stored
@@ -73,7 +73,7 @@ module JekyllImport
73
73
  :categories => opts.fetch("categories", true),
74
74
  :tags => opts.fetch("tags", true),
75
75
  :extension => opts.fetch("extension", "html"),
76
- :status => opts.fetch("status", ["PUBLISHED"]).map(&:to_sym) # :DRAFT
76
+ :status => opts.fetch("status", ["PUBLISHED"]).map(&:to_sym), # :DRAFT
77
77
  }
78
78
 
79
79
  if options[:clean_entities]
@@ -34,7 +34,7 @@ module JekyllImport
34
34
  body = options.fetch("body", ["description"])
35
35
 
36
36
  content = ""
37
- URI.parse(source).open { |s| content = s.read }
37
+ open(source) { |s| content = s.read }
38
38
  rss = ::RSS::Parser.parse(content, false)
39
39
 
40
40
  raise "There doesn't appear to be any RSS items at the source (#{source}) provided." unless rss
@@ -94,7 +94,7 @@ module JekyllImport
94
94
  :more_excerpt => opts.fetch("more_excerpt", true),
95
95
  :more_anchor => opts.fetch("more_anchor", true),
96
96
  :extension => opts.fetch("extension", "html"),
97
- :status => opts.fetch("status", ["publish"]).map(&:to_sym) # :draft, :private, :revision
97
+ :status => opts.fetch("status", ["publish"]).map(&:to_sym), # :draft, :private, :revision
98
98
  }
99
99
 
100
100
  if options[:clean_entities]
@@ -74,6 +74,16 @@ module JekyllImport
74
74
  end
75
75
  end
76
76
 
77
+ def permalink
78
+ # Hpricot thinks "link" is a self closing tag so it puts the text of the link after the tag
79
+ # but sometimes it works right! I think it's the xml declaration
80
+ @permalink ||= begin
81
+ uri = text_for("link")
82
+ uri = @node.at("link").following[0] if uri.empty?
83
+ URI(uri.to_s).path
84
+ end
85
+ end
86
+
77
87
  def published_at
78
88
  @published_at ||= Time.parse(text_for("wp:post_date")) if published?
79
89
  end
@@ -174,6 +184,7 @@ module JekyllImport
174
184
  "tags" => tags,
175
185
  "meta" => metas,
176
186
  "author" => authors[author_login],
187
+ "permalink" => item.permalink,
177
188
  }
178
189
 
179
190
  begin
@@ -32,7 +32,7 @@ module JekyllImport
32
32
  end
33
33
 
34
34
  name = "<pre wp-pre-tag-#{i}></pre>"
35
- pre_tags[name] = pee_part[start..-1] + "</pre>"
35
+ pre_tags[name] = (pee_part[start..-1] + "</pre>").gsub('\\', '\\\\\\\\')
36
36
 
37
37
  pee += pee_part[0, start] + name
38
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllImport
4
- VERSION = "0.17.1"
4
+ VERSION = "0.18.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-import
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-12-23 00:00:00.000000000 Z
13
+ date: 2019-03-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fastercsv
@@ -32,14 +32,20 @@ dependencies:
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '3.0'
35
+ version: 4.0.0.pre.alpha1
36
+ - - "<"
37
+ - !ruby/object:Gem::Version
38
+ version: '5.0'
36
39
  type: :runtime
37
40
  prerelease: false
38
41
  version_requirements: !ruby/object:Gem::Requirement
39
42
  requirements:
40
43
  - - "~>"
41
44
  - !ruby/object:Gem::Version
42
- version: '3.0'
45
+ version: 4.0.0.pre.alpha1
46
+ - - "<"
47
+ - !ruby/object:Gem::Version
48
+ version: '5.0'
43
49
  - !ruby/object:Gem::Dependency
44
50
  name: nokogiri
45
51
  requirement: !ruby/object:Gem::Requirement
@@ -82,6 +88,20 @@ dependencies:
82
88
  - - "~>"
83
89
  - !ruby/object:Gem::Version
84
90
  version: '4.2'
91
+ - !ruby/object:Gem::Dependency
92
+ name: bundler
93
+ requirement: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ type: :development
99
+ prerelease: false
100
+ version_requirements: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
85
105
  - !ruby/object:Gem::Dependency
86
106
  name: rake
87
107
  requirement: !ruby/object:Gem::Requirement
@@ -389,14 +409,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
389
409
  requirements:
390
410
  - - ">="
391
411
  - !ruby/object:Gem::Version
392
- version: '2.3'
412
+ version: 2.4.0
393
413
  required_rubygems_version: !ruby/object:Gem::Requirement
394
414
  requirements:
395
415
  - - ">="
396
416
  - !ruby/object:Gem::Version
397
417
  version: '0'
398
418
  requirements: []
399
- rubygems_version: 3.0.0
419
+ rubygems_version: 3.0.3
400
420
  signing_key:
401
421
  specification_version: 4
402
422
  summary: Import command for Jekyll (static site generator).