diff options
author | Andrew Murrell <merl@neo.andrewdm.me> | 2017-12-26 08:43:24 +0000 |
---|---|---|
committer | Andrew Murrell <merl@neo.andrewdm.me> | 2017-12-26 08:43:24 +0000 |
commit | bc78567716a106042356053d556f57c1ddc13cfc (patch) | |
tree | 0c008bddb47699a9dcd62cdeb2e7131a137f64ee /lib/config.rb | |
parent | db410594baa4bb507aaa23ff98bf8853056b0823 (diff) | |
parent | 50830151e8168b8be0100da349ba7e3576054dc3 (diff) |
Merge branch 'master' of https://git.andrewdm.me/www
Diffstat (limited to 'lib/config.rb')
-rw-r--r-- | lib/config.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/config.rb b/lib/config.rb index 4690559..944acc3 100644 --- a/lib/config.rb +++ b/lib/config.rb @@ -21,11 +21,7 @@ class Config return @default_license ||= @data['default_license'] end def license_uri(name) - str = @data['license_uris'][name] - if str.nil? - return nil - end - return URI::parse(str) + return URI::parse(@data['license_uris'][name]) end # People def default_author @@ -42,10 +38,8 @@ class Config return @data['person_emails'][name] end # Categories - def categories - return @data['categories'].keys - end def category_name(abbr) - return @data['categories'][abbr] + @categories ||= (@data['categories'] || {}).map{|k,v|[k.downcase,v]}.to_h + return @categories[abbr.downcase] end end |