launchy 2.0.4 → 2.0.5

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.
data/HISTORY CHANGED
@@ -1,4 +1,8 @@
1
1
  = Launchy Changlog
2
+ == Version 2.0.5 - 2011-07-24
3
+
4
+ * Fix the case where $BROWSER is set and no *nix desktop was found (copiousfreetime/launchy#33)
5
+
2
6
  == Version 2.0.4 - 2011-07-23
3
7
 
4
8
  * Fix windows 'start' commandline (copiousfreetime/launchy#5)
@@ -25,10 +25,11 @@ class Launchy::Application
25
25
  end
26
26
 
27
27
  def nix_app_list
28
- nix_de = Launchy::Detect::NixDesktopEnvironment.detect
29
28
  app_list = %w[ xdg-open ]
30
- app_list << nix_de.browser
31
- app_list << nix_de.fallback_browsers
29
+ if nix_de = Launchy::Detect::NixDesktopEnvironment.detect then
30
+ app_list << nix_de.browser
31
+ app_list << nix_de.fallback_browsers
32
+ end
32
33
  app_list.flatten!
33
34
  app_list.delete_if { |b| b.nil? || (b.strip.size == 0) }
34
35
  app_list.collect { |bin| find_executable( bin ) }.find_all { |x| not x.nil? }
@@ -14,8 +14,8 @@ module Launchy::Detect
14
14
  # NixDekstopEnvironment::Unknown
15
15
  def self.detect
16
16
  found = find_child( :is_current_desktop_environment? )
17
- return found if found
18
- raise NotFoundError, "Current Desktop environment not found. #{Launchy.bug_report_message}"
17
+ Launchy.log("Current Desktop environment not flound. #{Launchy.bug_report_message}") unless found
18
+ return found
19
19
  end
20
20
 
21
21
  def self.fallback_browsers
@@ -1,5 +1,5 @@
1
1
  module Launchy
2
- VERSION = "2.0.4"
2
+ VERSION = "2.0.5"
3
3
 
4
4
  module Version
5
5
 
@@ -40,5 +40,15 @@ describe Launchy::Application::Browser do
40
40
  uri = Addressable::URI.parse( __FILE__ )
41
41
  Launchy::Application::Browser.handles?( uri ).must_equal true
42
42
  end
43
+
44
+ it "handles the case where $BROWSER is set and no *nix desktop environment is found" do
45
+ ENV.delete( "KDE_FULL_SESSION" )
46
+ ENV.delete( "GNOME_DESKTOP_SESSION_ID" )
47
+ ENV['BROWSER'] = "do-this-instead"
48
+ Launchy.host_os = 'linux'
49
+ browser = Launchy::Application::Browser.new
50
+ browser.browser_cmdline.must_equal "do-this-instead"
51
+ end
52
+
43
53
  end
44
54
 
@@ -23,10 +23,11 @@ describe Launchy::Detect::NixDesktopEnvironment do
23
23
  end
24
24
 
25
25
 
26
- it "raises an error if it cannot determine the *nix desktop environment" do
26
+ it "returns nil if it cannot determine the *nix desktop environment" do
27
27
  Launchy.host_os = "linux"
28
28
  ENV.delete( "KDE_FULL_SESSION" )
29
29
  ENV.delete( "GNOME_DESKTOP_SESSION_ID" )
30
- lambda { Launchy::Detect::NixDesktopEnvironment.detect }.must_raise Launchy::Detect::NixDesktopEnvironment::NotFoundError
30
+ Launchy::Detect::NixDesktopEnvironment.detect.must_equal( nil )
31
31
  end
32
+
32
33
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: launchy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 4
10
- version: 2.0.4
9
+ - 5
10
+ version: 2.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeremy Hinegardner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-23 00:00:00 -06:00
18
+ date: 2011-07-29 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency