reindent pfiles.rb
This commit is contained in:
parent
d8a0d1e3d8
commit
397f9369d6
@ -10,7 +10,7 @@ indent_size=4
|
|||||||
[{ignore.txt,*.csv,m4/*}]
|
[{ignore.txt,*.csv,m4/*}]
|
||||||
insert_final_newline=false
|
insert_final_newline=false
|
||||||
[*.rb]
|
[*.rb]
|
||||||
indent_style=space
|
indent_style=tab
|
||||||
indent_size=4
|
indent_size=4
|
||||||
[*.sh]
|
[*.sh]
|
||||||
indent_style=tab
|
indent_style=tab
|
||||||
|
76
pfiles.rb
76
pfiles.rb
@ -4,53 +4,53 @@
|
|||||||
require 'find'
|
require 'find'
|
||||||
ignore=!File.file?('dat/ignore.txt') ? [] : File.readlines('dat/ignore.txt')
|
ignore=!File.file?('dat/ignore.txt') ? [] : File.readlines('dat/ignore.txt')
|
||||||
if ignore != []
|
if ignore != []
|
||||||
ignore.map! do |i|
|
ignore.map! do |i|
|
||||||
"in/#{i}"
|
"in/#{i}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
class Enumerator
|
class Enumerator
|
||||||
def collect
|
def collect
|
||||||
out=Array.new
|
out=Array.new
|
||||||
for i in self
|
for i in self
|
||||||
out.push(i)
|
out.push(i)
|
||||||
end
|
end
|
||||||
return out
|
return out
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
list=Find.find('in')
|
list=Find.find('in')
|
||||||
l=list.collect
|
l=list.collect
|
||||||
case ARGV.first
|
case ARGV.first
|
||||||
when "doc"
|
when "doc"
|
||||||
for i in l do
|
for i in l do
|
||||||
next if ignore.include?(i) or /\.v.html/.match?(i)
|
next if ignore.include?(i) or /\.v.html/.match?(i)
|
||||||
if /\.(txti|org|md|html)$/.match?(i)
|
if /\.(txti|org|md|html)$/.match?(i)
|
||||||
print i
|
print i
|
||||||
print ' ' unless i==l.last
|
print ' ' unless i==l.last
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
when "sass"
|
when "sass"
|
||||||
for i in l do
|
for i in l do
|
||||||
next if ignore.include?(i)
|
next if ignore.include?(i)
|
||||||
if /\.s[ac]ss$/.match?(i)
|
if /\.s[ac]ss$/.match?(i)
|
||||||
print i
|
print i
|
||||||
print ' ' unless i==l.last
|
print ' ' unless i==l.last
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
when "dir"
|
when "dir"
|
||||||
for i in l do
|
for i in l do
|
||||||
next if ignore.include?(i)
|
next if ignore.include?(i)
|
||||||
if File.directory?(i)
|
if File.directory?(i)
|
||||||
print i
|
print i
|
||||||
print ' ' unless i==l.last
|
print ' ' unless i==l.last
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
when "rest"
|
when "rest"
|
||||||
for i in l do
|
for i in l do
|
||||||
next if ignore.include?(i)
|
next if ignore.include?(i)
|
||||||
unless /\.(s[ac]ss|txti|org|md)$/.match?(i) or File.directory(i)
|
unless /\.(s[ac]ss|txti|org|md)$/.match?(i) or File.directory(i)
|
||||||
print i
|
print i
|
||||||
print ' ' unless i==l.last
|
print ' ' unless i==l.last
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user