mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 13:46:41 +00:00
style(xbar): fix rubocop linting complaints
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# <xbar.title>Brew Services</xbar.title>
|
# <xbar.title>Brew Services</xbar.title>
|
||||||
# <xbar.version>v3.2.0</xbar.version>
|
# <xbar.version>v3.2.1</xbar.version>
|
||||||
# <xbar.author>Jim Myhrberg</xbar.author>
|
# <xbar.author>Jim Myhrberg</xbar.author>
|
||||||
# <xbar.author.github>jimeh</xbar.author.github>
|
# <xbar.author.github>jimeh</xbar.author.github>
|
||||||
# <xbar.desc>List and manage Homebrew Services</xbar.desc>
|
# <xbar.desc>List and manage Homebrew Services</xbar.desc>
|
||||||
@@ -14,7 +14,6 @@
|
|||||||
# <xbar.var>string(VAR_BREW_PATH=""): Path to "brew" executable.</xbar.var>
|
# <xbar.var>string(VAR_BREW_PATH=""): Path to "brew" executable.</xbar.var>
|
||||||
# <xbar.var>string(VAR_HIDDEN_SERVICES=""): Comma-separated list of services to hide.</xbar.var>
|
# <xbar.var>string(VAR_HIDDEN_SERVICES=""): Comma-separated list of services to hide.</xbar.var>
|
||||||
|
|
||||||
# rubocop:disable Lint/ShadowingOuterLocalVariable
|
|
||||||
# rubocop:disable Metrics/AbcSize
|
# rubocop:disable Metrics/AbcSize
|
||||||
# rubocop:disable Metrics/BlockLength
|
# rubocop:disable Metrics/BlockLength
|
||||||
# rubocop:disable Metrics/ClassLength
|
# rubocop:disable Metrics/ClassLength
|
||||||
@@ -35,11 +34,11 @@ module Xbar
|
|||||||
|
|
||||||
module Helpers
|
module Helpers
|
||||||
def plugin_data_path
|
def plugin_data_path
|
||||||
@plugin_data_path ||= (swiftbar_data_path || File.dirname(__FILE__))
|
@plugin_data_path ||= swiftbar_data_path || File.dirname(__FILE__)
|
||||||
end
|
end
|
||||||
|
|
||||||
def plugin_file_path
|
def plugin_file_path
|
||||||
@plugin_file_path ||= (swiftbar_plugin_path || __FILE__)
|
@plugin_file_path ||= swiftbar_plugin_path || __FILE__
|
||||||
end
|
end
|
||||||
|
|
||||||
def plugin_filename
|
def plugin_filename
|
||||||
@@ -209,12 +208,12 @@ module Xbar
|
|||||||
def plugin_refresh_uri
|
def plugin_refresh_uri
|
||||||
return @plugin_refresh_uri if @plugin_refresh_uri
|
return @plugin_refresh_uri if @plugin_refresh_uri
|
||||||
|
|
||||||
if swiftbar?
|
@plugin_refresh_uri = if swiftbar?
|
||||||
@plugin_refresh_uri = "swiftbar://refreshplugin?name=#{plugin_name}"
|
"swiftbar://refreshplugin?name=#{plugin_name}"
|
||||||
else
|
else
|
||||||
@plugin_refresh_uri = 'xbar://app.xbarapp.com/refreshPlugin' \
|
'xbar://app.xbarapp.com/refreshPlugin' \
|
||||||
"?path=#{plugin_filename}"
|
"?path=#{plugin_filename}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def normalize_props(props = {})
|
def normalize_props(props = {})
|
||||||
@@ -670,7 +669,7 @@ rescue StandardError => e
|
|||||||
puts 'exit status 1'
|
puts 'exit status 1'
|
||||||
puts '---'
|
puts '---'
|
||||||
puts 'Error:'
|
puts 'Error:'
|
||||||
puts e.message.to_s
|
puts e.message
|
||||||
e.backtrace.each do |line|
|
e.backtrace.each do |line|
|
||||||
puts "--#{line}"
|
puts "--#{line}"
|
||||||
end
|
end
|
||||||
@@ -684,4 +683,3 @@ end
|
|||||||
# rubocop:enable Metrics/ClassLength
|
# rubocop:enable Metrics/ClassLength
|
||||||
# rubocop:enable Metrics/BlockLength
|
# rubocop:enable Metrics/BlockLength
|
||||||
# rubocop:enable Metrics/AbcSize
|
# rubocop:enable Metrics/AbcSize
|
||||||
# rubocop:enable Lint/ShadowingOuterLocalVariable
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# rubocop:disable Layout/LineLength
|
# rubocop:disable Layout/LineLength
|
||||||
|
|
||||||
# <xbar.title>Brew Updates</xbar.title>
|
# <xbar.title>Brew Updates</xbar.title>
|
||||||
# <xbar.version>v2.7.0</xbar.version>
|
# <xbar.version>v2.7.1</xbar.version>
|
||||||
# <xbar.author>Jim Myhrberg</xbar.author>
|
# <xbar.author>Jim Myhrberg</xbar.author>
|
||||||
# <xbar.author.github>jimeh</xbar.author.github>
|
# <xbar.author.github>jimeh</xbar.author.github>
|
||||||
# <xbar.desc>List and manage outdated Homebrew formulas and casks</xbar.desc>
|
# <xbar.desc>List and manage outdated Homebrew formulas and casks</xbar.desc>
|
||||||
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
# rubocop:enable Layout/LineLength
|
# rubocop:enable Layout/LineLength
|
||||||
|
|
||||||
# rubocop:disable Lint/ShadowingOuterLocalVariable
|
|
||||||
# rubocop:disable Metrics/AbcSize
|
# rubocop:disable Metrics/AbcSize
|
||||||
# rubocop:disable Metrics/BlockLength
|
# rubocop:disable Metrics/BlockLength
|
||||||
# rubocop:disable Metrics/ClassLength
|
# rubocop:disable Metrics/ClassLength
|
||||||
@@ -42,11 +41,11 @@ module Xbar
|
|||||||
|
|
||||||
module Helpers
|
module Helpers
|
||||||
def plugin_data_path
|
def plugin_data_path
|
||||||
@plugin_data_path ||= (swiftbar_data_path || File.dirname(__FILE__))
|
@plugin_data_path ||= swiftbar_data_path || File.dirname(__FILE__)
|
||||||
end
|
end
|
||||||
|
|
||||||
def plugin_file_path
|
def plugin_file_path
|
||||||
@plugin_file_path ||= (swiftbar_plugin_path || __FILE__)
|
@plugin_file_path ||= swiftbar_plugin_path || __FILE__
|
||||||
end
|
end
|
||||||
|
|
||||||
def plugin_filename
|
def plugin_filename
|
||||||
@@ -216,12 +215,12 @@ module Xbar
|
|||||||
def plugin_refresh_uri
|
def plugin_refresh_uri
|
||||||
return @plugin_refresh_uri if @plugin_refresh_uri
|
return @plugin_refresh_uri if @plugin_refresh_uri
|
||||||
|
|
||||||
if swiftbar?
|
@plugin_refresh_uri = if swiftbar?
|
||||||
@plugin_refresh_uri = "swiftbar://refreshplugin?name=#{plugin_name}"
|
"swiftbar://refreshplugin?name=#{plugin_name}"
|
||||||
else
|
else
|
||||||
@plugin_refresh_uri = 'xbar://app.xbarapp.com/refreshPlugin' \
|
'xbar://app.xbarapp.com/refreshPlugin' \
|
||||||
"?path=#{plugin_filename}"
|
"?path=#{plugin_filename}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def normalize_props(props = {})
|
def normalize_props(props = {})
|
||||||
@@ -743,7 +742,7 @@ rescue StandardError => e
|
|||||||
puts 'exit status 1'
|
puts 'exit status 1'
|
||||||
puts '---'
|
puts '---'
|
||||||
puts 'Error:'
|
puts 'Error:'
|
||||||
puts e.message.to_s
|
puts e.message
|
||||||
e.backtrace.each do |line|
|
e.backtrace.each do |line|
|
||||||
puts "--#{line}"
|
puts "--#{line}"
|
||||||
end
|
end
|
||||||
@@ -757,4 +756,3 @@ end
|
|||||||
# rubocop:enable Metrics/ClassLength
|
# rubocop:enable Metrics/ClassLength
|
||||||
# rubocop:enable Metrics/BlockLength
|
# rubocop:enable Metrics/BlockLength
|
||||||
# rubocop:enable Metrics/AbcSize
|
# rubocop:enable Metrics/AbcSize
|
||||||
# rubocop:enable Lint/ShadowingOuterLocalVariable
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# rubocop:disable Layout/LineLength
|
# rubocop:disable Layout/LineLength
|
||||||
|
|
||||||
# <xbar.title>Mise Updates</xbar.title>
|
# <xbar.title>Mise Updates</xbar.title>
|
||||||
# <xbar.version>v0.3.0</xbar.version>
|
# <xbar.version>v0.3.1</xbar.version>
|
||||||
# <xbar.author>Jim Myhrberg</xbar.author>
|
# <xbar.author>Jim Myhrberg</xbar.author>
|
||||||
# <xbar.author.github>jimeh</xbar.author.github>
|
# <xbar.author.github>jimeh</xbar.author.github>
|
||||||
# <xbar.desc>List and manage outdated tools installed with mise</xbar.desc>
|
# <xbar.desc>List and manage outdated tools installed with mise</xbar.desc>
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
# rubocop:enable Layout/LineLength
|
# rubocop:enable Layout/LineLength
|
||||||
|
|
||||||
# rubocop:disable Lint/ShadowingOuterLocalVariable
|
|
||||||
# rubocop:disable Metrics/AbcSize
|
# rubocop:disable Metrics/AbcSize
|
||||||
# rubocop:disable Metrics/BlockLength
|
# rubocop:disable Metrics/BlockLength
|
||||||
# rubocop:disable Metrics/ClassLength
|
# rubocop:disable Metrics/ClassLength
|
||||||
@@ -38,11 +37,11 @@ module Xbar
|
|||||||
|
|
||||||
module Helpers
|
module Helpers
|
||||||
def plugin_data_path
|
def plugin_data_path
|
||||||
@plugin_data_path ||= (swiftbar_data_path || File.dirname(__FILE__))
|
@plugin_data_path ||= swiftbar_data_path || File.dirname(__FILE__)
|
||||||
end
|
end
|
||||||
|
|
||||||
def plugin_file_path
|
def plugin_file_path
|
||||||
@plugin_file_path ||= (swiftbar_plugin_path || __FILE__)
|
@plugin_file_path ||= swiftbar_plugin_path || __FILE__
|
||||||
end
|
end
|
||||||
|
|
||||||
def plugin_filename
|
def plugin_filename
|
||||||
@@ -212,12 +211,12 @@ module Xbar
|
|||||||
def plugin_refresh_uri
|
def plugin_refresh_uri
|
||||||
return @plugin_refresh_uri if @plugin_refresh_uri
|
return @plugin_refresh_uri if @plugin_refresh_uri
|
||||||
|
|
||||||
if swiftbar?
|
@plugin_refresh_uri = if swiftbar?
|
||||||
@plugin_refresh_uri = "swiftbar://refreshplugin?name=#{plugin_name}"
|
"swiftbar://refreshplugin?name=#{plugin_name}"
|
||||||
else
|
else
|
||||||
@plugin_refresh_uri = 'xbar://app.xbarapp.com/refreshPlugin' \
|
'xbar://app.xbarapp.com/refreshPlugin' \
|
||||||
"?path=#{plugin_filename}"
|
"?path=#{plugin_filename}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def normalize_props(props = {})
|
def normalize_props(props = {})
|
||||||
@@ -708,7 +707,7 @@ module Mise
|
|||||||
dotted = version_str.to_s[/\A\d+(?:\.\d+)*/]
|
dotted = version_str.to_s[/\A\d+(?:\.\d+)*/]
|
||||||
return [] if dotted.nil? || dotted.empty?
|
return [] if dotted.nil? || dotted.empty?
|
||||||
|
|
||||||
dotted.split('.').map { |s| s.to_i }
|
dotted.split('.').map(&:to_i)
|
||||||
end
|
end
|
||||||
|
|
||||||
def version_greater?(a_str, b_str)
|
def version_greater?(a_str, b_str)
|
||||||
@@ -1005,4 +1004,3 @@ end
|
|||||||
# rubocop:enable Metrics/ClassLength
|
# rubocop:enable Metrics/ClassLength
|
||||||
# rubocop:enable Metrics/BlockLength
|
# rubocop:enable Metrics/BlockLength
|
||||||
# rubocop:enable Metrics/AbcSize
|
# rubocop:enable Metrics/AbcSize
|
||||||
# rubocop:enable Lint/ShadowingOuterLocalVariable
|
|
||||||
|
|||||||
Reference in New Issue
Block a user