From 2801e040bca9351d0a1fbcf05fb277c98f68c59b Mon Sep 17 00:00:00 2001 From: mo khan Date: Fri, 24 May 2024 12:44:26 -0600 Subject: rename template --- bin/community | 2 +- templates/city.md.erb | 11 +++++++++++ templates/communities.md.erb | 11 ----------- 3 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 templates/city.md.erb delete mode 100644 templates/communities.md.erb diff --git a/bin/community b/bin/community index a9fc91a..4202702 100755 --- a/bin/community +++ b/bin/community @@ -83,7 +83,7 @@ class Census def create_content_in(dir) FileUtils.mkdir_p(dir, verbose: true) - erb = ERB.new(IO.read("templates/communities.md.erb"), trim_mode: "-") + erb = ERB.new(IO.read("templates/city.md.erb"), trim_mode: "-") IO.write("#{dir}/README.md", erb.result(binding)) each { |x| x.create_content_in(dir) } diff --git a/templates/city.md.erb b/templates/city.md.erb new file mode 100644 index 0000000..63babd1 --- /dev/null +++ b/templates/city.md.erb @@ -0,0 +1,11 @@ +# Calgary (YYC) + +| Sector | Name | Total | Male | Female | Non-binary | Dogs | Cats | +| ------ | ---- | ----- | ---- | ------ | ---------- | ---- | ---- | +<%- self.sort.each do |community| -%> +| <%= community[:sector] %> | [<%= community.name %>][<%= community.name.parameterize %>] | <%= community[:res_cnt] %> | <%= community[:male_cnt] %> (<%= community.percent(:male_cnt) %>%) | <%= community[:female_cnt] %> (<%= community.percent(:female_cnt) %>%) | <%= community[:other_cnt] %> (<%= community.percent(:other_cnt) %>%) | <%= community[:dog_cnt] %> | <%= community[:cat_cnt] %> | +<%- end -%> + +<%- self.sort.each do |community| -%> +[<%= community.name.parameterize %>]: ./<%= community[:sector].parameterize %>/<%= community.name.parameterize %>/README.md +<%- end -%> diff --git a/templates/communities.md.erb b/templates/communities.md.erb deleted file mode 100644 index 63babd1..0000000 --- a/templates/communities.md.erb +++ /dev/null @@ -1,11 +0,0 @@ -# Calgary (YYC) - -| Sector | Name | Total | Male | Female | Non-binary | Dogs | Cats | -| ------ | ---- | ----- | ---- | ------ | ---------- | ---- | ---- | -<%- self.sort.each do |community| -%> -| <%= community[:sector] %> | [<%= community.name %>][<%= community.name.parameterize %>] | <%= community[:res_cnt] %> | <%= community[:male_cnt] %> (<%= community.percent(:male_cnt) %>%) | <%= community[:female_cnt] %> (<%= community.percent(:female_cnt) %>%) | <%= community[:other_cnt] %> (<%= community.percent(:other_cnt) %>%) | <%= community[:dog_cnt] %> | <%= community[:cat_cnt] %> | -<%- end -%> - -<%- self.sort.each do |community| -%> -[<%= community.name.parameterize %>]: ./<%= community[:sector].parameterize %>/<%= community.name.parameterize %>/README.md -<%- end -%> -- cgit v1.2.3