Sha256: e6bc45b126df8f2f7bbc3c5257b624c93815c52b99ce9f3b867ab5e01fde7ddd

Contents?: true

Size: 971 Bytes

Versions: 4

Compression:

Stored size: 971 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.each_with_object({}) { |cop, acc| 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 "lcgstyle"
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
lcgstyle-0.0.9 Rakefile
lcgstyle-0.0.8 Rakefile
lcgstyle-0.0.7 Rakefile
lcgstyle-0.0.6 Rakefile