We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0eb2bf1 commit fea8e03Copy full SHA for fea8e03
lib/rails_stats/tasks.rb
@@ -1,13 +1,14 @@
1
desc "Report code statistics (KLOCs, etc) from the current (or given) application"
2
-task :stats, [:path] do |t, args|
+task :stats, [:path, :format] do |t, args|
3
Rake::Task["stats"].clear # clear out normal one if there
4
require 'rails_stats/all'
5
6
path = args[:path]
7
path = Rails.root.to_s if defined?(Rails)
8
+ fmt = args[:format] || ""
9
raise "no path given for stats" unless path
10
11
root_directory = File.absolute_path(path)
12
puts "\nDirectory: #{root_directory}\n\n" if args[:path]
- RailsStats::CodeStatistics.new(root_directory).to_s
13
+ RailsStats::CodeStatistics.new(root_directory, format: fmt).to_s
14
end
0 commit comments