thot 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8633ef1b1cb491681966a9cb0439d1e3d8bb69766291623757b0f10fb13ed27
4
- data.tar.gz: b7f7297728de329b92fcb064aeeff5d92249b29d9aeb5c430a0a4cf767a4829c
3
+ metadata.gz: 8f6c6ae92314f63db63bf820e0256e0592733b7d0c0d57187d50926baefb82e0
4
+ data.tar.gz: 27a167400f4ece2859aafb3f0b159aca3ab5193fc7087336c6fe3b084a7d10a0
5
5
  SHA512:
6
- metadata.gz: cda6359c5666cf77c09bd903217a98120ed994a1bc3993409f4decc4781751b5fee290fcb8eb02afdc5cce2fe0de0cc7352be4364338640d59a920ac17ff4e32
7
- data.tar.gz: 256758ca6758aedfdf49dbd70ac73e1b48933b6f037a89b974ec939fae91820c61676476d698633e1a34bc3ed500f3d5dea6ba864c3b2daa824f35723102d429
6
+ metadata.gz: 6a5102b7469e1ac351626ae1efc577aaf5249b0c4ce5f3d0d48136dc1be11bf9bca4cb4ce0ee4fbfb10e8aa03dfda05f7ebbdda90a3e4a44e9253c2f9b4212fe
7
+ data.tar.gz: 2e73db783b15bf08c1660ea387402a39ff44079cbd05b25feca19ae5db83d23a7a7e6f3467c9ff96094fe3d6a07be9c32afe3a2c3bcdc79e03e65a9782890e8d
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2022 Pierre Alphonse
3
+ Copyright (c) 2022 Romain GEORGES
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -48,6 +48,10 @@ It could generate an output.
48
48
 
49
49
  From versions upper than 1.2.0, Thot support token syntax like **{{TOKEN_NAME}}**
50
50
 
51
+ ### Global synoptic
52
+
53
+ ![synoptic](assets/images/description_thot.png)
54
+
51
55
  ### Simple usecase
52
56
 
53
57
  - with data : <pre>{name: 'Romain'}</pre>
@@ -106,9 +110,19 @@ Thot is a library for you usage AND a CLI tool.
106
110
 
107
111
  ### Ruby Library usage
108
112
 
113
+
114
+ #### Thot::Template
115
+
116
+
117
+ ##### Synoptic
118
+
119
+ ![synoptic](assets/images/description_thot_template.png)
120
+
109
121
  you could use Thot in your Ruby code :
110
122
 
111
- #### Strict mode and accessor input
123
+ ##### Examples
124
+
125
+ ###### Strict mode and accessor input
112
126
 
113
127
  Note : Considering 'template.txt' with : 'Hello **%%NAME%%** !!'
114
128
  Note : in strict mode if the Tokens in template file don't match exactly the given token list, Thot raise an exception.
@@ -126,7 +140,7 @@ return
126
140
  Hello Romain !!
127
141
 
128
142
 
129
- #### Strict mode false with accesor input and template_content
143
+ ###### Strict mode false with accesor input and template_content
130
144
 
131
145
  ```ruby
132
146
  require 'thot'
@@ -140,7 +154,7 @@ return
140
154
 
141
155
  Hello Romain !!
142
156
 
143
- #### Strict mode false with map input and template_content
157
+ ###### Strict mode false with map input and template_content
144
158
 
145
159
  ```ruby
146
160
  require 'thot'
@@ -154,7 +168,116 @@ return
154
168
 
155
169
  Hello Romain !!
156
170
 
171
+ #### Thot::Varfiles
172
+
173
+
174
+ ##### Synoptic
175
+
176
+ ![synoptic](assets/images/description_thot_varfiles.png)
177
+
178
+ ##### Example
179
+
180
+ ###### File format
181
+
182
+ **Note** : format support is the same for .thot.env files AND given files.
183
+
184
+ Varfiles support both INI and flat format, like :
185
+
186
+ for flat :
187
+
188
+ ```
189
+ key=value
190
+ key = value
191
+ key = value
192
+ # comments and other lines are ignored
193
+ ```
194
+
195
+ for INI :
196
+
197
+ ```
198
+ key=value
199
+ key = value
200
+ key = value
201
+ # comments and other lines are ignored
202
+
203
+ [EVT]
204
+ key=value
205
+ key = value
206
+ key = value
207
+ # comments and other lines are ignored
208
+ ```
209
+
210
+ **Note** : section are overrides of global values
211
+
212
+ ###### Sample files for examples
213
+
214
+ ./.thot.env file :
215
+
216
+ ```
217
+ key=first value
218
+ key2=first value
219
+ ```
220
+
221
+
222
+ Given file : "/path/to/myfile.ini"
223
+
224
+ ```
225
+ key=value
226
+
227
+ [development]
228
+ key=dev value
229
+
230
+ [staging]
231
+ key=staging value
232
+
233
+ ```
234
+ ###### For :developement evt, without changing dotfiles preloaded.
235
+
236
+
237
+
238
+ ```ruby
239
+ require 'thot'
240
+ include Thot
241
+ vars = Varfiles::new varfile: "/path/to/myfile.ini"
242
+ pp vars.data
243
+ ```
244
+
245
+ output
246
+
247
+ {key: "dev value", key2: "first value"}
248
+
249
+ ###### For :staging evt, without changing dotfiles preloaded.
250
+
251
+
252
+
253
+ ```ruby
254
+ require 'thot'
255
+ include Thot
256
+ vars = Varfiles::new varfile: "/path/to/myfile.ini", environment: :staging
257
+ pp vars.data
258
+ ```
259
+
260
+ output
261
+
262
+ {key: "staging value", key2: "first value"}
263
+
264
+
265
+ ###### For :staging evt, changing dotfiles.
266
+
267
+ **Note** : default dotfiles priority is : ["~/.thot.env","./.thot.env"]
268
+
269
+
270
+
271
+ ```ruby
272
+ require 'thot'
273
+ include Thot
274
+ vars = Varfiles::new varfile: "/path/to/myfile.ini", environment: :staging, dotfiles: []
275
+ pp vars.data
276
+ ```
277
+
278
+ output
157
279
 
