From 1bf1bda3235445455cec19ee47af3cf3dda667b0 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Thu, 30 Nov 2023 11:55:36 +0000 Subject: [PATCH] feat: Remove cane (#32) The author now recommends using Rubocop Signed-off-by: Dan Webb --- Gemfile | 3 --- Rakefile | 24 +++++++++--------------- busser-bats.gemspec | 3 +-- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/Gemfile b/Gemfile index 92a9693..f58dfaf 100644 --- a/Gemfile +++ b/Gemfile @@ -17,9 +17,6 @@ end group :development do gem "countloc" gem "simplecov" - -# gem "finstyle", "1.2.0" - gem "cane", "2.6.2" end group :chefstyle do diff --git a/Rakefile b/Rakefile index a761357..e8641da 100644 --- a/Rakefile +++ b/Rakefile @@ -2,27 +2,24 @@ require "bundler/gem_tasks" require "open-uri" namespace :bats do - version = ENV.fetch("BATS_VERSION", "v0.4.0") url = "https://github.com/sstephenson/bats/archive/#{version}.tar.gz" tarball = "tmp/bats-#{version}.tar.gz" vendor = "vendor/bats" desc "Vendors bats #{version} source code into gem codebase" - task :vendor => "#{vendor}/VERSION.txt" + task vendor: "#{vendor}/VERSION.txt" directory File.dirname(tarball) directory vendor file tarball => File.dirname(tarball) do |t| - begin - src = open(url).binmode - dst = open(t.name, "wb") - IO.copy_stream(src, dst) - ensure - src.close - dst.close - end + src = open(url).binmode + dst = open(t.name, "wb") + IO.copy_stream(src, dst) + ensure + src.close + dst.close end file "#{vendor}/VERSION.txt" => [vendor, tarball] do |t| @@ -44,7 +41,7 @@ Cucumber::Rake::Task.new(:features) do |t| end desc "Run all test suites" -task :test => [:features] +task test: [:features] desc "Display LOC stats" task :stats do @@ -54,7 +51,4 @@ task :stats do sh "countloc -r features" end -desc "Run all quality tasks" -# task :quality => [:cane, :style, :stats] - -task :default => [:test, :quality] +task default: %i{test quality} diff --git a/busser-bats.gemspec b/busser-bats.gemspec index 17560eb..f9a9455 100644 --- a/busser-bats.gemspec +++ b/busser-bats.gemspec @@ -1,5 +1,4 @@ -# coding: utf-8 -lib = File.expand_path("../lib", __FILE__) +lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "busser/bats/version" require "English"