2022-01-18 05:20:37 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'bundler/gem_tasks'
|
|
|
|
|
2022-01-18 06:45:40 -05:00
|
|
|
module Bundler
|
|
|
|
class GemHelper
|
|
|
|
def tag_version(*)
|
|
|
|
yield if block_given?
|
|
|
|
end
|
|
|
|
|
|
|
|
def git_push(*); end
|
|
|
|
|
|
|
|
def perform_git_push(*); end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-01-18 05:20:37 -05:00
|
|
|
CLEAN << '.yardoc'
|
|
|
|
CLEAN << 'coverage'
|
|
|
|
CLEAN << 'doc'
|
|
|
|
CLEAN << 'spec/examples.txt'
|
|
|
|
|
|
|
|
desc 'Run default checks'
|
|
|
|
task default: %i[test lint]
|
|
|
|
|
|
|
|
desc 'Run tests'
|
|
|
|
task test: :spec
|
|
|
|
|
|
|
|
desc 'Run code analysis tools'
|
|
|
|
task lint: :rubocop
|
|
|
|
|
|
|
|
desc 'Fix code style (rubocop --auto-correct)'
|
|
|
|
task fix: 'rubocop:auto_correct'
|
|
|
|
|
|
|
|
begin
|
|
|
|
require 'rspec/core/rake_task'
|
|
|
|
RSpec::Core::RakeTask.new
|
|
|
|
rescue LoadError
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
begin
|
|
|
|
require 'rubocop/rake_task'
|
|
|
|
RuboCop::RakeTask.new
|
|
|
|
rescue LoadError
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
begin
|
|
|
|
require 'yard'
|
|
|
|
YARD::Rake::YardocTask.new
|
|
|
|
rescue LoadError
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
2022-01-18 08:03:19 -05:00
|
|
|
begin
|
|
|
|
require 'rake/extensiontask'
|
2022-01-18 11:47:09 -05:00
|
|
|
Rake::ExtensionTask.new 'default' do |ext|
|
2022-01-18 08:03:19 -05:00
|
|
|
ext.lib_dir = 'lib/kernaux'
|
|
|
|
end
|
|
|
|
rescue LoadError
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
2022-01-18 05:20:37 -05:00
|
|
|
desc 'Open development console'
|
|
|
|
task :console do
|
|
|
|
sh 'bundle', 'exec', File.expand_path(File.join('bin', 'console'), __dir__)
|
|
|
|
end
|