jekyll-unsanitize 0.3
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 +7 -0
- data/lib/jekyll-unsanitize.rb +35 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 813ed8eb0e86526a927aecc7f14a34a306f18ae0
|
4
|
+
data.tar.gz: 7f71b955650ced383848222a7874dec5816c5ee6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b126b34a94b09f36100ad29229701f1a739ebc41af8478950b5e809324e384d8301ff591bd0e21c3fbb87bad8e8a5fad7f224ca1d90f691e327a8e5d4835b5fe
|
7
|
+
data.tar.gz: e7515ae7bbe205b66a3ce591366dd6e9cd21aee2f186c51d30258983fe59f5d2fff459959241a90bc4aa89fd75e21d68348a7901be70e3127846abe5806d28ce
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'jekyll'
|
2
|
+
require 'jekyll/cleaner'
|
3
|
+
|
4
|
+
module Jekyll
|
5
|
+
class << self
|
6
|
+
def sanitized_path(base_directory, questionable_path)
|
7
|
+
|
8
|
+
if base_directory.eql?(questionable_path)
|
9
|
+
base_directory
|
10
|
+
elsif questionable_path.start_with?(base_directory)
|
11
|
+
questionable_path
|
12
|
+
elsif File.exists?(questionable_path)
|
13
|
+
File.expand_path(questionable_path)
|
14
|
+
else
|
15
|
+
File.join(base_directory, questionable_path)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class Site
|
22
|
+
class Cleaner
|
23
|
+
def parent_dirs(file)
|
24
|
+
parent_dir = File.dirname(file)
|
25
|
+
if parent_dir == '/'
|
26
|
+
[]
|
27
|
+
elsif parent_dir == site.dest
|
28
|
+
[]
|
29
|
+
else
|
30
|
+
[parent_dir] + parent_dirs(parent_dir)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-unsanitize
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.3'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sumit Khanna
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-15 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Removes source base requirement for Jekyll 2.5
|
14
|
+
email: sumit@penguindreams.org
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/jekyll-unsanitize.rb
|
20
|
+
homepage: http://penguindreams.org
|
21
|
+
licenses:
|
22
|
+
- Apache-2.0
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.2.5
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: jekyll-unsanitize
|
44
|
+
test_files: []
|