Skip to content

Commit 1568be4

Browse files
committed
Added a dependency on open4 to get STDIN pass-through working on MRI.
1 parent b8c5b79 commit 1568be4

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ begin
1111
spec.homepage = "https://github.com/nirvdrum/svn2git"
1212
spec.email = "[email protected]"
1313
spec.add_development_dependency 'test-unit'
14+
spec.add_dependency 'open4'
1415
end
1516
Jeweler::GemcutterTasks.new
1617

lib/svn2git/migration.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
require 'optparse'
22
require 'pp'
3+
require 'open4'
34

45
module Svn2Git
56
DEFAULT_AUTHORS_FILE = "~/.svn2git/authors"
@@ -342,7 +343,9 @@ def run_command(cmd, exit_on_error=true, printout_output=false)
342343
ret = ''
343344
mutex = Mutex.new
344345

345-
status = IO.popen4(cmd) do |pid, stdin, stdout, stderr|
346+
# Open4 forks, which JRuby doesn't support. But JRuby added a popen4-compatible method on the IO class,
347+
# so we can use that instead.
348+
status = (defined?(JRUBY_VERSION) ? IO : Open4).popen4(cmd) do |pid, stdin, stdout, stderr|
346349
threads = []
347350

348351
threads << Thread.new(stdout) do |stdout|

svn2git.gemspec

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
# DO NOT EDIT THIS FILE DIRECTLY
33
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
44
# -*- encoding: utf-8 -*-
5-
# stub: svn2git 2.2.5 ruby lib
65

76
Gem::Specification.new do |s|
8-
s.name = "svn2git"
7+
s.name = %q{svn2git}
98
s.version = "2.2.5"
109

1110
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12-
s.require_paths = ["lib"]
1311
s.authors = ["James Coglan", "Kevin Menard"]
14-
s.date = "2014-03-10"
15-
s.email = "[email protected]"
12+
s.date = %q{2014-05-13}
13+
s.default_executable = %q{svn2git}
14+
s.email = %q{[email protected]}
1615
s.executables = ["svn2git"]
1716
s.extra_rdoc_files = [
1817
"ChangeLog.markdown",
@@ -31,20 +30,24 @@ Gem::Specification.new do |s|
3130
"test/escape_quotes_test.rb",
3231
"test/test_helper.rb"
3332
]
34-
s.homepage = "https://github.com/nirvdrum/svn2git"
35-
s.rubygems_version = "2.2.2"
36-
s.summary = "A tool for migrating svn projects to git"
33+
s.homepage = %q{https://github.com/nirvdrum/svn2git}
34+
s.require_paths = ["lib"]
35+
s.rubygems_version = %q{1.6.2}
36+
s.summary = %q{A tool for migrating svn projects to git}
3737

3838
if s.respond_to? :specification_version then
39-
s.specification_version = 4
39+
s.specification_version = 3
4040

4141
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
4242
s.add_development_dependency(%q<test-unit>, [">= 0"])
43+
s.add_runtime_dependency(%q<open4>, [">= 0"])
4344
else
4445
s.add_dependency(%q<test-unit>, [">= 0"])
46+
s.add_dependency(%q<open4>, [">= 0"])
4547
end
4648
else
4749
s.add_dependency(%q<test-unit>, [">= 0"])
50+
s.add_dependency(%q<open4>, [">= 0"])
4851
end
4952
end
5053

0 commit comments

Comments
 (0)