right_popen 1.1.3 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +2 -0
- data/lib/right_popen.rb +35 -31
- data/lib/right_popen/linux/popen3_async.rb +26 -10
- data/lib/right_popen/linux/process.rb +21 -25
- data/lib/right_popen/{linux/popen3_sync.rb → popen3_sync.rb} +2 -1
- data/lib/right_popen/process_base.rb +20 -16
- data/lib/right_popen/process_status.rb +3 -0
- data/lib/right_popen/safe_output_buffer.rb +3 -0
- data/lib/right_popen/target_proxy.rb +12 -8
- data/right_popen.gemspec +57 -31
- metadata +39 -128
- data/Rakefile +0 -127
- data/lib/right_popen/linux/accumulator.rb +0 -127
- data/lib/right_popen/linux/utilities.rb +0 -94
- data/lib/right_popen/version.rb +0 -28
- data/spec/background.rb +0 -28
- data/spec/increment.rb +0 -2
- data/spec/print_env.rb +0 -2
- data/spec/produce_mixed_output.rb +0 -12
- data/spec/produce_output.rb +0 -2
- data/spec/produce_status.rb +0 -1
- data/spec/produce_stderr_only.rb +0 -5
- data/spec/produce_stdout_only.rb +0 -5
- data/spec/right_popen/linux/accumulator_spec.rb +0 -267
- data/spec/right_popen/linux/utilities_spec.rb +0 -178
- data/spec/right_popen/safe_output_buffer_spec.rb +0 -26
- data/spec/right_popen_spec.rb +0 -331
- data/spec/runner.rb +0 -217
- data/spec/sleeper.rb +0 -35
- data/spec/spec_helper.rb +0 -26
- data/spec/stdout.rb +0 -28
- data/spec/writer.rb +0 -34
data/right_popen.gemspec
CHANGED
@@ -1,58 +1,84 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
spec = ::Gem::Specification.new do |spec|
|
2
|
+
platforms = [:linux, :mswin, :mingw]
|
3
|
+
case RUBY_PLATFORM
|
4
|
+
when /mswin/
|
5
|
+
platform = :mswin
|
6
|
+
when /mingw/
|
7
|
+
if RUBY_VERSION =~ /^1\.9\.\d$/
|
8
|
+
platform = :mingw
|
9
|
+
else
|
10
|
+
fail 'This gem is for use with ruby 1.9 mingw only.'
|
11
|
+
end
|
12
|
+
else
|
13
|
+
platform = :linux
|
14
|
+
end
|
6
15
|
|
7
16
|
spec.name = 'right_popen'
|
8
|
-
spec.version =
|
9
|
-
spec.authors = ['Scott Messier', 'Raphael Simon', '
|
10
|
-
spec.email = '
|
17
|
+
spec.version = '3.0.1'
|
18
|
+
spec.authors = ['Scott Messier', 'Raphael Simon', 'Tony Spataro']
|
19
|
+
spec.email = 'support@rightscale.com'
|
11
20
|
spec.homepage = 'https://github.com/rightscale/right_popen'
|
12
|
-
|
21
|
+
case platform
|
22
|
+
when :mswin
|
13
23
|
spec.platform = 'x86-mswin32-60'
|
24
|
+
when :mingw
|
25
|
+
spec.platform = 'x86-mingw32'
|
14
26
|
else
|
15
27
|
spec.platform = Gem::Platform::RUBY
|
16
28
|
end
|
17
|
-
spec.summary
|
29
|
+
spec.summary = 'Provides a platform-independent popen implementation'
|
18
30
|
spec.has_rdoc = true
|
19
31
|
spec.rdoc_options = ["--main", "README.rdoc", "--title", "RightPopen"]
|
20
32
|
spec.extra_rdoc_files = ["README.rdoc"]
|
21
|
-
spec.required_ruby_version = '>= 1.
|
33
|
+
spec.required_ruby_version = '>= 1.9.3'
|
22
34
|
spec.rubyforge_project = %q{right_popen}
|
23
35
|
|
24
36
|
spec.description = <<-EOF
|
25
37
|
RightPopen allows running external processes aynchronously while still
|
26
|
-
capturing their standard and error outputs. It relies on EventMachine for
|
27
|
-
|
28
|
-
platform but there is also a
|
38
|
+
capturing their standard and error outputs. It relies on EventMachine for the
|
39
|
+
asynchronous popen call but EM is not required for synchronous popen.
|
40
|
+
The Linux implementation is valid for any Linux platform but there is also a
|
41
|
+
native implementation for Windows platforms.
|
29
42
|
EOF
|
30
43
|
|
31
|
-
|
32
|
-
|
44
|
+
case platform
|
45
|
+
when :mswin
|
46
|
+
extension_dir = 'ext,'
|
33
47
|
else
|
34
|
-
extension_dir =
|
48
|
+
extension_dir = ''
|
35
49
|
end
|
36
|
-
candidates = Dir.glob("{#{extension_dir}lib
|
37
|
-
|
50
|
+
candidates = ::Dir.glob("{#{extension_dir}lib}/**/*") +
|
51
|
+
%w(LICENSE README.rdoc right_popen.gemspec)
|
52
|
+
exclusions = [
|
53
|
+
'Makefile', '.obj', '.pdb', '.def', '.exp', '.lib',
|
54
|
+
'win32/right_popen.so' # original .so directory, now mswin
|
55
|
+
]
|
38
56
|
candidates = candidates.delete_if do |item|
|
39
|
-
|
57
|
+
exclusions.any? { |exclusion| item.include?(exclusion) }
|
40
58
|
end
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
59
|
+
|
60
|
+
# remove files specific to other platforms.
|
61
|
+
case platform
|
62
|
+
when :mswin
|
63
|
+
candidates = candidates.delete_if { |item| item.include?('/linux/') }
|
64
|
+
candidates = candidates.delete_if { |item| item.include?('/mingw/') }
|
65
|
+
when :mingw
|
66
|
+
candidates = candidates.delete_if { |item| item.include?('/linux/') }
|
67
|
+
candidates = candidates.delete_if { |item| item.include?('/mswin/') }
|
68
|
+
else
|
69
|
+
candidates = candidates.delete_if { |item| item.include?('/windows/') }
|
47
70
|
end
|
48
71
|
spec.files = candidates.sort!
|
49
72
|
|
50
73
|
# Current implementation supports >= 1.0.0
|
51
74
|
spec.add_development_dependency(%q<eventmachine>, [">= 1.0.0"])
|
52
|
-
|
53
|
-
|
75
|
+
case platform
|
76
|
+
when :mswin
|
77
|
+
spec.add_runtime_dependency('win32-api', '1.4.5')
|
78
|
+
spec.add_runtime_dependency('windows-api', '0.4.0')
|
79
|
+
spec.add_runtime_dependency('windows-pr', '1.0.8')
|
80
|
+
spec.add_runtime_dependency('win32-dir', '0.3.5')
|
81
|
+
spec.add_runtime_dependency('win32-process', '0.6.1')
|
82
|
+
spec.add_development_dependency('win32console', '~> 1.3.0')
|
54
83
|
end
|
55
|
-
spec.add_development_dependency('rspec', "~> 1.3")
|
56
|
-
spec.add_development_dependency('rake', "~> 0.8.7")
|
57
|
-
spec.add_development_dependency('flexmock')
|
58
84
|
end
|
metadata
CHANGED
@@ -1,168 +1,79 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: right_popen
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
- 3
|
10
|
-
version: 1.1.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.1
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Scott Messier
|
14
8
|
- Raphael Simon
|
15
|
-
-
|
9
|
+
- Tony Spataro
|
16
10
|
autorequire:
|
17
11
|
bindir: bin
|
18
12
|
cert_chain: []
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
none: false
|
26
|
-
requirements:
|
13
|
+
date: 2016-03-09 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: eventmachine
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
27
19
|
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 23
|
30
|
-
segments:
|
31
|
-
- 1
|
32
|
-
- 0
|
33
|
-
- 0
|
20
|
+
- !ruby/object:Gem::Version
|
34
21
|
version: 1.0.0
|
35
|
-
version_requirements: *id001
|
36
|
-
name: eventmachine
|
37
|
-
type: :development
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
prerelease: false
|
40
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 9
|
46
|
-
segments:
|
47
|
-
- 1
|
48
|
-
- 3
|
49
|
-
version: "1.3"
|
50
|
-
version_requirements: *id002
|
51
|
-
name: rspec
|
52
22
|
type: :development
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
23
|
prerelease: false
|
55
|
-
|
56
|
-
|
57
|
-
requirements:
|
58
|
-
- - ~>
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
hash: 49
|
61
|
-
segments:
|
62
|
-
- 0
|
63
|
-
- 8
|
64
|
-
- 7
|
65
|
-
version: 0.8.7
|
66
|
-
version_requirements: *id003
|
67
|
-
name: rake
|
68
|
-
type: :development
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
prerelease: false
|
71
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
73
|
-
requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
74
26
|
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
segments:
|
78
|
-
- 0
|
79
|
-
version: "0"
|
80
|
-
version_requirements: *id004
|
81
|
-
name: flexmock
|
82
|
-
type: :development
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 1.0.0
|
83
29
|
description: |
|
84
30
|
RightPopen allows running external processes aynchronously while still
|
85
|
-
capturing their standard and error outputs. It relies on EventMachine for
|
86
|
-
|
87
|
-
platform but there is also a
|
88
|
-
|
89
|
-
email:
|
31
|
+
capturing their standard and error outputs. It relies on EventMachine for the
|
32
|
+
asynchronous popen call but EM is not required for synchronous popen.
|
33
|
+
The Linux implementation is valid for any Linux platform but there is also a
|
34
|
+
native implementation for Windows platforms.
|
35
|
+
email: support@rightscale.com
|
90
36
|
executables: []
|
91
|
-
|
92
37
|
extensions: []
|
93
|
-
|
94
|
-
extra_rdoc_files:
|
38
|
+
extra_rdoc_files:
|
95
39
|
- README.rdoc
|
96
|
-
files:
|
40
|
+
files:
|
97
41
|
- LICENSE
|
98
42
|
- README.rdoc
|
99
|
-
- Rakefile
|
100
43
|
- lib/right_popen.rb
|
101
|
-
- lib/right_popen/linux/accumulator.rb
|
102
44
|
- lib/right_popen/linux/popen3_async.rb
|
103
|
-
- lib/right_popen/linux/popen3_sync.rb
|
104
45
|
- lib/right_popen/linux/process.rb
|
105
|
-
- lib/right_popen/
|
46
|
+
- lib/right_popen/popen3_sync.rb
|
106
47
|
- lib/right_popen/process_base.rb
|
107
48
|
- lib/right_popen/process_status.rb
|
108
49
|
- lib/right_popen/safe_output_buffer.rb
|
109
50
|
- lib/right_popen/target_proxy.rb
|
110
|
-
- lib/right_popen/version.rb
|
111
51
|
- right_popen.gemspec
|
112
|
-
- spec/background.rb
|
113
|
-
- spec/increment.rb
|
114
|
-
- spec/print_env.rb
|
115
|
-
- spec/produce_mixed_output.rb
|
116
|
-
- spec/produce_output.rb
|
117
|
-
- spec/produce_status.rb
|
118
|
-
- spec/produce_stderr_only.rb
|
119
|
-
- spec/produce_stdout_only.rb
|
120
|
-
- spec/right_popen/linux/accumulator_spec.rb
|
121
|
-
- spec/right_popen/linux/utilities_spec.rb
|
122
|
-
- spec/right_popen/safe_output_buffer_spec.rb
|
123
|
-
- spec/right_popen_spec.rb
|
124
|
-
- spec/runner.rb
|
125
|
-
- spec/sleeper.rb
|
126
|
-
- spec/spec_helper.rb
|
127
|
-
- spec/stdout.rb
|
128
|
-
- spec/writer.rb
|
129
52
|
homepage: https://github.com/rightscale/right_popen
|
130
53
|
licenses: []
|
131
|
-
|
54
|
+
metadata: {}
|
132
55
|
post_install_message:
|
133
|
-
rdoc_options:
|
134
|
-
- --main
|
56
|
+
rdoc_options:
|
57
|
+
- "--main"
|
135
58
|
- README.rdoc
|
136
|
-
- --title
|
59
|
+
- "--title"
|
137
60
|
- RightPopen
|
138
|
-
require_paths:
|
61
|
+
require_paths:
|
139
62
|
- lib
|
140
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
-
|
142
|
-
requirements:
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
143
65
|
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
- 8
|
149
|
-
- 6
|
150
|
-
version: 1.8.6
|
151
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
|
-
none: false
|
153
|
-
requirements:
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 1.9.3
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
154
70
|
- - ">="
|
155
|
-
- !ruby/object:Gem::Version
|
156
|
-
|
157
|
-
segments:
|
158
|
-
- 0
|
159
|
-
version: "0"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
160
73
|
requirements: []
|
161
|
-
|
162
74
|
rubyforge_project: right_popen
|
163
|
-
rubygems_version:
|
75
|
+
rubygems_version: 2.2.5
|
164
76
|
signing_key:
|
165
|
-
specification_version:
|
77
|
+
specification_version: 4
|
166
78
|
summary: Provides a platform-independent popen implementation
|
167
79
|
test_files: []
|
168
|
-
|
data/Rakefile
DELETED
@@ -1,127 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bundler'
|
3
|
-
require 'fileutils'
|
4
|
-
require 'rake'
|
5
|
-
require 'rake/clean'
|
6
|
-
require 'rake/gempackagetask'
|
7
|
-
require 'rake/rdoctask'
|
8
|
-
require 'spec/rake/spectask'
|
9
|
-
require 'rbconfig'
|
10
|
-
|
11
|
-
def list_spec_files
|
12
|
-
list = Dir['spec/**/*_spec.rb']
|
13
|
-
list.delete_if { |path| path.include?('/linux/') } if RUBY_PLATFORM =~ /mswin/
|
14
|
-
list
|
15
|
-
end
|
16
|
-
|
17
|
-
include Config
|
18
|
-
|
19
|
-
Bundler::GemHelper.install_tasks
|
20
|
-
|
21
|
-
# == Gem == #
|
22
|
-
|
23
|
-
gemtask = Rake::GemPackageTask.new(Gem::Specification.load("right_popen.gemspec")) do |package|
|
24
|
-
package.package_dir = ENV['PACKAGE_DIR'] || 'pkg'
|
25
|
-
package.need_zip = true
|
26
|
-
package.need_tar = true
|
27
|
-
end
|
28
|
-
|
29
|
-
directory gemtask.package_dir
|
30
|
-
|
31
|
-
CLEAN.include(gemtask.package_dir)
|
32
|
-
|
33
|
-
desc "Clean any build files for right_popen"
|
34
|
-
task :win_clean do
|
35
|
-
if RUBY_PLATFORM =~ /mswin/
|
36
|
-
if File.exists?('ext/Makefile')
|
37
|
-
Dir.chdir('ext') do
|
38
|
-
sh 'nmake distclean'
|
39
|
-
end
|
40
|
-
end
|
41
|
-
rm 'lib/win32/right_popen.so' if File.file?('lib/win32/right_popen.so')
|
42
|
-
end
|
43
|
-
end
|
44
|
-
task :clean => :win_clean
|
45
|
-
|
46
|
-
desc "Build right_popen (but don't install it)"
|
47
|
-
task :build => [:clean] do
|
48
|
-
if RUBY_PLATFORM =~ /mswin/
|
49
|
-
Dir.chdir('ext') do
|
50
|
-
ruby 'extconf.rb'
|
51
|
-
sh 'nmake'
|
52
|
-
end
|
53
|
-
FileUtils::mkdir_p 'lib/win32'
|
54
|
-
mv 'ext/right_popen.so', 'lib/win32'
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
desc "Build a binary gem"
|
59
|
-
task :gem => [:build] do
|
60
|
-
if RUBY_PLATFORM =~ /mswin/
|
61
|
-
# the built .so file must appear under 'lib/win32' for the windows gem and
|
62
|
-
# the base gem task doesn't appear to handle this. this may be an issue with
|
63
|
-
# calculating the file list in the gemspec before the .so has actually been
|
64
|
-
# created. workaround is to invoke the gem build gemspec command line after
|
65
|
-
# the build step produces the .so file.
|
66
|
-
sh 'gem build right_popen.gemspec'
|
67
|
-
FileUtils::rm_rf('pkg')
|
68
|
-
FileUtils::mkdir_p('pkg')
|
69
|
-
Dir.glob('*.gem').each { |gem_path| FileUtils::mv(gem_path, File.join('pkg', File.basename((gem_path)))) }
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
desc 'Install the right_popen library as a gem'
|
74
|
-
task :install_gem => [:gem] do
|
75
|
-
Dir.chdir(File.dirname(__FILE__)) do
|
76
|
-
file = Dir["pkg/*.gem"].first
|
77
|
-
sh "gem install #{file}"
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
desc 'Uninstalls and reinstalls the right_popen library as a gem'
|
82
|
-
task :reinstall_gem do
|
83
|
-
sh "gem uninstall right_popen"
|
84
|
-
sh "rake install_gem"
|
85
|
-
end
|
86
|
-
|
87
|
-
# == Unit Tests == #
|
88
|
-
|
89
|
-
task :specs => :spec
|
90
|
-
|
91
|
-
desc "Run unit tests"
|
92
|
-
Spec::Rake::SpecTask.new do |t|
|
93
|
-
t.spec_files = list_spec_files
|
94
|
-
end
|
95
|
-
|
96
|
-
desc "Run unit tests with RCov"
|
97
|
-
Spec::Rake::SpecTask.new(:rcov) do |t|
|
98
|
-
t.spec_files = list_spec_files
|
99
|
-
t.rcov = true
|
100
|
-
end
|
101
|
-
|
102
|
-
desc "Print Specdoc for unit tests"
|
103
|
-
Spec::Rake::SpecTask.new(:doc) do |t|
|
104
|
-
t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
105
|
-
t.spec_files = list_spec_files
|
106
|
-
end
|
107
|
-
|
108
|
-
# == Documentation == #
|
109
|
-
|
110
|
-
desc "Generate API documentation to doc/rdocs/index.html"
|
111
|
-
Rake::RDocTask.new do |rd|
|
112
|
-
rd.rdoc_dir = 'doc/rdocs'
|
113
|
-
rd.main = 'README.rdoc'
|
114
|
-
rd.rdoc_files.include 'README.rdoc', "lib/**/*.rb"
|
115
|
-
|
116
|
-
rd.options << '--inline-source'
|
117
|
-
rd.options << '--line-numbers'
|
118
|
-
rd.options << '--all'
|
119
|
-
rd.options << '--fileboxes'
|
120
|
-
rd.options << '--diagram'
|
121
|
-
end
|
122
|
-
|
123
|
-
# == Emacs integration == #
|
124
|
-
desc "Rebuild TAGS file"
|
125
|
-
task :tags do
|
126
|
-
sh "rtags -R lib spec"
|
127
|
-
end
|