Sha256: 5352b52e528baea6e5af2ee12826e45337dfb009b6840bdbbb6d29f0702a96b6
Contents?: true
Size: 1.19 KB
Versions: 24
Compression:
Stored size: 1.19 KB
Contents
# frozen_string_literal: true require "bundler/gem_tasks" require "rufo" require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) require "rubocop/rake_task" RuboCop::RakeTask.new(:rubocop) do |task| task.options = %w[--parallel] end desc "Alias for `rake rufo:run`" task :format => ["rufo:run"] namespace :rufo do require "rufo" def rufo_command(*switches, rake_args) files_or_dirs = rake_args[:files_or_dirs] || "." args = switches + files_or_dirs.split(" ") Rufo::Command.run(args) end desc "Format Ruby code in current directory" task :run, [:files_or_dirs] do |_task, rake_args| rufo_command(rake_args) end desc "Check that no formatting changes are produced" task :check, [:files_or_dirs] do |_task, rake_args| rufo_command("--check", rake_args) end end desc "Generate test protobuf stubs" task :gen_test_proto do system "grpc_tools_ruby_protoc --ruby_out=. --grpc_out=. spec/support/grpc_service/test.proto" Rufo::Command.run(["spec/support/grpc_service/test_pb.rb", "spec/support/grpc_service/test_services_pb.rb"]) end task :fix => %w[rufo:run rubocop:auto_correct] task :verify => %w[spec rufo:check rubocop] task :default => %w[verify build]
Version data entries
24 entries across 24 versions & 1 rubygems