Sha256: 207e2deb7269344b41ccb14a6fc9d24f392b16e3ef2dfe66810a435c1b52f997

Contents?: true

Size: 941 Bytes

Versions: 24

Compression:

Stored size: 941 Bytes

Contents

METRICS_FILES = FileList['lib/**/*.rb']

task :metrics => [:cane, :flog, :flay]

task :flog, [:all] do |t, args|
  flags = args.all ? "--all" : ""
  flags = "-m #{flags}"
  Bundler.with_clean_env do
    puts "\nFLOG:"
    sh "flog #{flags} #{METRICS_FILES}" do |status, flag|
      if status.nil?
        puts "Install flog with: 'gem install flog'"
      end
    end
  end
end

task :flay do
  Bundler.with_clean_env do
    puts "\nFLAY:"
    sh "flay #{METRICS_FILES}" do |status, flag|
      if status.nil?
        puts "Install flay with: 'gem install flay'"
      end
    end
  end
end

task :cane, [:max_line] do |t, args|
  max_line = args.max_line || 90
  Bundler.with_clean_env do
    puts "\nCANE:"
    sh "cane --style-measure #{max_line} --no-doc" do |status, flag|
      if status.nil?
        puts "DBG: [status, flag]=#{[status, flag].inspect}"
        puts "Install cane with: 'gem install cane'"
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
flexmock-2.4.2 rakelib/metrics.rake
flexmock-3.0.1 rakelib/metrics.rake
flexmock-2.4.1 rakelib/metrics.rake
flexmock-3.0.0 rakelib/metrics.rake
flexmock-2.4.0 rakelib/metrics.rake
flexmock-2.3.8 rakelib/metrics.rake
flexmock-2.3.6 rakelib/metrics.rake
flexmock-2.3.5 rakelib/metrics.rake
flexmock-2.3.4 rakelib/metrics.rake
flexmock-2.3.3 rakelib/metrics.rake
flexmock-2.3.2 rakelib/metrics.rake
flexmock-2.3.1 rakelib/metrics.rake
flexmock-2.3.0 rakelib/metrics.rake
flexmock-2.2.1 rakelib/metrics.rake
flexmock-2.2.0 rakelib/metrics.rake
flexmock-2.1.0 rakelib/metrics.rake
flexmock-2.0.6 rakelib/metrics.rake
flexmock-2.0.5 rakelib/metrics.rake
flexmock-2.0.4 rakelib/metrics.rake
flexmock-2.0.3 rakelib/metrics.rake