Sha256: e6a0cfc815a0fb5e15910814c2d2e46837c727f2bd454f7c0fe00d825988c363

Contents?: true

Size: 958 Bytes

Versions: 4

Compression:

Stored size: 958 Bytes

Contents

require "bundler/gem_tasks"

upstream = Gem::Specification.find_by_name("rubocop")

desc "Vendor rubocop-#{upstream.version} configuration into gem"
task :vendor do
  src = Pathname.new(upstream.gem_dir).join("config")
  dst = Pathname.new(__FILE__).dirname.join("config")

  mkdir_p dst
  cp(src.join("default.yml"), dst.join("upstream.yml"))
  cp(src.join("enabled.yml"), dst.join("enabled.yml"))
  cp(src.join("disabled.yml"), dst.join("disabled.yml"))

  require 'rubocop'
  require 'yaml'
  cfg = RuboCop::Cop::Cop.all.inject({}) { |acc, cop| acc[cop.cop_name] = {"Enabled" => false}; acc }
  File.open(dst.join("disable_all.yml"), "w"){|fh| fh.write cfg.to_yaml }

  sh %{git add #{dst}/{upstream,enabled,disabled,disable_all}.yml}
  sh %{git commit -m "Vendor rubocop-#{upstream.version} upstream configuration."}
end

require "chefstyle"
require "rubocop/rake_task"
RuboCop::RakeTask.new(:style) do |task|
  task.options << "--display-cop-names"
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chefstyle-0.4.0 Rakefile
chefstyle-0.3.1 Rakefile
chefstyle-0.3.0 Rakefile
chefstyle-0.1.0 Rakefile