Class: Radiant::Extension::Script::Install

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/radiant/extension/script.rb

Instance Attribute Summary

Attributes included from Util

#extension, #extension_name

Instance Method Summary collapse

Methods included from Util

#extension_paths, #find_extension, #installed?, #load_extensions, #registered?, #to_extension_name

Constructor Details

#initialize(args = []) ⇒ Install

Returns a new instance of Install.

Raises:

  • (ArgumentError)


301
302
303
304
305
306
307
308
309
310
311
312
313
314
# File 'lib/radiant/extension/script.rb', line 301

def initialize(args=[])
 raise ArgumentError, "You must specify an extension to install." if args.blank?
 self.extension_name = to_extension_name(args.shift)
 if installed?
   puts "#{extension_name} is already installed."
 else
   find_extension
 end
 if registered?
   extension.install
 else
   raise ArgumentError, "#{extension_name} is not available in the registry."
 end
end