Rakefile in grumlin-0.15.3 vs Rakefile in grumlin-0.15.4
- old
+ new
@@ -1,12 +1,30 @@
# frozen_string_literal: true
+require "yaml"
+
require "bundler/gem_tasks"
require "rspec/core/rake_task"
+require "rubocop/rake_task"
RSpec::Core::RakeTask.new(:spec)
+RuboCop::RakeTask.new
-require "rubocop/rake_task"
+task default: %i[rubocop spec]
-RuboCop::RakeTask.new
+namespace :definitions do
+ desc "Format definitions.yml"
+ task :format do
+ path = File.join(__dir__, "lib", "definitions.yml")
+ definitions = YAML.safe_load(File.read(path))
-task default: %i[spec rubocop]
+ definitions.each_value do |kind|
+ kind.each do |name, list|
+ next if name == "with_options"
+
+ list.sort!
+ end
+ end
+
+ File.write(path, YAML.dump(definitions))
+ end
+end