-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow *nix command lines to have more args
Fixes #71
- Loading branch information
1 parent
58dd6e2
commit aed917f
Showing
5 changed files
with
47 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module Launchy | ||
class Argv | ||
attr_reader :argv | ||
def initialize( *args ) | ||
@argv = args.flatten | ||
end | ||
|
||
def to_s | ||
@argv.join(' ') | ||
end | ||
|
||
def to_str | ||
to_s | ||
end | ||
|
||
def [](idx) | ||
@argv[idx] | ||
end | ||
|
||
def valid? | ||
(not blank?) && executable? | ||
end | ||
|
||
def blank? | ||
@argv.empty? || (@argv.first.strip.size == 0) | ||
end | ||
|
||
def executable? | ||
::Launchy::Application.find_executable( @argv.first ) | ||
end | ||
|
||
def ==( other ) | ||
@argv == other.argv | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters