diff options
author | Austin Ziegler <austin@zieglers.ca> | 2014-01-22 23:31:26 -0500 |
---|---|---|
committer | Austin Ziegler <austin@zieglers.ca> | 2014-01-23 01:02:31 -0500 |
commit | cca673071e8c98180af5d31cefaa7675c8000bc2 (patch) | |
tree | d7dc0dfdefb3aef8f38a7b58315c1be5f4339a88 /support | |
parent | c811c07ea2970329cb59dac5291e0f34c96b0f11 (diff) | |
download | mime-types-cca673071e8c98180af5d31cefaa7675c8000bc2.tar.gz |
Using Array() instead of [ foo ].
- Bumping to version 2.1 for upcoming release.
- Adapted tests to be more accurate for the described functionality.
Diffstat (limited to 'support')
-rw-r--r-- | support/iana_downloader.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/support/iana_downloader.rb b/support/iana_downloader.rb index 8778ce7..134f178 100644 --- a/support/iana_downloader.rb +++ b/support/iana_downloader.rb @@ -12,7 +12,7 @@ ENV['RUBY_MIME_TYPES_LAZY_LOAD'] = 'yes' require 'mime/types' class IANADownloader - INDEX_URL = %q(https://www.iana.org/assignments/media-types/) + INDEX_URL = %q(https://www.iana.org/assignments/media-types/media-types.xhtml) MIME_HREF = %r{/assignments/media-types/(.+)/?$} def self.download_to(destination) @@ -113,8 +113,7 @@ class IANADownloader::Parser subtype = elems[sub_ix].content.chomp.strip refs = child_elems(elems[ref_ix]).map { |ref| ref = ref.xpath('a') unless ref.name == 'a' - [ ref ].flatten.map { |r| href_to_ref(r) } - + Array(ref).flatten.map { |r| href_to_ref(r) } }.flatten content_type = [ @type, subtype].join('/') |