Class: Teapot::Build::Targets::Directory
- Inherits:
-
Teapot::Build::Target
- Object
- Teapot::Build::Target
- Teapot::Build::Targets::Directory
- Defined in:
- lib/teapot/build/targets/files.rb,
lib/teapot/build/targets/library.rb,
lib/teapot/build/targets/directory.rb,
lib/teapot/build/targets/executable.rb,
lib/teapot/build/targets/application.rb
Direct Known Subclasses
Constant Summary collapse
- BUILD_FILE =
"build.rb"
Instance Attribute Summary collapse
-
#targets ⇒ Object
readonly
Returns the value of attribute targets.
Attributes inherited from Teapot::Build::Target
Instance Method Summary collapse
- #<<(target) ⇒ Object
- #add_application(*args, &block) ⇒ Object
- #add_directory(path) ⇒ Object
- #compile_executable(*args, &block) ⇒ Object
- #compile_library(*args, &block) ⇒ Object
- #copy_files(*args, &block) ⇒ Object
- #copy_headers(*args, &block) ⇒ Object
- #execute(command, *arguments) ⇒ Object
-
#initialize(parent, root = nil) ⇒ Directory
constructor
A new instance of Directory.
- #root ⇒ Object
Methods inherited from Teapot::Build::Target
Constructor Details
Instance Attribute Details
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
40 41 42 |
# File 'lib/teapot/build/targets/directory.rb', line 40 def targets @targets end |
Instance Method Details
#<<(target) ⇒ Object
42 43 44 |
# File 'lib/teapot/build/targets/directory.rb', line 42 def << (target) @targets << target end |
#add_application(*args, &block) ⇒ Object
49 50 51 |
# File 'lib/teapot/build/targets/application.rb', line 49 def add_application(*args, &block) self << Application.target(self, *args, &block) end |
#add_directory(path) ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/teapot/build/targets/directory.rb', line 46 def add_directory(path) directory = Directory.target(self, @root + path) build_path = (directory.root + BUILD_FILE).to_s directory.instance_eval(File.read(build_path), build_path) self << directory end |
#compile_executable(*args, &block) ⇒ Object
46 47 48 |
# File 'lib/teapot/build/targets/executable.rb', line 46 def compile_executable(*args, &block) self << Executable.target(self, *args, &block) end |
#compile_library(*args, &block) ⇒ Object
100 101 102 |
# File 'lib/teapot/build/targets/library.rb', line 100 def compile_library(*args, &block) self << Library.target(self, *args, &block) end |
#copy_files(*args, &block) ⇒ Object
72 73 74 |
# File 'lib/teapot/build/targets/files.rb', line 72 def copy_files(*args, &block) self << Files.target(self, *args, &block) end |
#copy_headers(*args, &block) ⇒ Object
76 77 78 |
# File 'lib/teapot/build/targets/files.rb', line 76 def copy_headers(*args, &block) self << Headers.target(self, *args, &block) end |
#execute(command, *arguments) ⇒ Object
55 56 57 58 59 |
# File 'lib/teapot/build/targets/directory.rb', line 55 def execute(command, *arguments) @targets.each do |target| target.execute(command, *arguments) end end |