Class: Rscons::Builders::Directory
- Inherits:
-
Rscons::Builder
- Object
- Rscons::Builder
- Rscons::Builders::Directory
- Defined in:
- lib/rscons/builders/directory.rb
Overview
The Directory builder creates a directory.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Rscons::Builder
#build_step, #cache, #env, #preferred_ld, #side_effects, #sources, #target, #vars
Instance Method Summary collapse
-
#initialize(*args) ⇒ Directory
constructor
Construct builder.
-
#run(options) ⇒ Object
Run the builder to produce a build target.
Methods inherited from Rscons::Builder
#depends, extra_path, #finalize_command, name, #name, #print_run_message, #produces, #register_command, #standard_command, #wait_for
Constructor Details
#initialize(*args) ⇒ Directory
Construct builder.
8 9 10 11 |
# File 'lib/rscons/builders/directory.rb', line 8 def initialize(*args) super @install_builder = self.class.name == "InstallDirectory" end |
Instance Method Details
#run(options) ⇒ Object
Run the builder to produce a build target.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rscons/builders/directory.rb', line 14 def run() if File.directory?(@target) true elsif File.exists?(@target) Ansi.write($stderr, :red, "Error: `#{@target}' already exists and is not a directory", :reset, "\n") false else ("Creating directory <target>#{@target}<reset>", nil) @cache.mkdir_p(@target, install: @install_builder) true end end |