lib/resquire/analyzer.rb in resquire-1.0.1 vs lib/resquire/analyzer.rb in resquire-1.0.2
- old
+ new
@@ -148,13 +148,14 @@
def shuffle_permutations(args = {})
gems = @gems.reject { |gem| @redundant_gems.include? gem }
permutation_count = permutations(gems)
count = 0
gems = gems.permutation.to_a.shuffle
+ template_location = File.dirname(Open3.capture2e("gem which resquire")[0]) + '/template.rb'
gems.each do |gem_group|
print "#{count}/#{permutation_count}\r" if @progress_bar
- redundant_gem, status = Open3.capture2e("ruby ../../lib/template.rb #{gem_group.join(',')}")
+ redundant_gem, status = Open3.capture2e("ruby #{template_location} #{gem_group.join(',')}")
@redundant_gems << redundant_gem unless status.success?
break unless status.success?
count += 1
end
find_redundant_gems(args) unless count == permutation_count
@@ -164,12 +165,13 @@
# We can iterate over the permutations, which can make things faster.
def iterate_permutations(args = {})
gems = @gems.reject { |gem| @redundant_gems.include? gem }
permutation_count = permutations(gems)
count = 0
+ template_location = File.dirname(Open3.capture2e("gem which resquire")[0]) + '/template.rb'
gems.permutation.each do |gem_group|
print "#{count}/#{permutation_count}\r" if @progress_bar
- redundant_gem, status = Open3.capture2e("ruby ../../lib/template.rb #{gem_group.join(',')}")
+ redundant_gem, status = Open3.capture2e("ruby #{template_location} #{gem_group.join(',')}")
@redundant_gems << redundant_gem unless status.success?
break unless status.success?
count += 1
end
find_redundant_gems(args) unless count == permutation_count