no-style-please2-plugins 0.1.3 → 0.2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/gem.gemspec +1 -2
- data/lib/enc.rb +7 -62
- data/lib/ext.rb +4 -8
- data/lib/no-style-please2-plugins.rb +5 -0
- data/lib/version/version.rb +1 -1
- data/sig/no-style-please2-plugins.rbs +0 -0
- data/test.rb +6 -0
- metadata +5 -3
- data/sig/no/style/please2/plugins.rbs +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f0a1fe1e54eab7298a9e4030aa641ed131535a550ae51b50399ddd616158b46
|
4
|
+
data.tar.gz: 8c40e2dba8c1a045eb1c4fe50f823b7338fdd127b83b6379c487e1fe0356eacc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b190b0ec6165ea08df714727c8aef65a0a779b9724b782021620947e37d1735a09d753da11294431c29422207938b5573106675703957c970d56d79de73a686
|
7
|
+
data.tar.gz: 5f690e8d2e8c9fe6a55a1848351c243cb8e6bbd64b0a4222974ed2c0baf2c1b2b2537bb5a92240f665f34b679a79af7f60c88300f2dfed2cf1cb6dc863501e22
|
data/Gemfile.lock
CHANGED
data/gem.gemspec
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
require_relative "lib/version/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
# nostyleplease2plugins is too long?
|
7
6
|
spec.name = "no-style-please2-plugins"
|
8
7
|
spec.version = NoStylePlease2::VERSION
|
9
8
|
spec.authors = ["vitock"]
|
@@ -33,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
33
32
|
|
34
33
|
|
35
34
|
|
36
|
-
spec.
|
35
|
+
spec.add_dependency "jekyll", "~>4.2.0"
|
37
36
|
spec.add_dependency "ltec", "~> 0.1.2"
|
38
37
|
spec.add_dependency "salsa20", "~> 0.1.3"
|
39
38
|
spec.add_dependency "digest"
|
data/lib/enc.rb
CHANGED
@@ -5,6 +5,9 @@ require 'digest'
|
|
5
5
|
require 'ltec'
|
6
6
|
require "jekyll"
|
7
7
|
module Jekyll
|
8
|
+
def test
|
9
|
+
puts 333
|
10
|
+
end
|
8
11
|
module EncFilter
|
9
12
|
def getKey(content,page)
|
10
13
|
site = Jekyll::sites[0]
|
@@ -73,7 +76,7 @@ module Jekyll
|
|
73
76
|
|
74
77
|
|
75
78
|
end
|
76
|
-
|
79
|
+
|
77
80
|
|
78
81
|
Liquid::Template.register_filter(Jekyll::EncFilter)
|
79
82
|
|
@@ -87,64 +90,6 @@ def hex2bin(str)
|
|
87
90
|
[str].pack "H*"
|
88
91
|
end
|
89
92
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
# # puts post.site.config['enc_tags']
|
94
|
-
# # puts post.data["tags"]
|
95
|
-
# # puts post.data["key"]
|
96
|
-
# # puts "<<<<<<<"
|
97
|
-
|
98
|
-
# key = post.data["key"]
|
99
|
-
# if key
|
100
|
-
# key = '' + key
|
101
|
-
# end
|
102
|
-
# if !key || key.length == 0
|
103
|
-
# # find key for tag
|
104
|
-
# posttags = post.data["tags"]
|
105
|
-
# enctags = post.site.config['enc_tags']
|
106
|
-
# if posttags && posttags
|
107
|
-
# for tag in posttags
|
108
|
-
# if key && key.length > 0
|
109
|
-
# break;
|
110
|
-
# end
|
111
|
-
# for enctag in enctags
|
112
|
-
# if enctag['tag'] == tag
|
113
|
-
# key = enctag['password']
|
114
|
-
# break
|
115
|
-
# end
|
116
|
-
# end
|
117
|
-
# end
|
118
|
-
# end
|
119
|
-
# end
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
# if key && key.length
|
125
|
-
# # prepare
|
126
|
-
# key = post.data['key']
|
127
|
-
# out = post.output
|
128
|
-
|
129
|
-
# next
|
130
|
-
# page = Nokogiri::HTML(out)
|
131
|
-
# content = page.css('div#secure-container')[0].inner_html
|
132
|
-
|
133
|
-
# # encrypt
|
134
|
-
# aes = OpenSSL::Cipher.new('AES-256-CBC')
|
135
|
-
# aes.encrypt
|
136
|
-
# salt = OpenSSL::Random.random_bytes(8)
|
137
|
-
# iv = aes.random_iv
|
138
|
-
# aes.key = Digest::SHA256.digest(key + bin2hex(salt))
|
139
|
-
# aes.iv = iv
|
140
|
-
# encrypted = bin2hex(aes.update(content) + aes.final).strip
|
141
|
-
|
142
|
-
# # save
|
143
|
-
# page.css('div#secure-container')[0].inner_html = encrypted
|
144
|
-
# post.output = page
|
145
|
-
|
146
|
-
# # put iv and salt on page for decryption
|
147
|
-
# page.css('div#crypt_params')[0].inner_html = "<script>var _gj = {salt: '"+bin2hex(salt)+"', iv: '"+bin2hex(iv)+"' } </script>"
|
148
|
-
|
149
|
-
# end
|
150
|
-
# end
|
93
|
+
|
94
|
+
|
95
|
+
end
|
data/lib/ext.rb
CHANGED
@@ -80,7 +80,7 @@ module Jekyll
|
|
80
80
|
end
|
81
81
|
|
82
82
|
|
83
|
-
|
83
|
+
|
84
84
|
class IncludeCode < Liquid::Tag
|
85
85
|
@filecontent = ""
|
86
86
|
def initialize(tag_name, text, tokens)
|
@@ -112,21 +112,18 @@ EOF
|
|
112
112
|
|
113
113
|
|
114
114
|
|
115
|
-
|
115
|
+
|
116
116
|
|
117
117
|
Liquid::Template.register_tag('asset_img', Jekyll::AssetImg)
|
118
118
|
Liquid::Template.register_tag('include_code', Jekyll::IncludeCode)
|
119
119
|
Liquid::Template.register_tag('post_link', Jekyll::PostLink)
|
120
|
-
Liquid::Template.register_tag('cq', Jekyll::EmptyTag)
|
121
|
-
Liquid::Template.register_tag('endcq', Jekyll::EmptyTag)
|
122
|
-
Liquid::Template.register_tag('katexmm', Jekyll::EmptyTag)
|
123
|
-
Liquid::Template.register_tag('endkatexmm', Jekyll::EmptyTag)
|
124
120
|
|
125
121
|
|
126
122
|
|
127
123
|
module Reading
|
128
124
|
class Generator < Jekyll::Generator
|
129
125
|
def generate(site)
|
126
|
+
$g_config = Jekyll::sites[0].config
|
130
127
|
if !File.directory?("tags")
|
131
128
|
Dir.mkdir "tags"
|
132
129
|
end
|
@@ -178,7 +175,6 @@ end
|
|
178
175
|
# puts "...."
|
179
176
|
# end
|
180
177
|
|
181
|
-
LOADINGFLG = :LOADINGFLG
|
182
178
|
Jekyll::Hooks.register :site, :post_render do |st|
|
183
179
|
# code to call after Jekyll renders a page
|
184
180
|
rebuild = 0
|
@@ -201,4 +197,4 @@ end
|
|
201
197
|
|
202
198
|
end
|
203
199
|
|
204
|
-
|
200
|
+
end
|
data/lib/version/version.rb
CHANGED
File without changes
|
data/test.rb
ADDED
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.1
|
4
|
+
version: 0.2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vitock
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -81,8 +81,10 @@ files:
|
|
81
81
|
- gem.gemspec
|
82
82
|
- lib/enc.rb
|
83
83
|
- lib/ext.rb
|
84
|
+
- lib/no-style-please2-plugins.rb
|
84
85
|
- lib/version/version.rb
|
85
|
-
- sig/no
|
86
|
+
- sig/no-style-please2-plugins.rbs
|
87
|
+
- test.rb
|
86
88
|
homepage: https://github.com/vitock/no-style-please2-plugins
|
87
89
|
licenses: []
|
88
90
|
metadata:
|