Skip to content

Commit

Permalink
use number predicates
Browse files Browse the repository at this point in the history
  • Loading branch information
copiousfreetime committed May 3, 2024
1 parent 2aea74f commit b2a68d7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/launchy/applications/browser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def browser_env

browser_env = ENV["BROWSER"].split(File::PATH_SEPARATOR)
browser_env.flatten!
browser_env.delete_if { |b| b.nil? || (b.strip.size == 0) }
browser_env.delete_if { |b| b.nil? || b.strip.size.zero? }
return browser_env
end

Expand Down
2 changes: 1 addition & 1 deletion lib/launchy/argv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def valid?
end

def blank?
@argv.empty? || (@argv.first.strip.size == 0)
@argv.empty? || @argv.first.strip.size.zero?
end

def executable?
Expand Down
2 changes: 1 addition & 1 deletion lib/launchy/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def shell_commands(cmd, args)

def commandline_normalize(cmdline)
c = cmdline.flatten!
c = c.find_all { |a| !a.nil? and (a.size > 0) }
c = c.find_all { |a| !a.nil? and a.size.positive? }
Launchy.log "commandline_normalized => #{c.join(' ')}"
return c
end
Expand Down

0 comments on commit b2a68d7

Please sign in to comment.