launchy 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/HISTORY.md +3 -0
- data/Manifest.txt +1 -0
- data/lib/launchy.rb +1 -0
- data/lib/launchy/applications/browser.rb +1 -3
- data/lib/launchy/argv.rb +36 -0
- data/lib/launchy/detect/nix_desktop_environment.rb +6 -6
- data/lib/launchy/version.rb +1 -1
- data/spec/detect/nix_desktop_environment_spec.rb +3 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTBlZTMzMGZlMDNmM2Y5MDk3MzVmZWMzNjIwMGI5MjdiYWE1NmVlNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWQ0Mjc2MzA2Mjg4MDNhNzY5YjQ1M2RjZTNhNTlhYTJkZDM3MzZhYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzBmYTIwODEzYzMyNGZhMjY3Y2E1YzU4NWE1MTkxMTA4Nzg0ZWE1MzhlZTRh
|
10
|
+
NDhhYjdhNzQ5NDY0YzgzMjIwZGZiMWEyZTRjNGE0NjkyM2FmMGUyMmUyN2Jh
|
11
|
+
NDQ0NDVmNmE1N2U1ZTQ3MmY3YmEyYjM4OWYxMjYxNDQyMzU5OTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTA3NTI4MTE1NGVjZmFlMDJjOWJjOWYzYjgxYWUxNzA2M2NiNDU1YzI3NWM1
|
14
|
+
N2MzYzFkNjdhMmVlZjE4ZjA0YTg0MDAxODQ4NjQwODZhODliODAwM2I3Mjhl
|
15
|
+
MDg5NWI5MzBhNGNhNGQ2NTRkZGY2ZDlhOGFlZWI1MzFiYWVkNDY=
|
data/HISTORY.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Launchy Changelog
|
2
2
|
|
3
|
+
## Version 2.4.1 - 2013-11-26
|
4
|
+
* Abstract out the argv of the commandline - <https://github.com/copiousfreetime/launchy/issues/71>
|
5
|
+
|
3
6
|
## Version 2.4.0 - 2013-11-12
|
4
7
|
* Support `Launchy.open( url, :debug => true )` - <http://github.com/copiousfreetime/launchy/issues/63> - schmich
|
5
8
|
* Fix inconsistencies in `debug?` and `dry_run?` methods - <http://github.com/copiousfreetime/launchy/issues/63> - schmich
|
data/Manifest.txt
CHANGED
data/lib/launchy.rb
CHANGED
@@ -28,9 +28,7 @@ class Launchy::Application
|
|
28
28
|
def nix_app_list
|
29
29
|
nix_de = Launchy::Detect::NixDesktopEnvironment.detect
|
30
30
|
list = nix_de.browsers
|
31
|
-
|
32
|
-
list.delete_if { |b| b.nil? || (b.strip.size == 0) }
|
33
|
-
list.collect { |bin| find_executable( bin ) }.find_all { |x| not x.nil? }
|
31
|
+
list.find_all { |argv| argv.valid? }
|
34
32
|
end
|
35
33
|
|
36
34
|
# use a call back mechanism to get the right app_list that is decided by the
|
data/lib/launchy/argv.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
module Launchy
|
2
|
+
class Argv
|
3
|
+
attr_reader :argv
|
4
|
+
def initialize( *args )
|
5
|
+
@argv = args.flatten
|
6
|
+
end
|
7
|
+
|
8
|
+
def to_s
|
9
|
+
@argv.join(' ')
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_str
|
13
|
+
to_s
|
14
|
+
end
|
15
|
+
|
16
|
+
def [](idx)
|
17
|
+
@argv[idx]
|
18
|
+
end
|
19
|
+
|
20
|
+
def valid?
|
21
|
+
(not blank?) && executable?
|
22
|
+
end
|
23
|
+
|
24
|
+
def blank?
|
25
|
+
@argv.empty? || (@argv.first.strip.size == 0)
|
26
|
+
end
|
27
|
+
|
28
|
+
def executable?
|
29
|
+
::Launchy::Application.find_executable( @argv.first )
|
30
|
+
end
|
31
|
+
|
32
|
+
def ==( other )
|
33
|
+
@argv == other.argv
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -19,7 +19,7 @@ module Launchy::Detect
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.fallback_browsers
|
22
|
-
%w[ firefox seamonkey opera mozilla netscape galeon ]
|
22
|
+
%w[ firefox seamonkey opera mozilla netscape galeon ].map { |x| ::Launchy::Argv.new( x ) }
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.browsers
|
@@ -36,7 +36,7 @@ module Launchy::Detect
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def self.browser
|
39
|
-
|
39
|
+
::Launchy::Argv.new( %w[ kvmclient openURL ] )
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -46,7 +46,7 @@ module Launchy::Detect
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def self.browser
|
49
|
-
'gnome-open'
|
49
|
+
::Launchy::Argv.new( 'gnome-open' )
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -60,7 +60,7 @@ module Launchy::Detect
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def self.browser
|
63
|
-
'exo-open'
|
63
|
+
::Launchy::Argv.new( 'exo-open' )
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
@@ -71,7 +71,7 @@ module Launchy::Detect
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def self.browser
|
74
|
-
'xdg-open'
|
74
|
+
::Launchy::Argv.new( 'xdg-open' )
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
@@ -82,7 +82,7 @@ module Launchy::Detect
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def self.browser
|
85
|
-
|
85
|
+
::Launchy::Argv.new
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
data/lib/launchy/version.rb
CHANGED
@@ -14,6 +14,8 @@ describe Launchy::Detect::NixDesktopEnvironment do
|
|
14
14
|
{ "KDE_FULL_SESSION" => Launchy::Detect::NixDesktopEnvironment::Kde,
|
15
15
|
"GNOME_DESKTOP_SESSION_ID" => Launchy::Detect::NixDesktopEnvironment::Gnome }.each_pair do |k,v|
|
16
16
|
it "can detect the desktop environment of a *nix machine using ENV[#{k}]" do
|
17
|
+
ENV.delete( "KDE_FULL_SESSION" )
|
18
|
+
ENV.delete( "GNOME_DESKTOP_SESSION_ID" )
|
17
19
|
ENV[k] = "launchy-test"
|
18
20
|
nix_env = Launchy::Detect::NixDesktopEnvironment.detect
|
19
21
|
nix_env.must_equal( v )
|
@@ -33,6 +35,6 @@ describe Launchy::Detect::NixDesktopEnvironment do
|
|
33
35
|
ENV.delete( "GNOME_DESKTOP_SESSION_ID" )
|
34
36
|
not_found = Launchy::Detect::NixDesktopEnvironment.detect
|
35
37
|
not_found.must_equal( Launchy::Detect::NixDesktopEnvironment::NotFound )
|
36
|
-
not_found.browser.must_equal(
|
38
|
+
not_found.browser.must_equal( Launchy::Argv.new )
|
37
39
|
end
|
38
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: launchy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Hinegardner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- lib/launchy.rb
|
92
92
|
- lib/launchy/application.rb
|
93
93
|
- lib/launchy/applications/browser.rb
|
94
|
+
- lib/launchy/argv.rb
|
94
95
|
- lib/launchy/cli.rb
|
95
96
|
- lib/launchy/deprecated.rb
|
96
97
|
- lib/launchy/descendant_tracker.rb
|
@@ -141,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
142
|
version: '0'
|
142
143
|
requirements: []
|
143
144
|
rubyforge_project:
|
144
|
-
rubygems_version: 2.1.
|
145
|
+
rubygems_version: 2.1.11
|
145
146
|
signing_key:
|
146
147
|
specification_version: 4
|
147
148
|
summary: Launchy is helper class for launching cross-platform applications in a fire
|