RubyGem: Logger for systemd-journal (donated to theforeman, kept as a mirror)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
914B

  1. require "bundler/gem_tasks"
  2. require "rspec/core/rake_task"
  3. require "rubocop/rake_task"
  4. RSpec::Core::RakeTask.new(:spec)
  5. RuboCop::RakeTask.new
  6. if Gem::Version.new(RUBY_VERSION) > Gem::Version.new("2.0")
  7. namespace :rufo do
  8. require "rufo"
  9. def rufo_command(*switches, rake_args)
  10. files_or_dirs = rake_args[:files_or_dirs] || "."
  11. args = switches + files_or_dirs.split(" ")
  12. Rufo::Command.run(args)
  13. end
  14. desc "Format Ruby code in current directory"
  15. task :run, [:files_or_dirs] do |_task, rake_args|
  16. rufo_command(rake_args)
  17. end
  18. desc "Check that no formatting changes are produced"
  19. task :check, [:files_or_dirs] do |_task, rake_args|
  20. rufo_command("--check", rake_args)
  21. end
  22. end
  23. task :default => [:spec, :rubocop, :'rufo:check']
  24. else
  25. # rufo is no longer Ruby 2.0 compatible yet we want to support old Ruby
  26. task :default => [:spec, :rubocop]
  27. end