Sha256: 45600ccbd1a4c878fdd395ab27854ccb2b4cccfdd5c8ff69bf9c6f317af158a1

Contents?: true

Size: 1.7 KB

Versions: 12

Compression:

Stored size: 1.7 KB

Contents

require 'bundler/gem_tasks'

task :default => [:compile, :spec, :rubocop]

require 'rake/extensiontask'
Rake::ExtensionTask.new('attribute_builder') do |ext|
  ext.lib_dir = 'lib/faml'
end

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)

require 'rubocop/rake_task'
RuboCop::RakeTask.new(:rubocop)

task :benchmark => ['benchmark:rendering', 'benchmark:compiling']

namespace :benchmark do
  task :rendering => ['benchmark:rendering:haml', 'benchmark:rendering:attributes', 'benchmark:rendering:slim']
  namespace :rendering do
    desc "Run rendering benchmark with Haml's standard template"
    task :haml do
      haml_gem = Gem::Specification.find_by_name('haml')
      standard_haml_path = File.join(haml_gem.gem_dir, 'test', 'templates', 'standard.haml')
      sh 'ruby', 'benchmark/rendering.rb', standard_haml_path
    end

    desc 'Run rendering benchmark for attribute builder'
    task :attributes do
      sh 'ruby', 'benchmark/rendering.rb', 'benchmark/attribute_builder.haml', 'benchmark/attribute_builder.slim'
    end

    desc "Run slim's rendering benchmark"
    task :slim do
      sh 'ruby', 'benchmark/slim.rb'
    end
  end

  task :compiling => ['benchmark:compiling:haml', 'benchmark:compiling:slim']
  namespace :compiling do
    desc "Run compiling benchmark with Haml's standard template"
    task :haml do
      haml_gem = Gem::Specification.find_by_name('haml')
      standard_haml_path = File.join(haml_gem.gem_dir, 'test', 'templates', 'standard.haml')
      sh 'ruby', 'benchmark/compiling.rb', standard_haml_path
    end

    desc "Run slim's compiling benchmark"
    task :slim do
      sh 'ruby', 'benchmark/compiling.rb', 'benchmark/view.haml', 'benchmark/view.slim'
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
faml-0.6.3 Rakefile
faml-0.6.2 Rakefile
faml-0.6.1 Rakefile
faml-0.6.0 Rakefile
faml-0.5.1 Rakefile
faml-0.5.0 Rakefile
faml-0.4.2 Rakefile
faml-0.4.1 Rakefile
faml-0.4.0 Rakefile
faml-0.3.6 Rakefile
faml-0.3.5 Rakefile
faml-0.3.4 Rakefile