lib/csd/container.rb in csd-0.2.2 vs lib/csd/container.rb in csd-0.3.0
- old
+ new
@@ -10,39 +10,42 @@
return choose_ui if Options.testmode
# Otherwise we choose and cache the UI here
@@ui ||= choose_ui
end
- # This method chooses an user interface instance according to the Options and returns a new instance of it.
+ # This method chooses and holds the command helper instance.
#
- def choose_ui
- if Options.silent
- UserInterface::Silent.new
- else
- UserInterface::CLI.new
- end
- end
-
- # This method chooses and holds the command execution instance.
- #
def cmd
@@cmd ||= Commands.new
end
-
- # This holds the container for paths.
+
+ # This method chooses and holds the container for paths.
#
def path
@@path ||= PathContainer.new
end
-
- # This holds the container for argument options.
+
+ # This method chooses and holds the container for argument options.
#
def options
@@options ||= OptionsParser.new
end
+
+ private
+
+ # This method chooses an user interface instance according to the Options and returns a new instance of it.
+ #
+ def choose_ui
+ if Options.silent
+ UserInterface::Silent.new
+ else
+ UserInterface::CLI.new
+ end
+ end
+
end
-
+
# A wrapper for the UI class to be able to run all methods as class methods.
#
class UI
def self.method_missing(meth, *args, &block)
::CSD.ui.send(meth, *args, &block)
@@ -75,6 +78,7 @@
end
def self.method_missing(meth, *args, &block)
::CSD.options.send(meth, *args, &block)
end
end
+
end
\ No newline at end of file