jekyll-remote-theme 0.5.1 → 0.5.2
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/jekyll-remote-theme/downloader.rb +17 -1
- data/lib/jekyll-remote-theme/munger.rb +13 -4
- data/lib/jekyll-remote-theme/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0fd5c42945efed4017267b250e90d3a9dd3c5b07b1d7e4cd34ab38fb3b5a5f89
|
|
4
|
+
data.tar.gz: 4997758808b903abf1ff1f2e185c9e408af4c0a94d2a6aabf25c2c5347194e91
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a1bd64eab9afac4223799d871f17f9cfa23601a752879a0b6273e389b7d60301eaf9b963eaaff54c6790614661984cc06a0c466c4b7d4871e6679ade95ae74f
|
|
7
|
+
data.tar.gz: dc3ebb66ed63e4722813b95f710815b79702245ff59b1431186cf0eb417b2fad5f3284eba10c9dea2b372da37dbb2de92057b0506a3c570223c435979312d37a
|
|
@@ -97,14 +97,30 @@ module Jekyll
|
|
|
97
97
|
# File IO is already open, rewind pointer to start of file to read
|
|
98
98
|
zip_file.rewind
|
|
99
99
|
|
|
100
|
+
# Extract each entry by hand rather than calling Zip::Entry#extract,
|
|
101
|
+
# whose signature changed incompatibly in rubyzip 3.0 (the destination
|
|
102
|
+
# is now resolved relative to a `destination_directory:` keyword,
|
|
103
|
+
# mangling the absolute paths we pass). Reading each entry's stream and
|
|
104
|
+
# writing it ourselves behaves identically across rubyzip 1.x–3.x.
|
|
100
105
|
Zip::File.open(zip_file) do |archive|
|
|
101
|
-
archive.each { |
|
|
106
|
+
archive.each { |entry| extract_entry(entry) }
|
|
102
107
|
end
|
|
103
108
|
ensure
|
|
104
109
|
zip_file.close
|
|
105
110
|
zip_file.unlink
|
|
106
111
|
end
|
|
107
112
|
|
|
113
|
+
# Writes a single zip entry to its destination within theme.root.
|
|
114
|
+
# path_without_name_and_ref sandboxes the destination, guarding against
|
|
115
|
+
# Zip Slip.
|
|
116
|
+
def extract_entry(entry)
|
|
117
|
+
return if entry.name.end_with?("/") # skip directory entries
|
|
118
|
+
|
|
119
|
+
dest = path_without_name_and_ref(entry.name)
|
|
120
|
+
FileUtils.mkdir_p File.dirname(dest)
|
|
121
|
+
entry.get_input_stream { |input| File.binwrite(dest, input.read) }
|
|
122
|
+
end
|
|
123
|
+
|
|
108
124
|
# Full URL to codeload zip download endpoint for the given theme
|
|
109
125
|
def zip_url
|
|
110
126
|
@zip_url ||= Addressable::URI.new(
|
|
@@ -63,13 +63,22 @@ module Jekyll
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
# Initialize GitHub metadata munger if it was loaded after :after_init hook
|
|
66
|
+
# or if the existing munger needs to be updated for the current site
|
|
66
67
|
def initialize_github_metadata
|
|
67
68
|
return unless defined?(Jekyll::GitHubMetadata::SiteGitHubMunger)
|
|
68
|
-
return if Jekyll::GitHubMetadata::SiteGitHubMunger.global_munger
|
|
69
69
|
|
|
70
|
-
munger
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
# Create a new munger if one doesn't exist or if it's for a different site
|
|
71
|
+
current_munger = Jekyll::GitHubMetadata::SiteGitHubMunger.global_munger
|
|
72
|
+
needs_init = current_munger.nil? ||
|
|
73
|
+
(Jekyll::GitHubMetadata.respond_to?(:site) &&
|
|
74
|
+
Jekyll::GitHubMetadata.site != site)
|
|
75
|
+
|
|
76
|
+
if needs_init
|
|
77
|
+
Jekyll.logger.debug LOG_KEY, "Initializing GitHub metadata munger"
|
|
78
|
+
munger = Jekyll::GitHubMetadata::SiteGitHubMunger.new(site)
|
|
79
|
+
munger.munge!
|
|
80
|
+
Jekyll::GitHubMetadata::SiteGitHubMunger.global_munger = munger
|
|
81
|
+
end
|
|
73
82
|
end
|
|
74
83
|
|
|
75
84
|
def enqueue_theme_cleanup
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-remote-theme
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Balter
|
|
@@ -92,7 +92,7 @@ dependencies:
|
|
|
92
92
|
version: 1.3.0
|
|
93
93
|
- - "<"
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: '
|
|
95
|
+
version: '4.0'
|
|
96
96
|
type: :runtime
|
|
97
97
|
prerelease: false
|
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -102,7 +102,7 @@ dependencies:
|
|
|
102
102
|
version: 1.3.0
|
|
103
103
|
- - "<"
|
|
104
104
|
- !ruby/object:Gem::Version
|
|
105
|
-
version: '
|
|
105
|
+
version: '4.0'
|
|
106
106
|
- !ruby/object:Gem::Dependency
|
|
107
107
|
name: jekyll_test_plugin_malicious
|
|
108
108
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -301,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
301
301
|
- !ruby/object:Gem::Version
|
|
302
302
|
version: '0'
|
|
303
303
|
requirements: []
|
|
304
|
-
rubygems_version: 4.0.
|
|
304
|
+
rubygems_version: 4.0.16
|
|
305
305
|
specification_version: 4
|
|
306
306
|
summary: Jekyll plugin for building Jekyll sites with any GitHub-hosted theme
|
|
307
307
|
test_files: []
|