Skip to content
All gists
Back to GitHub
Sign in
Sign up
Sign in
Sign up
{{ message }}
Instantly share code, notes, and snippets.
Adam Griffin
adamwgriffin
Moxi Works
Seattle, WA
moxiworks.com
View GitHub Profile
Sort:
Recently created
Sort options
Recently created
Least recently created
Recently updated
Least recently updated
All gists
1
Starred
16
Sort:
Recently created
Sort options
Recently created
Least recently created
Recently updated
Least recently updated
1 file
0 forks
1 comment
1 star
adamwgriffin
/
rmempty.rb
Created
Apr 4, 2014
A one-liner to recursively delete empty directories with Ruby
View
rmempty.rb
Dir
[
'**/'
]
.
reverse_each
{
|
d
|
Dir
.
rmdir
d
if
Dir
.
entries
(
d
)
.
size
==
2
}
You can’t perform that action at this time.
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.