lib/csd.rb in csd-0.1.5 vs lib/csd.rb in csd-0.1.6
- old
+ new
@@ -1,17 +1,12 @@
-# encoding: utf-8
+#-- encoding: UTF-8
-# Loading vendor libraries
-require 'active_support'
-require 'term/ansicolor'
-
# Loading all files in the subdirectory `csdĀ“
-Dir[File.join(File.dirname(__FILE__), 'csd', '*.rb')].sort.each do |path|
- require "csd/#{File.basename(path, '.rb')}"
-end
+Dir[File.join(File.dirname(__FILE__), 'csd', '*.rb')].sort.each { |path| require "csd/#{File.basename(path, '.rb')}" }
# The CSD namespace is given to the entire gem.
+# It stands for Communication Systems Design (see http://www.tslab.ssvl.kth.se/csd).
#
module CSD
class << self
# This String holds the name of the executable the user used to bootstrap this gem
@@ -24,16 +19,10 @@
Options.parse!
respond_to_incomplete_arguments
Applications.current.instance.send("#{Options.action}".to_sym)
end
- # This method chooses and holds the user interface instance
- #
- def ui
- @@ui ||= CLI.new
- end
-
private
# This method check the arguments the user has provided and terminates the AI with
# some helpful message if the arguments are invalid.
#
@@ -69,12 +58,12 @@
UI.info " Automated Installer assistance for #{Applications.current.human}".green.bold
UI.separator
UI.info " The AI can assist you with the following tasks regarding #{Applications.current.human}: "
OptionParser.new do |opts|
opts.banner = ''
- actions = Applications.current.actions[:public]
- actions << Applications.current.actions[:developer] if Options.developer
+ actions = Applications.current.actions['public']
+ actions << Applications.current.actions['developer'] if Options.developer
actions.flatten.each { |action| opts.list_item(action.keys.first, action.values.first) }
UI.info opts.help
end
UI.separator
UI.info ' To execute the task: '.green.bold + "#{executable} [TASK] #{Applications.current.name}".cyan.bold
@@ -84,6 +73,7 @@
UI.warn "You did not specify a valid task name."
raise Error::Argument::NoAction
end
end
+
end