simp-metadata 0.4.4 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +494 -0
  3. data/Rakefile +19 -22
  4. data/exe/simp-install +1 -1
  5. data/exe/simp-media +1 -1
  6. data/exe/simp-metadata +1 -1
  7. data/lib/simp/install/command.rb +34 -35
  8. data/lib/simp/media.rb +0 -1
  9. data/lib/simp/media/command.rb +34 -35
  10. data/lib/simp/media/engine.rb +29 -35
  11. data/lib/simp/media/type.rb +1 -2
  12. data/lib/simp/media/type/base.rb +12 -4
  13. data/lib/simp/media/type/control-repo.rb +96 -107
  14. data/lib/simp/media/type/internet.rb +8 -8
  15. data/lib/simp/media/type/iso.rb +0 -1
  16. data/lib/simp/media/type/local.rb +18 -19
  17. data/lib/simp/media/type/tar.rb +37 -37
  18. data/lib/simp/metadata.rb +240 -258
  19. data/lib/simp/metadata/bootstrap_source.rb +93 -89
  20. data/lib/simp/metadata/buildinfo.rb +23 -23
  21. data/lib/simp/metadata/command.rb +60 -58
  22. data/lib/simp/metadata/commands.rb +1 -1
  23. data/lib/simp/metadata/commands/base.rb +28 -25
  24. data/lib/simp/metadata/commands/clone.rb +3 -5
  25. data/lib/simp/metadata/commands/component.rb +128 -90
  26. data/lib/simp/metadata/commands/delete.rb +4 -5
  27. data/lib/simp/metadata/commands/pry.rb +1 -3
  28. data/lib/simp/metadata/commands/release.rb +22 -23
  29. data/lib/simp/metadata/commands/releases.rb +1 -3
  30. data/lib/simp/metadata/commands/save.rb +10 -13
  31. data/lib/simp/metadata/commands/script.rb +11 -14
  32. data/lib/simp/metadata/commands/search.rb +15 -20
  33. data/lib/simp/metadata/commands/set-write-url.rb +1 -3
  34. data/lib/simp/metadata/commands/set-write.rb +1 -3
  35. data/lib/simp/metadata/commands/update.rb +9 -10
  36. data/lib/simp/metadata/component.rb +310 -154
  37. data/lib/simp/metadata/components.rb +15 -16
  38. data/lib/simp/metadata/engine.rb +31 -39
  39. data/lib/simp/metadata/fake_uri.rb +2 -0
  40. data/lib/simp/metadata/location.rb +99 -105
  41. data/lib/simp/metadata/locations.rb +19 -21
  42. data/lib/simp/metadata/release.rb +30 -39
  43. data/lib/simp/metadata/releases.rb +14 -15
  44. data/lib/simp/metadata/source.rb +69 -79
  45. data/lib/simp/metadata/version.rb +9 -0
  46. data/spec/simp/media/command_spec.rb +4 -5
  47. data/spec/simp/media/engine_spec.rb +14 -14
  48. data/spec/simp/media/type/control_repo_spec.rb +10 -12
  49. data/spec/simp/media/type/internet_spec.rb +11 -11
  50. data/spec/simp/media/type/iso_spec.rb +6 -7
  51. data/spec/simp/media/type/local_spec.rb +6 -8
  52. data/spec/simp/media/type/tar_spec.rb +6 -8
  53. data/spec/simp/metadata/buildinfo_spec.rb +19 -17
  54. data/spec/simp/metadata/commands/clone_spec.rb +4 -3
  55. data/spec/simp/metadata/component_spec.rb +43 -54
  56. data/spec/simp/metadata/engine_spec.rb +38 -41
  57. data/spec/simp/metadata/release_spec.rb +72 -79
  58. data/spec/simp/metadata/source_spec.rb +8 -6
  59. data/spec/simp/metadata_spec.rb +95 -98
  60. data/spec/spec_helper.rb +33 -21
  61. metadata +5 -3
@@ -8,34 +8,31 @@ require 'openssl'
8
8
  require 'json'
9
9
  require 'simp/metadata/engine'
10
10
  require 'simp/metadata/fake_uri'
11
-
12
11
  require 'simp/metadata/source'
13
12
  require 'simp/metadata/bootstrap_source'
14
-
15
13
  require 'simp/metadata/releases'
16
14
  require 'simp/metadata/release'
17
-
18
15
  require 'simp/metadata/components'
19
16
  require 'simp/metadata/component'
