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, #to_extension_name

Constructor Details

#initialize(args = []) ⇒ Install

Returns a new instance of Install.

Raises:

  • (ArgumentError)


260
261
262
263
264
265
266
267
268
# File 'lib/radiant/extension/script.rb', line 260

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 && extension.install
  end
end