File: Rakefile

package info (click to toggle)
ruby-fast-gettext 4.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 676 kB
  • sloc: ruby: 3,209; makefile: 4
file content (43 lines) | stat: -rw-r--r-- 1,041 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# frozen_string_literal: true

require 'bundler/setup'
require 'bundler/gem_tasks'

require 'bump/tasks'
Bump.replace_in_default = Dir["gemfiles/*.lock"]

task default: :spec

desc "Run tests"
task :spec do
  sh "forking-test-runner spec --rspec --merge-coverage --quiet --no-fixtures --no-ar"
end

desc "Benchmark different translation frameworks"
task :benchmark do
  puts "Running on #{RUBY_DESCRIPTION}"
  Bundler.with_original_env do
    ["baseline", "ideal", "fast_gettext", "original", "i18n_simple"].each do |bench|
      sh "ruby ./benchmark/#{bench}.rb"
      puts
    end
  end
end

desc "Show namespace differences between translation frameworks"
task :namespaces do
  sh "ruby benchmark/namespace/original.rb"
  sh "ruby benchmark/namespace/fast_gettext.rb"
end

desc "Check code against ruby style guide"
task :rubocop do
  sh "rubocop"
end

desc "Bundle all CMD="
task :bundle_all do
  Dir["gemfiles/*.gemfile"].each do |gemfile|
    Bundler.with_original_env { sh "BUNDLE_GEMFILE=#{gemfile} bundle #{ENV["CMD"]}" }
  end
end