diff options
author | 2019-12-20 09:53:49 +0100 | |
---|---|---|
committer | 2019-12-20 09:54:22 +0100 | |
commit | bbda6aaf9798e0b114271e59eaf30d2dcbe946c3 (patch) | |
tree | 1cbd1ab594f3d9839de84a1e2a9b64983dd00777 /app | |
parent | travis: use bionic and faster curl (diff) | |
download | packages-5-bbda6aaf9798e0b114271e59eaf30d2dcbe946c3.tar.gz packages-5-bbda6aaf9798e0b114271e59eaf30d2dcbe946c3.tar.bz2 packages-5-bbda6aaf9798e0b114271e59eaf30d2dcbe946c3.zip |
Fix rubocop warnings
Signed-off-by: Hans de Graaff <graaff@gentoo.org>
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/packages_helper.rb | 2 | ||||
-rw-r--r-- | app/repositories/useflag_repository.rb | 2 | ||||
-rw-r--r-- | app/views/packages/show.json.jbuilder | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/app/helpers/packages_helper.rb b/app/helpers/packages_helper.rb index b36624c..97626b7 100644 --- a/app/helpers/packages_helper.rb +++ b/app/helpers/packages_helper.rb @@ -93,8 +93,10 @@ module PackagesHelper nil end + # rubocop:disable Security/Open def documentation_label(package) doc = Nokogiri::XML(open('https://wiki.gentoo.org/api.php?action=query&titles=' + package + '&format=xml')) doc.xpath('//api/query/pages/page')[0].attr('missing').nil? ? (t :res_docs) : (t :res_search_docs) end + # rubocop:enable Security/Open end diff --git a/app/repositories/useflag_repository.rb b/app/repositories/useflag_repository.rb index 7b8dad3..8198a9b 100644 --- a/app/repositories/useflag_repository.rb +++ b/app/repositories/useflag_repository.rb @@ -50,7 +50,7 @@ class UseflagRepository < BaseRepository processed_results = {} results.each do |result| processed_results[result.name] = if processed_results.key? result.name - Useflag.new ({ 'name' => result.name, 'description' => '(multiple definitions)', 'scope' => 'multi' }) + Useflag.new('name' => result.name, 'description' => '(multiple definitions)', 'scope' => 'multi') else result end diff --git a/app/views/packages/show.json.jbuilder b/app/views/packages/show.json.jbuilder index 703ed8b..b8aea5a 100644 --- a/app/views/packages/show.json.jbuilder +++ b/app/views/packages/show.json.jbuilder @@ -30,7 +30,7 @@ json.use do json.description strip_tags flag[:description] end - json.use_expand @package.versions.first.useflags[:use_expand].group_by { |u| u['use_expand_prefix'] } do |flag| + json.use_expand(@package.versions.first.useflags[:use_expand].group_by { |u| u['use_expand_prefix'] }) do |flag| json.set! flag[0] do json.array! flag[1] do |expand_flag| json.name expand_flag[:name].gsub(expand_flag[:use_expand_prefix] + '_', '') |