tag_category.rb: fix windows line endings.
This commit is contained in:
@@ -2,41 +2,42 @@ class TagCategory
|
|||||||
module Mappings
|
module Mappings
|
||||||
# Returns a hash mapping various tag categories to a numerical value.
|
# Returns a hash mapping various tag categories to a numerical value.
|
||||||
def mapping
|
def mapping
|
||||||
@@mapping ||= Hash[
|
@@mapping ||=
|
||||||
Danbooru.config.full_tag_config_info.map {|k,v| v["extra"].map {|y| [y,v["category"]]}}
|
Hash[
|
||||||
.reduce([],:+)]
|
Danbooru.config.full_tag_config_info.map { |k, v| v["extra"].map { |y| [y, v["category"]] }}.reduce([], :+)
|
||||||
.update(Hash[Danbooru.config.full_tag_config_info.map {|k,v| [v["short"],v["category"]]}])
|
]
|
||||||
.update( Hash[Danbooru.config.full_tag_config_info.map {|k,v| [k,v["category"]]}])
|
.update(Hash[Danbooru.config.full_tag_config_info.map { |k, v| [v["short"], v["category"]] }])
|
||||||
|
.update(Hash[Danbooru.config.full_tag_config_info.map { |k, v| [k, v["category"]] }])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a hash mapping more suited for views
|
# Returns a hash mapping more suited for views
|
||||||
def canonical_mapping
|
def canonical_mapping
|
||||||
@@canonical_mapping ||= Hash[Danbooru.config.full_tag_config_info.map {|k,v| [k.capitalize,v["category"]]}]
|
@@canonical_mapping ||= Hash[Danbooru.config.full_tag_config_info.map { |k, v| [k.capitalize, v["category"]] }]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a hash mapping numerical category values to their string equivalent.
|
# Returns a hash mapping numerical category values to their string equivalent.
|
||||||
def reverse_mapping
|
def reverse_mapping
|
||||||
@@reverse_mapping ||= Hash[Danbooru.config.full_tag_config_info.map {|k,v| [v["category"],k]}]
|
@@reverse_mapping ||= Hash[Danbooru.config.full_tag_config_info.map { |k, v| [v["category"], k] }]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a hash mapping for the short name usage in metatags
|
# Returns a hash mapping for the short name usage in metatags
|
||||||
def short_name_mapping
|
def short_name_mapping
|
||||||
@@short_name_mapping ||= Hash[Danbooru.config.full_tag_config_info.map {|k,v| [v["short"],k]}]
|
@@short_name_mapping ||= Hash[Danbooru.config.full_tag_config_info.map { |k, v| [v["short"], k] }]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a hash mapping for split_tag_list_html (presenters/tag_set_presenter.rb)
|
# Returns a hash mapping for split_tag_list_html (presenters/tag_set_presenter.rb)
|
||||||
def header_mapping
|
def header_mapping
|
||||||
@@header_mapping ||= Hash[Danbooru.config.full_tag_config_info.map {|k,v| [k,v["header"]]}]
|
@@header_mapping ||= Hash[Danbooru.config.full_tag_config_info.map { |k, v| [k, v["header"]] }]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a hash mapping for related tag buttons (javascripts/related_tag.js.erb)
|
# Returns a hash mapping for related tag buttons (javascripts/related_tag.js.erb)
|
||||||
def related_button_mapping
|
def related_button_mapping
|
||||||
@@related_button_mapping ||= Hash[Danbooru.config.full_tag_config_info.map {|k,v| [k,v["relatedbutton"]]}]
|
@@related_button_mapping ||= Hash[Danbooru.config.full_tag_config_info.map { |k, v| [k, v["relatedbutton"]] }]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a hash mapping for CSS (stylesheets/posts.scss.erb)
|
# Returns a hash mapping for CSS (stylesheets/posts.scss.erb)
|
||||||
def css_mapping
|
def css_mapping
|
||||||
@@css_mapping ||= Hash[Danbooru.config.full_tag_config_info.map {|k,v| [v["category"],v["css"]]}]
|
@@css_mapping ||= Hash[Danbooru.config.full_tag_config_info.map { |k, v| [v["category"], v["css"]] }]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user