lib/phare/git.rb in phare-0.5.2 vs lib/phare/git.rb in phare-0.6
- old
+ new
@@ -8,17 +8,17 @@
def changed?
@options[:diff] && changes.any?
end
def changes
- @changes ||= Phare.system_output('git status -s').split("\n").reduce([]) do |memo, diff|
+ @changes ||= Phare.system_output('git status -s').split("\n").each_with_object([]) do |diff, memo|
filename = diff.split(' ').last
if diff =~ /^[^D]{2}/ && @extensions.include?(File.extname(filename))
memo << filename
+ else
+ next
end
-
- memo
end
end
end
end