no-style-please2-plugins 0.7.0 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/lib/enc.rb +25 -0
  3. data/lib/ext.rb +28 -0
  4. data/lib/version/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 729be7c6880999d50f668bc647674a327bf94f3bfa6775479862578358cf16d3
4
- data.tar.gz: 2dae3211a7ce7913f274243851f75d7a5fc8307c444ac6175504d5fb890a7165
3
+ metadata.gz: ab334d2c482d4209e3ba73781eacd5f3b0f5e1735500d879de12555f9e156df3
4
+ data.tar.gz: 23eb54db2441640193bde976518f504630651305581d21d2e66eaa9008220e67
5
5
  SHA512:
6
- metadata.gz: ad14f9cbaf2e2184d03daae6f988a042622d9c550c8d0b6b358d919a9e1a873cf0b2ecc2de277d4e8038cf0383d0e96648a7226d4cbe39558844b603be09a421
7
- data.tar.gz: c330e3af02d3651c3f07bc5bb0957ccca5bc12e0e25ab148338df5f1116305f46540b2cdef2c22f26ca7fabf1d823dbc2b047da4d5f395bdbf242aede53cb0cb
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NoStylePlease2
4
- VERSION = "0.7.0"
4
+ VERSION = "0.7.3"
5
5
  end
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.0
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: 2023-12-14 00:00:00.000000000 Z
11
+ date: 2024-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll