Class: BuildTool::ModuleActions::Base
- Inherits:
-
Object
- Object
- BuildTool::ModuleActions::Base
- Defined in:
- lib/build-tool/command_actions.rb
Direct Known Subclasses
Clean, Clone, Configure, Fetch, Install, Make, Rebase, Reconfigure, RemoveBuildDirectory, RemoveSourceDirectory
Instance Method Summary collapse
- #do ⇒ Object
-
#initialize(command, prio, type, mod) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(command, prio, type, mod) ⇒ Base
Returns a new instance of Base.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/build-tool/command_actions.rb', line 14 def initialize( command, prio, type, mod ) @command = command @level = nil @logdir = command.log_directory.join( mod.name ) @type = type @prio = prio @filename = "#{prio.to_s}_#{type.to_s}" @logfile = @logdir.join( @filename ) @module = mod end |
Instance Method Details
#do ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/build-tool/command_actions.rb', line 25 def do # Make sure the directory for this module exists FileUtils.mkdir_p( @logdir ) if ! $noop oldlevel = Logging.appenders['stdout'].level if @level Logging.appenders['stdout'].level = @level end # Open the logfile and then execute the command begin while_logging do execute end ensure Logging.appenders['stdout'].level = oldlevel end end |