Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
432afa2c
Commit
432afa2c
authored
Jan 06, 2015
by
Julian Aron Prenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly implement directory tasks
parent
dc39d229
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
minirake
minirake
+10
-7
No files found.
minirake
View file @
432afa2c
...
@@ -237,7 +237,8 @@ module MiniRake
...
@@ -237,7 +237,8 @@ module MiniRake
# Time stamp for file task.
# Time stamp for file task.
def
timestamp
def
timestamp
File
::
stat
(
name
.
to_s
).
mtime
stat
=
File
::
stat
(
name
.
to_s
)
stat
.
directory?
?
Time
.
at
(
0
)
:
stat
.
mtime
end
end
end
end
...
@@ -254,12 +255,14 @@ module MiniRake
...
@@ -254,12 +255,14 @@ module MiniRake
# Declare a set of files tasks to create the given directories on
# Declare a set of files tasks to create the given directories on
# demand.
# demand.
def
directory
(
dir
)
def
directory
(
args
,
&
block
)
path
=
[]
MiniRake
::
FileTask
.
define_task
(
args
)
do
|
t
|
Sys
.
split_all
(
dir
).
each
do
|
p
|
block
.
call
(
t
)
unless
block
.
nil?
path
<<
p
dir
=
args
.
is_a?
(
Hash
)
?
args
.
keys
.
first
:
args
FileTask
.
define_task
(
File
.
join
(
path
))
do
|
t
|
dir
.
split
(
File
::
SEPARATOR
).
reject
(
&
:empty?
).
inject
(
""
)
do
|
acc
,
part
|
Sys
.
makedirs
(
t
.
name
)
(
acc
+
File
::
SEPARATOR
+
part
).
tap
do
|
d
|
Dir
.
mkdir
(
d
)
unless
File
.
exists?
d
end
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment