tools 0.3.9 → 0.4.1
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/files/requireds.rb +1 -0
- data/lib/lib/config.rb +2 -47
- data/lib/tools/version.rb +1 -1
- data/tools.gemspec +2 -0
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfdd3a232e27946bc4a5a9c71aa504c5a1d81563c97cd9162ab9509d31a5bcba
|
4
|
+
data.tar.gz: 5b44ca0246805cafa44d55cecc14f10a5e768cb1516c87a0520fe01a43840168
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f935c96963b5466ec546e293badd855576095efa7242e2056e413a2a1efe9b5c4a83df116722f7e45dcb1f8b056d85a3209dfa86ace1d6a91355249f009ba915
|
7
|
+
data.tar.gz: 2f7e5a6be5db6e33fb5a1b55719e59cd8f257d9a95b83d85c857ac2cff978067f9dfad8a28035fa8e31b712f02a16529d56fe3ac51dc1669b82c234684cce344
|
data/lib/files/requireds.rb
CHANGED
data/lib/lib/config.rb
CHANGED
@@ -153,65 +153,20 @@ class ToolsConfig
|
|
153
153
|
end
|
154
154
|
|
155
155
|
|
156
|
+
|
156
157
|
def self.validate_config
|
157
|
-
# ToolsLog.info "\t\tValidanting config file in #{Tools.home+'/.tools/config'}."
|
158
|
-
# ToolsConfig.daily_backup_config
|
159
|
-
# ToolsConfig.purge_backup_config
|
160
|
-
# file = open(Cmdapi.home+'/.tools/config')
|
161
|
-
# config = file.read
|
162
|
-
# begin
|
163
|
-
# JSON.parse(config)
|
164
|
-
# return true
|
165
|
-
# rescue Exception => e
|
166
|
-
# CMDAPIUtil.show_info "\tInvalid JSON config file in #{Cmdapi.home+'/.tools/config'}."
|
167
|
-
# CMDAPIUtil.show_info "\t Follow the instructions below to fix the problem."
|
168
|
-
# CMDAPIUtil.show_info "\t 1. Rename the config file #{Cmdapi.home+'/.tools/config'}."
|
169
|
-
# CMDAPIUtil.show_info "\t 2. Cmdapi run again. The cmdapi will create a new configuration file."
|
170
|
-
# CMDAPIUtil.show_info "\t 3. Copy the keys from the previous file to the new file."
|
171
|
-
# CMDAPIUtil.show_info "\t 4. Run cmdapi again.."
|
172
|
-
# CMDAPIUtil.show_info "\t Aborting operation...."
|
173
|
-
# exit
|
174
|
-
# end
|
175
158
|
end
|
176
159
|
|
177
160
|
def self.check_config
|
178
|
-
# ToolsLog.info "\t\tChecking config file: #{Tools.home+'/.tools/config'}."
|
179
|
-
# file = open(Tools.home+'/.tools/config')
|
180
|
-
# json = file.read
|
181
|
-
# parsed = JSON.parse(json)
|
182
|
-
# file.close
|
183
161
|
end
|
184
162
|
|
185
|
-
def self.purge_backup_config
|
186
|
-
# ToolsLog.info "\t\tPurge backup config file: #{Tools.home+'/.tools/config'}."
|
187
|
-
# to_clean = Dir.glob(File.join(Tools.home+'/.tools/backup', '*')).select { |a|
|
188
|
-
# Time.now - File.ctime(a) > 14*24*60*60 }
|
189
|
-
# to_clean.each do |file_to_delete|
|
190
|
-
# File.delete(file_to_delete)
|
191
|
-
# end
|
163
|
+
def self.purge_backup_config
|
192
164
|
end
|
193
165
|
|
194
166
|
def self.config_backup
|
195
|
-
# ToolsLog.info "\t\tBackuping config file in #{Tools.home+'/.tools/backup'}."
|
196
|
-
# FileUtils.cp Tools.home+'/.tools/config',
|
197
|
-
# Tolls.home+'/.tools/backup/config_' +
|
198
|
-
# (ToolsUtil.get_date '%Y%m%d-%H%M') + '.backup'
|
199
167
|
end
|
200
168
|
|
201
169
|
def self.daily_backup_config
|
202
|
-
# #captura o backup mais recente
|
203
|
-
# least = Dir.glob(File.join(Cmdapi.home+'/.cmdapi3/backup', 'config*.backup')).max { |a,b| File.ctime(a) <=> File.ctime(b) }
|
204
|
-
# unless least.nil?
|
205
|
-
# #se não houver sido feito hoje
|
206
|
-
# unless File.ctime(least).to_date == Time.now.to_date
|
207
|
-
# # ToolsLog.info "\t\tStarting config backup."
|
208
|
-
# ToolsConfig.config_backup
|
209
|
-
# end
|
210
|
-
# else
|
211
|
-
# # ToolsLog.info "\t\tStarting config backup."
|
212
|
-
# ToolsConfig.config_backup
|
213
|
-
# end
|
214
|
-
# return true
|
215
170
|
end
|
216
171
|
|
217
172
|
|
data/lib/tools/version.rb
CHANGED
data/tools.gemspec
CHANGED
@@ -22,8 +22,10 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency 'rake'
|
23
23
|
spec.add_development_dependency 'yard'
|
24
24
|
|
25
|
+
spec.add_runtime_dependency 'addressable', '~> 2.6.0'
|
25
26
|
spec.add_runtime_dependency 'awesome_print'
|
26
27
|
spec.add_runtime_dependency 'byebug'
|
28
|
+
spec.add_runtime_dependency 'pry-byebug'
|
27
29
|
spec.add_runtime_dependency 'colorize'
|
28
30
|
spec.add_runtime_dependency 'dnsruby'
|
29
31
|
spec.add_runtime_dependency 'encrypt'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xyko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: addressable
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.6.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.6.0
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: awesome_print
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +94,20 @@ dependencies:
|
|
80
94
|
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry-byebug
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
112
|
name: colorize
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|