Class: Scorm::Command::Create
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#display, #error, #extract_option, #extract_package, #initialize
Constructor Details
This class inherits a constructor from Scorm::Command::Base
Instance Method Details
#index ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/scorm/commands/create.rb', line 3 def index name = args.shift.strip rescue '' raise(CommandFailed, "Invalid package name.") if name == '' FileUtils.mkdir_p(name) Dir.glob(File.join(File.dirname(File.(__FILE__)), '../../../skeleton/*')).each do |file| FileUtils.cp(file, name) display "#{name}/#{File.basename(file)}" end display "Created new SCORM package \"#{name}\"." end |