thot 1.0.1 → 1.1.0
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/VERSION +1 -1
- data/exe/thot +1 -1
- data/lib/thot/cli.rb +2 -1
- data/lib/thot.rb +1 -2
- data/samples/template2.txt +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 57ada5bc80f13298187297034ec1b9c754cdf0cd2313bd5a2674f8bc8ad2f165
|
|
4
|
+
data.tar.gz: '0961751bbb5709516c88958ee50fee4e62c0802a9ce7b0d58c72bf1a2d544b1a'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb39588c702fbc6ba92ffb46cc16dff45401f18bd8e82c68e10639f242b0ff571b3119b0ba3be83b83f212dffd6b354cfa1519a13603bba0a32e50e3da1d379f
|
|
7
|
+
data.tar.gz: a6533192e004e53ea6a9f456a60f11b72fa4e57ff7c9840a19b7e75f7846fa9a8477560f0655f5d2c1ad5d9f3898e4c05c5a52e23124a3f4b9e808a519117782
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0
|
|
1
|
+
1.1.0
|
data/exe/thot
CHANGED
data/lib/thot/cli.rb
CHANGED
|
@@ -28,6 +28,7 @@ module Thot
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def getting_content
|
|
31
|
+
@content = ""
|
|
31
32
|
if @list_templates_file.empty?
|
|
32
33
|
STDERR.puts "Reading content from STDIN" if @options[:verbose]
|
|
33
34
|
@content = ARGF.readlines.join
|
|
@@ -35,7 +36,7 @@ module Thot
|
|
|
35
36
|
STDERR.puts "Reading content from file(s) : #{@list_templates_file}" if @options[:verbose]
|
|
36
37
|
@list_templates_file.each do |item|
|
|
37
38
|
if File::exist? item
|
|
38
|
-
@content.concat(File::readlines(item)
|
|
39
|
+
@content.concat(File::readlines(item).join)
|
|
39
40
|
else
|
|
40
41
|
raise "file not found #{item}"
|
|
41
42
|
end
|
data/lib/thot.rb
CHANGED
|
@@ -73,7 +73,6 @@ module Thot
|
|
|
73
73
|
raise ArgumentError::new("#{item} : Not a String") unless val.class == String
|
|
74
74
|
_data[item.to_s.downcase] = val
|
|
75
75
|
}
|
|
76
|
-
raise InvalidTokenList::new("Token list malformation") unless _data.keys.sort == @list_token.map{|_token| _token.to_s }.sort
|
|
77
76
|
@hash_token = _data
|
|
78
77
|
end
|
|
79
78
|
|
|
@@ -89,7 +88,7 @@ module Thot
|
|
|
89
88
|
@result = @content
|
|
90
89
|
@list_token.each{|_token|
|
|
91
90
|
self.filtering @content.scan(/%%(#{_token.to_s.upcase}[\.\w+]+)%%/).flatten
|
|
92
|
-
@result.gsub!(/%%#{_token.to_s.upcase}%%/,@hash_token[_token.to_s])
|
|
91
|
+
@result.gsub!(/%%#{_token.to_s.upcase}%%/,@hash_token[_token.to_s]) if @hash_token.include? _token.to_s
|
|
93
92
|
}
|
|
94
93
|
return @result
|
|
95
94
|
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Hello %%NAME.capitalize%% %%SURNAME.upcase%% !!
|
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.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Romain GEORGES
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-12-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -146,6 +146,7 @@ files:
|
|
|
146
146
|
- lib/thot/version.rb
|
|
147
147
|
- samples/.env.prod
|
|
148
148
|
- samples/template.txt
|
|
149
|
+
- samples/template2.txt
|
|
149
150
|
- thot.gemspec
|
|
150
151
|
- ultragreen_roodi_coding_convention.yml
|
|
151
152
|
homepage: https://github.com/Ultragreen/thot
|
|
@@ -168,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
168
169
|
- !ruby/object:Gem::Version
|
|
169
170
|
version: '0'
|
|
170
171
|
requirements: []
|
|
171
|
-
rubygems_version: 3.
|
|
172
|
+
rubygems_version: 3.3.5
|
|
172
173
|
signing_key:
|
|
173
174
|
specification_version: 4
|
|
174
175
|
summary: THe Operative Templating
|