Sha256: 04927397df653be6c8f0f40dde0c2165d3cddbdfcde919f51d665af86fce24e2

Contents?: true

Size: 677 Bytes

Versions: 5

Compression:

Stored size: 677 Bytes

Contents

# frozen_string_literal: true
require "bundler/gem_tasks"
require "rake/testtask"

# Executes a string or an array of strings in a shell in the given directory
def sh_in_dir(dir, shell_commands)
  shell_commands = [shell_commands] if shell_commands.is_a?(String)
  shell_commands.each { |shell_command| sh %(cd #{dir} && #{shell_command.strip}) }
end

def gem_root
  File.expand_path("../.", __FILE__)
end

Rake::TestTask.new(:test) do |t|
  t.libs << "test"
  t.libs << "lib"
  t.test_files = FileList["test/**/*_test.rb"]
  t.verbose = true
end

desc "Run Rubocop as shell"
task :rubocop do
  sh_in_dir(gem_root, "bundle exec rubocop .")
end

task default: [:test, :rubocop]

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
webpacker_lite-2.1.0 Rakefile
webpacker_helpers-3.0.0.beta.1 Rakefile
webpacker_lite-2.0.4 Rakefile
webpacker_lite-2.0.3 Rakefile
webpacker_lite-2.0.2 Rakefile