Sha256: cc8c9b0b55ad40390a954a4d2a068f047a9094fd9e546afd118cdebc3e37fdd1

Contents?: true

Size: 756 Bytes

Versions: 7

Compression:

Stored size: 756 Bytes

Contents

# Statistics tasks.
#
desc "Analyzes indexes (index, category optional)."
task :analyze, [:index, :category] => :'stats:prepare' do |_, options|
  index, category = options.index, options.category

  specific = Indexes
  specific = specific[index]    if index
  specific = specific[category] if category

  statistics = Statistics.new

  begin
    statistics.analyze specific
  rescue StandardError
    puts "\n\033[31mNote: rake analyze needs prepared indexes. Run rake index first.\033[m\n\n"
    raise
  end

  puts statistics
end

task :stats => :'stats:prepare' do
  stats = Statistics.new
  puts stats.application
end

namespace :stats do

  task :prepare => :application do
    require File.expand_path('../../picky/statistics', __FILE__)
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
picky-3.0.0 lib/tasks/statistics.rake
picky-3.0.0.pre5 lib/tasks/statistics.rake
picky-3.0.0.pre4 lib/tasks/statistics.rake
picky-3.0.0.pre3 lib/tasks/statistics.rake
picky-3.0.0.pre2 lib/tasks/statistics.rake
picky-3.0.0.pre1 lib/tasks/statistics.rake
picky-2.7.0 lib/tasks/statistics.rake