20
17
  require 'simp/metadata/buildinfo'
21
-
22
18
  require 'simp/metadata/locations'
23
19
  require 'simp/metadata/location'
20
+ require 'simp/metadata/version'
24
21
 
25
22
  module Simp
26
23
  module Metadata
27
-
28
24
  def self.directory_name(component, options)
29
- if (options["target"] != nil)
30
- basedir = options["target"]
31
- else
25
+ if options['target'].nil?
32
26
  raise "Must specify 'target'"
27
+ else
28
+ basedir = options['target']
33
29
  end
30
+
34
31
  case component.class.to_s
35
- when "String"
36
- "#{basedir}/#{component}"
37
- when "Simp::Metadata::Component"
38
- "#{basedir}/#{component.output_filename}"
32
+ when 'String'
33
+ "#{basedir}/#{component}"
34
+ when 'Simp::Metadata::Component'
35
+ "#{basedir}/#{component.output_filename}"
39
36
  end
40
37
  end
41
38
 
@@ -45,290 +42,277 @@ module Simp
45
42
  directory_name = self.directory_name(component, options)
46
43
  retval = {}
47
44
  case component.class.to_s
48
- when "String"
49
- retval["path"] = self.directory_name(component, options)
50
- # XXX: ToDo We can bootstrap this with a hard coded source in the simp engine
51
- bootstrapped_components = {
52
- "simp-metadata" => {
53
- "url" => "https://github.com/simp/simp-metadata",
54
- "method" => "git"
55
- },
56
- "enterprise-metadata" => {
57
- "url" => "simp-enterprise:///enterprise-metadata?version=master&filetype=tgz",
58
- "method" => "file",
59
- "extract" => true,
60
- },
45
+ when 'String'
46
+ retval['path'] = self.directory_name(component, options)
47
+ # XXX: ToDo We can bootstrap this with a hard coded source in the simp engine
48
+ bootstrapped_components = {
49
+ 'simp-metadata' => {
50
+ 'url' => 'https://github.com/simp/simp-metadata',
51
+ 'method' => 'git'
52
+ },
53
+ 'enterprise-metadata' => {
54
+ 'url' => 'simp-enterprise:///enterprise-metadata?version=master&filetype=tgz',
55
+ 'method' => 'file',
56
+ 'extract' => true
61
57
  }
62
- # All this should be removed and be based on component.file_type
63
- componentspec = bootstrapped_components[component]
64
- if (componentspec["extract"] == true)
65
- tarball = "#{directory_name}.tgz"
66
- fetch_from_url(componentspec, tarball, nil, options)
67
- unless Dir.exists?(retval["path"])
68
- Dir.mkdir(retval["path"])
69
- end
70
- `tar -xvpf #{tarball} -C #{retval["path"]}`
71
- else
72
- fetch_from_url(componentspec, retval["path"], nil, options)
73
- end
74
- when "Simp::Metadata::Component"
75
- retval["path"] = directory_name
76
- if (options["url"])
77
- location = component.primary
78
- location.url = options["url"]
79
- urlspec = location
80
- location.method = "git"
81
- else
82
- urlspec = component.primary
83
- end
84
- fetch_from_url(urlspec, retval["path"], component, options)
58
+ }
59
+ # All this should be removed and be based on component.file_type
60
+ componentspec = bootstrapped_components[component]
61
+ if componentspec['extract']
62
+ tarball = "#{directory_name}.tgz"
63
+ fetch_from_url(componentspec, tarball, nil, options)
64
+ Dir.mkdir(retval['path']) unless Dir.exist?(retval['path'])
65
+ `tar -xvpf #{tarball} -C #{retval['path']}`
85
66
  else
86
- raise "component.class=#{component.class.to_s}, #{component.class.to_s} is not in ['String', 'Simp::Metadata::Component']"
67
+ fetch_from_url(componentspec, retval['path'], nil, options)
68
+ end
69
+ when 'Simp::Metadata::Component'
70
+ retval['path'] = directory_name
71
+ if options['url']
72
+ location = component.primary
73
+ location.url = options['url']
74
+ urlspec = location
75
+ location.method = 'git'
76
+ else
77
+ urlspec = component.primary
78
+ end
79
+ fetch_from_url(urlspec, retval['path'], component, options)
80
+ else
81
+ raise "component.class=#{component.class}, #{component.class} is not in ['String', 'Simp::Metadata::Component']"
87
82
  end
88
- return retval
83
+ retval
89
84
  end
90
85
 
91
86
  def self.uri(url)
92
87
  case url
93
- when /git@/
94
- uri = Simp::Metadata::FakeURI.new(uri)
95
- uri.scheme = "ssh"
96
- uri
97
- else
98
- URI(url)
88
+ when /git@/
89
+ uri = Simp::Metadata::FakeURI.new(uri)
90
+ uri.scheme = 'ssh'
91
+ uri
92
+ else
93
+ URI(url)
99
94
  end
100
95
  end
101
96
 
102
97
  def self.fetch_from_url(urlspec, target, component = nil, options)
103
98
  case urlspec.class.to_s
104
- when "Simp::Metadata::Location"
105
- url = urlspec.url
106
- uri = uri(url)
107
- method = urlspec.method
108
- when "Hash"
109
- url = urlspec["url"]
110
- uri = uri(urlspec["url"])
111
- if (urlspec.key?("method"))
112
- method = urlspec["method"]
99
+ when 'Simp::Metadata::Location'
100
+ url = urlspec.url
101
+ uri = uri(url)
102
+ method = urlspec.method
103
+ when 'Hash'
104
+ url = urlspec['url']
105
+ uri = uri(urlspec['url'])
106
+ if urlspec.key?('method')
107
+ method = urlspec['method']
108
+ else
109
+ # XXX ToDo remove once the upstream simp-metadata has been updated so type != method
110
+ if urlspec.key?('type')
111
+ method = if urlspec['type'] == 'git'
112
+ 'git'
113
+ else
114
+ 'file'
115
+ end
113
116
  else
114
- # XXX ToDo remove once the upstream simp-metadata has been updated so type != method
115
- if (urlspec.key?("type"))
116
- if (urlspec["type"] == "git")
117
- method = "git"
118
- else
119
- method = "file"
120
- end
121
- else
122
- method = "file"
123
- end
117
+ method = 'file'
124
118
  end
125
- when "String"
126
- url = urlspec
127
- uri = uri(urlspec)
128
- method = "file"
119
+ end
120
+ when 'String'
121
+ url = urlspec
122
+ uri = uri(urlspec)
123
+ method = 'file'
129
124
  end
125
+
130
126
  case method
131
- when "git"
132
- case uri.scheme
133
- when "simp"
134
- fetch_simp_enterprise(url, target, component, urlspec, options)
135
- when "simp-enterprise"
136
- fetch_simp_enterprise(url, target, component, urlspec, options)
137
- else
138
- unless (Dir.exists?(target))
139
- info("Cloning from #{url}")
140
- run("git clone #{url} #{target}")
141
- else
142
- Dir.chdir(target) do
143
- info("Updating from #{url}")
144
- run("git pull origin")
145
- end
146
- end
147
- end
148
- when "file"
149
- case uri.scheme
150
- when "simp"
151
- fetch_simp_enterprise(url, target, component, urlspec, options)
152
- when "simp-enterprise"
153
- fetch_simp_enterprise(url, target, component, urlspec, options)
154
- when "http"
155
- fetch_simp_enterprise(url, target, component, urlspec, options)
156
- when "https"
157
- fetch_simp_enterprise(url, target, component, urlspec, options)
158
- else
159
- raise "unsupported url type #{uri.scheme}"
127
+ when 'git'
128
+ case uri.scheme
129
+ when 'simp'
130
+ fetch_simp_enterprise(url, target, component, urlspec, options)
131
+ when 'simp-enterprise'
132
+ fetch_simp_enterprise(url, target, component, urlspec, options)
133
+ else
134
+ if Dir.exist?(target)
135
+ Dir.chdir(target) do
136
+ info("Updating from #{url}")
137
+ run('git pull origin')
138
+ end
139
+ else
140
+ info("Cloning from #{url}")
141
+ run("git clone #{url} #{target}")
160
142
  end
143
+ end
144
+ when 'file'
145
+ case uri.scheme
146
+ when 'simp'
147
+ fetch_simp_enterprise(url, target, component, urlspec, options)
148
+ when 'simp-enterprise'
149
+ fetch_simp_enterprise(url, target, component, urlspec, options)
150
+ when 'http'
151
+ fetch_simp_enterprise(url, target, component, urlspec, options)
152
+ when 'https'
153
+ fetch_simp_enterprise(url, target, component, urlspec, options)
154
+ else
155
+ raise "unsupported url type #{uri.scheme}"
156
+ end
161
157
  end
162
158
  end
163
159
 
164
160
  def self.get_license_data(filename)
165
161
  ret_filename = nil
166
- ret_data = ""
162
+ ret_data = ''
167
163
  license_data = ENV.fetch('SIMP_LICENSE_KEY', nil)
168
- if (license_data != nil)
164
+ if !license_data.nil?
169
165
  # Environment data trumps all
170
166
  ret_data = license_data
171
- if ($simp_license_temp == nil)
167
+ if $simp_license_temp.nil?
172
168
  $simp_license_temp = Tempfile.new('license_data')
173
169
  $simp_license_temp.write(license_data)
174
170
  end
175
171
  ret_filename = $simp_license_temp.path
176
172
  else
177
- if (filename.class.to_s == "String")
178
- # Attempt to load from the filename passed
179
- ret_filename = filename
180
- else
181
- # Try to load from /etc/simp/license.key file
182
- ret_filename = "/etc/simp/license.key"
183
- end
184
- if (File.exists?(ret_filename))
173
+ ret_filename = if filename.class.to_s == 'String'
174
+ # Attempt to load from the filename passed
175
+ filename
176
+ else
177
+ # Try to load from /etc/simp/license.key file
178
+ '/etc/simp/license.key'
179
+ end
180
+ if File.exist?(ret_filename)
185
181
  ret_data = File.read(ret_filename)
186
182
  else
187
- if ($simp_license_temp == nil)
183
+ if $simp_license_temp.nil?
188
184
  $simp_license_temp = Tempfile.new('license_data')
189
- $simp_license_temp.write("")
185
+ $simp_license_temp.write('')
190
186
  end
191
187
  ret_filename = $simp_license_temp.path
192
188
  end
193
189
  end
194
- return ret_filename, ret_data
190
+ [ret_filename, ret_data]
195
191
  end
196
192
 
197
193
  def self.fetch_simp_enterprise(url, destination, component, location = nil, options)
198
- if (location.class.to_s == "Simp::Metadata::Location")
199
- extract = location.extract
200
- else
201
- extract = false
202
- end
194
+ extract = if location.class.to_s == 'Simp::Metadata::Location'
195
+ location.extract
196
+ else
197
+ false
198
+ end
203
199
  uri = uri(url)
200
+
204
201
  case uri.scheme
205
- when "simp-enterprise"
206
- scheme = "https"
207
- host = 'enterprise-download.simp-project.com'
208
- filetype = 'tgz'
209
- if (component != nil)
210
- if (component.extension != "")
211
- filetype = component.extension
212
- end
213
- end
214
- version = 'latest'
215
- if (component != nil)
216
- if (component.version != "")
217
- version = component.version
218
- end
219
- end
220
- if (uri.query != nil)
221
- uri.query.split("&").each do |element|
222
- if (element.class.to_s == "String")
223
- elements = element.split("=")
224
- if (elements.size > 1)
225
- case elements[0]
226
- when "version"
227
- version = elements[1]
228
- when "filetype"
229
- filetype = elements[1]
230
- end
231
- end
232
- end
202
+ when 'simp-enterprise'
203
+ scheme = 'https'
204
+ host = 'enterprise-download.simp-project.com'
205
+ filetype = 'tgz'
206
+ unless component.nil?
207
+ filetype = component.extension if component.extension != ''
208
+ end
209
+ version = 'latest'
210
+ unless component.nil?
211
+ version = component.version if component.version != ''
212
+ end
213
+ unless uri.query.nil?
214
+ uri.query.split('&').each do |element|
215
+ next unless element.class.to_s == 'String'
216
+ elements = element.split('=')
217
+ next unless elements.size > 1
218
+ case elements[0]
219
+ when 'version'
220
+ version = elements[1]
221
+ when 'filetype'
222
+ filetype = elements[1]
233
223
  end
234
224
  end
225
+ end
235
226
 
236
- if (component != nil)
237
- name = "/#{component.name}/#{component.binaryname}"
238
- else
239
- name = "#{uri.path}#{uri.path}#{name}-#{version}.#{filetype}"
240
- end
241
- path = "/products/simp-enterprise#{name}"
242
- when "simp"
243
- scheme = "https"
244
- host = 'download.simp-project.com'
245
- filetype = 'tgz'
246
- if (component != nil)
247
- if (component.extension != "")
248
- filetype = component.extension
249
- end
250
- end
251
- version = 'latest'
252
- if (component != nil)
253
- if (component.version != "")
254
- version = component.version
255
- end
256
- end
257
- if (uri.query != nil)
258
- uri.query.split("&").each do |element|
259
- if (element.class.to_s == "String")
260
- elements = element.split("=")
261
- if (elements.size > 1)
262
- case elements[0]
263
- when "version"
264
- version = elements[1]
265
- when "filetype"
266
- filetype = elements[1]
267
- end
268
- end
269
- end
227
+ name = if !component.nil?
228
+ "/#{component.name}/#{component.binaryname}"
229
+ else
230
+ "#{uri.path}#{uri.path}#{name}-#{version}.#{filetype}"
231
+ end
232
+ path = "/products/simp-enterprise#{name}"
233
+ when 'simp'
234
+ scheme = 'https'
235
+ host = 'download.simp-project.com'
236
+ filetype = 'tgz'
237
+ unless component.nil?
238
+ filetype = component.extension if component.extension != ''
239
+ end
240
+ version = 'latest'
241
+ unless component.nil?
242
+ version = component.version if component.version != ''
243
+ end
244
+ unless uri.query.nil?
245
+ uri.query.split('&').each do |element|
246
+ next unless element.class.to_s == 'String'
247
+ elements = element.split('=')
248
+ next unless elements.size > 1
249
+ case elements[0]
250
+ when 'version'
251
+ version = elements[1]
252
+ when 'filetype'
253
+ filetype = elements[1]
270
254
  end
271
255
  end
272
- if (component != nil)
273
- name = "/#{component.name}/#{component.binaryname}"
274
- else
275
- name = "#{uri.path}#{uri.path}#{name}-#{version}.#{filetype}"
276
- end
277
- path = "/SIMP/assets#{name}"
278
- else
279
- scheme = uri.scheme
280
- host = uri.host
281
- path = uri.path
256
+ end
257
+ name = if !component.nil?
258
+ "/#{component.name}/#{component.binaryname}"
259
+ else
260
+ "#{uri.path}#{uri.path}#{name}-#{version}.#{filetype}"
261
+ end
262
+ path = "/SIMP/assets#{name}"
263
+ else
264
+ scheme = uri.scheme
265
+ host = uri.host
266
+ path = uri.path
282
267
  end
283
268
  port = uri.port ? uri.port : 443
284
269
  http = Net::HTTP.new(host, port)
285
- case scheme
286
- when "https"
287
- http.use_ssl = true
288
- case uri.scheme
289
- when "simp-enterprise"
290
- filename, data = self.get_license_data(options["license"])
291
- unless (filename == nil)
292
- http.ca_file = filename
293
- end
294
- unless (data == nil)
295
- http.cert = OpenSSL::X509::Certificate.new(data)
296
- http.key = OpenSSL::PKey::RSA.new(data)
297
- http.verify_mode = OpenSSL::SSL::VERIFY_PEER
298
- end
299
270
 
300
- debug2("using the following certificate (#{filename}) for client certificate auth: #{http.cert.subject}")
271
+ case scheme
272
+ when 'https'
273
+ http.use_ssl = true
274
+ case uri.scheme
275
+ when 'simp-enterprise'
276
+ filename, data = get_license_data(options['license'])
277
+ http.ca_file = filename unless filename.nil?
278
+ unless data.nil?
279
+ http.cert = OpenSSL::X509::Certificate.new(data)
280
+ http.key = OpenSSL::PKey::RSA.new(data)
281
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
301
282
  end
283
+
284
+ debug2("using the following certificate (#{filename}) for client certificate auth: #{http.cert.subject}")
285
+ end
302
286
  end
303
287
  info("Fetching from #{scheme}://#{host}:#{port}#{path}")
304
288
  req = Net::HTTP::Get.new(path)
305
289
  response = http.request(req)
306
290
  case response.code
307
- when '200'
308
- if (extract == true)
309
- File.open("#{destination}.tgz", 'w') do |f|
310
- f.write response.body
311
- end
312
- FileUtils.mkdir_p(destination)
313
- run("tar -xvpf #{destination}.tgz -C #{destination}")
314
- else
315
- File.open(destination, 'w') do |f|
316
- f.write response.body
317
- end
291
+ when '200'
292
+ if extract
293
+ File.open("#{destination}.tgz", 'w') do |f|
294
+ f.write response.body
318
295
  end
319
- when '302'
320
- fetch_simp_enterprise(response['location'], destination, component, location)
321
- when '301'
322
- fetch_simp_enterprise(response['location'], destination, component, location)
296
+ FileUtils.mkdir_p(destination)
297
+ run("tar -xvpf #{destination}.tgz -C #{destination}")
323
298
  else
324
- $errorcode = response.code.to_i
325
- raise "HTTP Error Code: #{response.code}"
299
+ File.open(destination, 'w') do |f|
300
+ f.write response.body
301
+ end
302
+ end
303
+ when '302'
304
+ fetch_simp_enterprise(response['location'], destination, component, location)
305
+ when '301'
306
+ fetch_simp_enterprise(response['location'], destination, component, location)
307
+ else
308
+ $errorcode = response.code.to_i
309
+ raise "HTTP Error Code: #{response.code}"
326
310
  end
327
311
  end
328
312
 
329
313
  def self.run(command)
330
314
  exitcode = nil
331
- Open3.popen3(command) do |stdin, stdout, stderr, thread|
315
+ Open3.popen3(command) do |_stdin, stdout, stderr, thread|
332
316
  pid = thread.pid
333
317
  Simp::Metadata.debug2(stdout.read.chomp)
334
318
  Simp::Metadata.debug1(stderr.read.chomp)
@@ -340,7 +324,7 @@ module Simp
340
324
  def self.level?(level)
341
325
  setlevel = Simp::Metadata.convert_level($simp_metadata_debug_level)
342
326
  checklevel = Simp::Metadata.convert_level(level)
343
- if (checklevel <= setlevel)
327
+ if checklevel <= setlevel
344
328
  true
345
329
  else
346
330
  false
@@ -349,67 +333,65 @@ module Simp
349
333
 
350
334
  def self.convert_level(level)
351
335
  case level
352
- when 'disabled'
353
- 0
354
- when 'critical'
355
- 1
356
- when 'error'
357
- 2
358
- when 'warning'
359
- 3
360
- when 'info'
361
- 4
362
- when 'debug1'
363
- 5
364
- when 'debug2'
365
- 6
366
- else
367
- 3
336
+ when 'disabled'
337
+ 0
338
+ when 'critical'
339
+ 1
340
+ when 'error'
341
+ 2
342
+ when 'warning'
343
+ 3
344
+ when 'info'
345
+ 4
346
+ when 'debug1'
347
+ 5
348
+ when 'debug2'
349
+ 6
350
+ else
351
+ 3
368
352
  end
369
353
  end
370
354
 
371
355
  def self.print_message(prefix, message)
372
356
  message.split("\n").each do |line|
373
357
  output = "#{prefix}: #{line}"
374
- unless ($simp_metadata_debug_output_disabled == true)
375
- STDERR.puts output
376
- end
358
+ STDERR.puts output unless $simp_metadata_debug_output_disabled
377
359
  end
378
360
  end
379
361
 
380
362
  def self.debug1(message)
381
363
  if Simp::Metadata.level?('debug1')
382
- Simp::Metadata.print_message("DEBUG1", message)
364
+ Simp::Metadata.print_message('DEBUG1', message)
383
365
  end
384
366
  end
385
367
 
386
368
  def self.debug2(message)
387
369
  if Simp::Metadata.level?('debug2')
388
- Simp::Metadata.print_message("DEBUG2", message)
370
+ Simp::Metadata.print_message('DEBUG2', message)
389
371
  end
390
372
  end
391
373
 
392
374
  def self.info(message)
393
375
  if Simp::Metadata.level?('info')
394
- Simp::Metadata.print_message("INFO", message)
376
+ Simp::Metadata.print_message('INFO', message)
395
377
  end
396
378
  end
397
379
 
398
380
  def self.warning(message)
399
381
  if Simp::Metadata.level?('warning')
400
- Simp::Metadata.print_message("WARN", message)
382
+ Simp::Metadata.print_message('WARN', message)
401
383
  end
402
384
  end
403
385
 
404
386
  def self.error(message)
405
387
  if Simp::Metadata.level?('error')
406
- Simp::Metadata.print_message("ERROR", message)
388
+ Simp::Metadata.print_message('ERROR', message)
407
389
  end
408
390
  end
409
391
 
410
392
  def self.critical(message)
411
393
  if Simp::Metadata.level?('critical')
412
- Simp::Metadata.print_message("CRITICAL", message)
394
+ Simp::Metadata.print_message('CRITICAL', message)
413
395
  end
414
396
  end
415
397
  end