代码拉取完成,页面将自动刷新
# frozen_string_literal: true
task default: [:test]
desc "Run all tests"
task test: [:rubocop, :rspec]
desc "Run rubocop"
task :rubocop do
sh "rubocop"
end
desc "Run rspec"
task :rspec do
sh "rspec --format d"
end
desc "Update README.md"
task :readme do
require "erb"
require_relative "spec/group_list"
require_relative "spec/component"
template = File.read("README.md.erb")
groups = GroupList.new("groups.yml").all
# * select if it is a directory
# * make path to metadata file
# * read it
# * parse it as YAML
# * take all components under "components" key
# * flatten the list of components
# * create a Component from the item
all_components = Dir.children("components")
.select { |f| File.directory?(File.join("components", f)) }
.map { |c| File.join("components", c, ".eil.yml") }
.map { |f| File.read(f) }
.map { |f| YAML.safe_load(f) }
.map { |y| y["components"] }
.flatten
.map { |c| Component.new(c) }
markdown = ERB.new(template, trim_mode: "%-").result(binding)
puts markdown
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。