no-style-please2-plugins 0.7.0 → 0.7.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 +4 -4
- data/lib/enc.rb +25 -0
- data/lib/ext.rb +28 -0
- data/lib/version/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab334d2c482d4209e3ba73781eacd5f3b0f5e1735500d879de12555f9e156df3
|
4
|
+
data.tar.gz: 23eb54db2441640193bde976518f504630651305581d21d2e66eaa9008220e67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0fc8b380faf95c98d75ca79360e9a9ddd472900a30ff9eb8e92408ed33e89a51a56dbfd542daac121d326f97bc75c5f5f68f8f21e97ff1fa436f5e058998d3b
|
7
|
+
data.tar.gz: ec8a98db075fb514a7a515e56c3c5f02193b49a9ebf8cad63af566d0e80ef604c98633aded8063bba993ffe23e3e1f448000df5f732ad8f749ea15618cf368a0
|
data/lib/enc.rb
CHANGED
@@ -3,6 +3,7 @@ require 'base64'
|
|
3
3
|
require 'digest'
|
4
4
|
require 'ltec'
|
5
5
|
require "jekyll"
|
6
|
+
require "fileutils"
|
6
7
|
module Jekyll
|
7
8
|
def test
|
8
9
|
end
|
@@ -98,6 +99,30 @@ module Jekyll
|
|
98
99
|
return encrypt content,psw
|
99
100
|
end
|
100
101
|
|
102
|
+
def write_file(new_content,file_path)
|
103
|
+
|
104
|
+
dirpath = File.dirname(file_path)
|
105
|
+
File.dirname(dirpath)
|
106
|
+
|
107
|
+
|
108
|
+
if File.exist?(file_path)
|
109
|
+
# 读取现有文件内容
|
110
|
+
current_content = File.read(file_path)
|
111
|
+
# 如果内容不同,则写入新内容
|
112
|
+
unless current_content == new_content
|
113
|
+
File.write(file_path, new_content)
|
114
|
+
puts "write file" + file_path
|
115
|
+
else
|
116
|
+
puts "write file: same, skip " + file_path
|
117
|
+
end
|
118
|
+
else
|
119
|
+
# 文件不存在,直接写入
|
120
|
+
File.write(file_path, new_content)
|
121
|
+
puts "write file" + file_path
|
122
|
+
end
|
123
|
+
return ''
|
124
|
+
end
|
125
|
+
|
101
126
|
|
102
127
|
end
|
103
128
|
|
data/lib/ext.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "jekyll"
|
2
2
|
require "liquid"
|
3
|
+
require "fileutils"
|
3
4
|
|
4
5
|
module Jekyll
|
5
6
|
class RenderTimeTag < Liquid::Tag
|
@@ -248,12 +249,39 @@ end
|
|
248
249
|
|
249
250
|
Jekyll::Hooks.register :site, :after_init do |st|
|
250
251
|
# code to call after Jekyll renders a page
|
252
|
+
|
253
|
+
|
254
|
+
assets = 'assets'
|
255
|
+
|
256
|
+
if !Dir.exist?(assets)
|
257
|
+
Dir.mkdir(assets)
|
258
|
+
end
|
259
|
+
|
260
|
+
dynpath = assets +'/dyn'
|
261
|
+
puts dynpath
|
262
|
+
if Dir.exist?(dynpath)
|
263
|
+
FileUtils.rm_rf(dynpath)
|
264
|
+
end
|
265
|
+
FileUtils.mkdir(dynpath)
|
266
|
+
|
267
|
+
|
251
268
|
filename = 'index.html'
|
252
269
|
if !File.file?(filename)
|
253
270
|
tagTmp = "---\nlayout: paginate\n---"
|
254
271
|
File.open(filename , 'w+') { |f| f.write(tagTmp) }
|
255
272
|
print 'generate ' + filename
|
256
273
|
end
|
274
|
+
|
275
|
+
filename = 'HeatMap.md'
|
276
|
+
if !File.file?(filename)
|
277
|
+
tagTmp = "---\nlayout: heatmap\n---"
|
278
|
+
File.open(filename , 'w+') { |f| f.write(tagTmp) }
|
279
|
+
print 'heatmpa ' + filename
|
280
|
+
end
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
257
285
|
end
|
258
286
|
|
259
287
|
end
|
data/lib/version/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: no-style-please2-plugins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vitock
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|