280
+ {key: "staging value"}
158
281
 
159
282
  ### CLI usage
160
283
 
data/Rakefile CHANGED
@@ -32,3 +32,18 @@ namespace :yardoc do
32
32
  end
33
33
  end
34
34
  task :clobber => "yardoc:clobber"
35
+
36
+ desc "Run CVE security audit over bundle"
37
+ task :audit do
38
+ system('bundle audit')
39
+ end
40
+
41
+ desc "Run dead line of code detection"
42
+ task :debride do
43
+ system('debride -w .debride_whitelist .')
44
+ end
45
+
46
+ desc "Run SBOM CycloneDX Xml format file"
47
+ task :sbom do
48
+ system('cyclonedx-ruby -p .')
49
+ end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.2.1
Binary file
data/thot.gemspec CHANGED
@@ -22,15 +22,20 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ["lib"]
24
24
 
25
- spec.add_dependency "carioca", "~> 2.0"
25
+ spec.add_dependency "carioca", "~> 2.1"
26
26
  spec.add_dependency "inifile", "~> 3.0"
27
27
 
28
- spec.add_development_dependency 'rake', '~> 12.0'
28
+ spec.add_development_dependency 'rake', '~> 13.0'
29
29
  spec.add_development_dependency 'rspec', '~> 3.0'
30
- spec.add_development_dependency 'rubocop', '~> 1.32'
30
+ spec.add_development_dependency 'rubocop', '~> 1.54'
31
31
  spec.add_development_dependency "roodi", "~> 5.0"
32
32
  spec.add_development_dependency 'code_statistics', '~> 0.2.13'
33
33
  spec.add_development_dependency "yard", "~> 0.9.27"
34
34
  spec.add_development_dependency "yard-rspec", "~> 0.1"
35
35
  spec.add_development_dependency'version', '~> 1.1'
36
+
37
+ spec.add_development_dependency "bundle-audit", "~> 0.1.0"
38
+
39
+ spec.add_development_dependency "cyclonedx-ruby", "~> 1.1"
40
+ spec.add_development_dependency "debride", "~> 1.12"
36
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Romain GEORGES
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-25 00:00:00.000000000 Z
11
+ date: 2023-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carioca
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '2.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: inifile
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '12.0'
47
+ version: '13.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '12.0'
54
+ version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.32'
75
+ version: '1.54'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.32'
82
+ version: '1.54'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: roodi
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +150,48 @@ dependencies:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '1.1'
153
+ - !ruby/object:Gem::Dependency
154
+ name: bundle-audit
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 0.1.0
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 0.1.0
167
+ - !ruby/object:Gem::Dependency
168
+ name: cyclonedx-ruby
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '1.1'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '1.1'
181
+ - !ruby/object:Gem::Dependency
182
+ name: debride
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '1.12'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '1.12'
153
195
  description: the simpliest way to template in Ruby and command
154
196
  email:
155
197
  - gems@ultragreen.net
@@ -167,6 +209,9 @@ files:
167
209
  - README.md
168
210
  - Rakefile
169
211
  - VERSION
212
+ - assets/images/description_thot.png
213
+ - assets/images/description_thot_template.png
214
+ - assets/images/description_thot_varfiles.png
170
215
  - assets/images/logo_thot_full_large.png
171
216
  - assets/images/logo_thot_light_large.png
172
217
  - assets/images/logo_thot_normal_large.png
@@ -187,7 +232,6 @@ files:
187
232
  - samples/.thot.env
188
233
  - samples/template.ttl
189
234
  - thot.gemspec
190
- - ultragreen_roodi_coding_convention.yml
191
235
  homepage: https://github.com/Ultragreen/thot
192
236
  licenses:
193
237
  - MIT
@@ -1,24 +0,0 @@
1
- AssignmentInConditionalCheck:
2
- CaseMissingElseCheck:
3
- ClassLineCountCheck:
4
- line_count: 300 # including comments yard
5
- ClassNameCheck:
6
- pattern: !ruby/regexp /^[A-Z][a-zA-Z0-9]*$/
7
- #ClassVariableCheck:
8
- CyclomaticComplexityBlockCheck:
9
- complexity: 5
10
- CyclomaticComplexityMethodCheck:
11
- complexity: 10
12
- EmptyRescueBodyCheck:
13
- ForLoopCheck:
14
- MethodLineCountCheck:
15
- line_count: 30
16
- MethodNameCheck:
17
- pattern: !ruby/regexp /^[_a-z<>=\[|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/
18
- # MissingForeignKeyIndexCheck:
19
- ModuleLineCountCheck:
20
- line_count: 300
21
- ModuleNameCheck:
22
- pattern: !ruby/regexp /^[A-Z][a-zA-Z0-9]*$/
23
- ParameterNumberCheck:
24
- parameter_count: 5