private
def wiki_link(type, lookup)
- wiki_data = YAML.load_file("#{RAILS_ROOT}/config/wiki-tag-and-key-description.yml")
locale = I18n.locale.to_s
- if page = wiki_data[locale][type][lookup] rescue nil
+ if page = WIKI_PAGES[locale][type][lookup] rescue nil
url = "http://wiki.openstreetmap.org/wiki/#{page}?uselang=#{locale}"
- elsif page = wiki_data["en"][type][lookup] rescue nil
+ elsif page = WIKI_PAGES["en"][type][lookup] rescue nil
url = "http://wiki.openstreetmap.org/wiki/#{page}?uselang=#{locale}"
end
--- /dev/null
+WIKI_PAGES = YAML.load_file("#{RAILS_ROOT}/config/wiki_pages.yml")
-# THIS FILE IS AUTOGENERATED WITH THE script/misc/update-key-and-tag-description-pages-from-wiki
+# THIS FILE IS AUTOGENERATED WITH THE script/misc/update-wiki-pages
# PROGRAM DO NOT MANUALLY EDIT IT
---
=head1 NAME
-update-key-and-tag-description-pages-from-wiki - Screen-scrape the wiki for key/value wiki description pages
+update-wiki-pages - Screen-scrape the wiki for key/value wiki description pages
=head1 SYNOPSIS
- perl script/misc/update-key-and-tag-description-pages-from-wiki config/wiki-tag-and-key-description.yml
+ perl script/misc/update-wiki-pages config/wiki_pages.yml
=head1 BUGS
# Dump to .yml file
open my $out, ">", $ARGV[0] or die "Can't open file '$ARGV[0]' supplied on the command line";
-say $out "# THIS FILE IS AUTOGENERATED WITH THE script/misc/update-key-and-tag-description-pages-from-wiki";
+say $out "# THIS FILE IS AUTOGENERATED WITH THE script/misc/update-wiki-pages";
say $out "# PROGRAM DO NOT MANUALLY EDIT IT";
say $out "";
say $out Dump(\%feature);