Skip to content

Commit

Permalink
Merge pull request #165 from copiousfreetime/bugfix/164-windows-launc…
Browse files Browse the repository at this point in the history
…hing-quotations

ensure the '"' makes it to the commandline
  • Loading branch information
copiousfreetime authored Feb 21, 2025
2 parents ef69884 + 79c6de3 commit 866ba7d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ blocks:
- 3.1.6
- 3.2.7
- 3.3.7
- 3.4.1
- 3.4.2
- jruby-9.4.12.0
- truffleruby-24.1.2
commands:
Expand Down Expand Up @@ -61,7 +61,7 @@ blocks:
- 3.1.6
- 3.2.7
- 3.3.7
- 3.4.1
- 3.4.2
commands:
- source .semaphore/ensure-ruby-version.sh
- source .semaphore/ensure-bundle.sh
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
launchy (3.1.0)
launchy (3.1.1)
addressable (~> 2.8)
childprocess (~> 5.0)
logger (~> 1.6)
Expand Down Expand Up @@ -170,7 +170,7 @@ CHECKSUMS
json (2.9.1) sha256=d2bdef4644052fad91c1785d48263756fe32fcac08b96a20bb15840e96550d11
json (2.9.1-java) sha256=88de8c79b54fee6ae1b4854bc48b8d7089f524cbacaf4596df24f86b10896ee8
language_server-protocol (3.17.0.3) sha256=3d5c58c02f44a20d972957a9febe386d7e7468ab3900ce6bd2b563dd910c6b3f
launchy (3.1.0)
launchy (3.1.1)
logger (1.6.5) sha256=c3cfe56d01656490ddd103d38b8993d73d86296adebc5f58cefc9ec03741e56b
minitest (5.25.4) sha256=9cf2cae25ac4dfc90c988ebc3b917f53c054978b673273da1bd20bcb0778f947
minitest-focus (1.4.0) sha256=4cf04bd2b5fe0649922db56f9f2ae30af91475a0f51e02c2baa33f5c5a47ff6c
Expand Down
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Launchy Changelog
## Version 3.1.1 - 2025-02-21
* Fix the quoted parameter for windows launching - <https://github.com/copiousfreetime/launchy/issues/164>

## Version 3.1.0 - 2025-01-23
* Fix the argv array when passing to ChildProcess on windows - <https://github.com/copiousfreetime/launchy/issues/159>
* Update the ruby test matrix for 3.4
Expand Down
6 changes: 3 additions & 3 deletions launchy.gemspec
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# DO NOT EDIT - This file is automatically generated
# Make changes to Manifest.txt and/or Rakefile and regenerate
# -*- encoding: utf-8 -*-
# stub: launchy 3.1.0 ruby lib
# stub: launchy 3.1.1 ruby lib

Gem::Specification.new do |s|
s.name = "launchy".freeze
s.version = "3.1.0".freeze
s.version = "3.1.1".freeze

s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.metadata = { "bug_tracker_uri" => "https://github.com/copiousfreetime/launchy/issues", "changelog_uri" => "https://github.com/copiousfreetime/launchy/blob/master/HISTORY.md", "homepage_uri" => "https://github.com/copiousfreetime/launchy", "source_code_uri" => "https://github.com/copiousfreetime/launchy" } if s.respond_to? :metadata=
s.require_paths = ["lib".freeze]
s.authors = ["Jeremy Hinegardner".freeze]
s.bindir = "exe".freeze
s.date = "2025-01-23"
s.date = "2025-02-21"
s.description = "Launchy is helper class for launching cross-platform applications in a fire and forget manner. There are application concepts (browser, email client, etc) that are common across all platforms, and they may be launched differently on each platform. Launchy is here to make a common approach to launching external applications from within ruby programs.".freeze
s.email = "jeremy@copiousfreetime.org".freeze
s.executables = ["launchy".freeze]
Expand Down
6 changes: 4 additions & 2 deletions lib/launchy/applications/browser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ def self.handles?(uri)
true if File.exist?(uri.path)
end

# The escaped \\ is necessary so that when shellsplit is done later,
# the "launchy", with quotes, goes through to the commandline, since that
def windows_app_list
['start "launchy" /b']
['start \\"launchy\\" /b']
end

def cygwin_app_list
['cmd /C start "launchy" /b']
['cmd /C start \\"launchy\\" /b']
end

# hardcode this to open?
Expand Down
2 changes: 1 addition & 1 deletion lib/launchy/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module Launchy
VERSION = "3.1.0"
VERSION = "3.1.1"

# Internal: Version number of Launchy
module Version
Expand Down
2 changes: 1 addition & 1 deletion spec/launchy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
it "opens a local file if we have a drive letter and a valid path on windows" do
uri = "C:#{__FILE__}"
Launchy.open(uri, dry_run: true, host_os: "windows")
_($stdout.string.strip).must_equal "start launchy /b #{uri}"
_($stdout.string.strip).must_equal "start \"launchy\" /b #{uri}"
end

it "opens a data url with a forced browser application" do
Expand Down

0 comments on commit 866ba7d

Please sign in to comment.