zerofetcher 0.0.3 → 0.0.4
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/code/JekyllFile.rb +4 -7
- data/lib/zerofetcher.rb +15 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdcf2e210e07a95237a4daa19f5a51db663f1374
|
4
|
+
data.tar.gz: 877418cd950b2ca2c76490cc33c4ba26eb6972bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b75163457a7d48f233f060d2081c153942fe6a61b088588f4c195f40c81964d74f673b7e0823f7ea8372cd434c7395203257f7db914ccb595d75b62cbc80dcba
|
7
|
+
data.tar.gz: 542ba6919abe110e5e69c1331d5ae1e4a6951a28d7eedc71cd10c895aa4a42b16258e8c24740cf99f704d660b61c321ffcb6e41946a6093f3a97eb895b256ea1
|
data/lib/code/JekyllFile.rb
CHANGED
@@ -32,9 +32,10 @@ class JekyllFile
|
|
32
32
|
parseFile
|
33
33
|
else
|
34
34
|
if 'page' == @file_type
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
# disabled permalinks for pages
|
36
|
+
#@yaml_parsed = {
|
37
|
+
# 'permalink' => '/' + @file_data['url'] + '/'
|
38
|
+
# }
|
38
39
|
|
39
40
|
@content_section = '{% include pages/' + @file_data['url'] + '.md %}'
|
40
41
|
end
|
@@ -59,8 +60,6 @@ class JekyllFile
|
|
59
60
|
# add file data
|
60
61
|
@file_data.each do |key, value|
|
61
62
|
if !@content_keys.include?(key)
|
62
|
-
#if !@ignore_keys.include?(key) && !@content_keys.include?(key)
|
63
|
-
#if !@ignore_keys.has_key?(key) && !@content_keys.has_key?(key)
|
64
63
|
@yaml_parsed[key] = value
|
65
64
|
end
|
66
65
|
end
|
@@ -104,7 +103,6 @@ class JekyllFile
|
|
104
103
|
@content_section = ''
|
105
104
|
|
106
105
|
file_contents.each_line do |line|
|
107
|
-
#puts 'LINE AREA '+area.to_s+' '+line
|
108
106
|
sline = line
|
109
107
|
|
110
108
|
if '---' == sline.strip
|
@@ -124,7 +122,6 @@ class JekyllFile
|
|
124
122
|
end
|
125
123
|
end
|
126
124
|
|
127
|
-
#@yaml_parsed = YAML.parse(@yaml_section)
|
128
125
|
@yaml_parsed = YAML.load(@yaml_section)
|
129
126
|
end
|
130
127
|
|
data/lib/zerofetcher.rb
CHANGED
@@ -48,6 +48,8 @@ class ZeroFetcher
|
|
48
48
|
|
49
49
|
# Pages
|
50
50
|
if data.key?("pages")
|
51
|
+
pages_files_saved = Array.new
|
52
|
+
|
51
53
|
pages_folder = jekyll_path+'/_includes/pages'
|
52
54
|
|
53
55
|
puts 'Pages - ' + data['pages'].length.to_s
|
@@ -62,7 +64,7 @@ class ZeroFetcher
|
|
62
64
|
|
63
65
|
jpage.saveContentFile(pages_folder+'/'+page['url']+'.md', page['contents'])
|
64
66
|
jpage.savePageFile
|
65
|
-
|
67
|
+
pages_files_saved.push(jpage.getFileName)
|
66
68
|
|
67
69
|
# Add to pages array
|
68
70
|
pages.push({
|
@@ -76,7 +78,18 @@ class ZeroFetcher
|
|
76
78
|
end
|
77
79
|
|
78
80
|
File.write(jekyll_path+'/_data/pages.json', pages.to_json)
|
79
|
-
|
81
|
+
|
82
|
+
# Clean Unused Pages
|
83
|
+
existing_pages_files = Dir.glob(File.join(jekyll_path, "*.md"))
|
84
|
+
|
85
|
+
existing_pages_files.each do |file|
|
86
|
+
if 'README.md' != Pathname.new(file).basename.to_s
|
87
|
+
if !pages_files_saved.include?( file )
|
88
|
+
FileUtils.rm(file)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
80
93
|
|
81
94
|
# Variables
|
82
95
|
if data.key?("variables")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zerofetcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Liccardo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Fetches content from zero
|
14
14
|
email: brian@d3corp.com
|