@@ 105-115 (lines=11) @@ | ||
102 | * |
|
103 | * @param string $path |
|
104 | */ |
|
105 | public function sourceDirectory($path) |
|
106 | { |
|
107 | foreach ($this->allFiles($this->stubbox, $this->makePath($path)) as $stubbox_path) { |
|
108 | if ($this->context->directory) { |
|
109 | $outbox_path = substr($stubbox_path, strlen($this->context->directory) + 1); |
|
110 | } else { |
|
111 | $outbox_path = $stubbox_path; |
|
112 | } |
|
113 | $this->directory(dirname($outbox_path))->file(basename($outbox_path))->source($stubbox_path); |
|
114 | } |
|
115 | } |
|
116 | ||
117 | /** |
|
118 | * Generate sources from templates. |
|
@@ 123-133 (lines=11) @@ | ||
120 | * @param string $path |
|
121 | * @param array $arguments |
|
122 | */ |
|
123 | public function templateDirectory($path, array $arguments = []) |
|
124 | { |
|
125 | foreach ($this->allFiles($this->stubbox, $this->makePath($path)) as $stubbox_path) { |
|
126 | if ($this->context->directory) { |
|
127 | $outbox_path = substr($stubbox_path, strlen($this->context->directory) + 1); |
|
128 | } else { |
|
129 | $outbox_path = $stubbox_path; |
|
130 | } |
|
131 | $this->directory(dirname($outbox_path))->file(basename($outbox_path))->template($stubbox_path, $arguments); |
|
132 | } |
|
133 | } |
|
134 | ||
135 | /** |
|
136 | * Generate blank directory with '.gitkeep'. |