open3 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f1dc26c8d711ed9394d746ea2fad6222de3cce813178dfb2d1aa52eb4fc0432
4
- data.tar.gz: 121bb5a4ee245b344004afdf1bdabf0af421c5acaa306b08de5ff62865a896c3
3
+ metadata.gz: 7f598d530ced19be109f452253e266841b9c00d71e96687d31c2e5fa5db86957
4
+ data.tar.gz: be2ec8a86eeaa8e60907e9c95268d6b65ef3b477083051054a6adb1521a0fceb
5
5
  SHA512:
6
- metadata.gz: ccb106824f5e6a47f6cf4324bc7638af0ea27fda57b87da181fb32c60cec309590a6d828635bb27afbfb13b3113e857a1d23cf88665a1630eeb5ea4e4e2dfe2c
7
- data.tar.gz: '0918ee950ed53eeed0b64b569034496953b5e788d937bac2fb30c1ee1608c645adc5cd1c76c1982e263a3ae999af23e0783648c48a08e7f3a14d9fe1f3331924'
6
+ metadata.gz: c327ed7dd6b0769dd17809b7b155028ea6604364ce6a123b5f59d7f9a98ffe4e078e170f0268fb5eccdfc96a10bf9d284bdd85391052b104469906d410e010e9
7
+ data.tar.gz: b641d417656c67cd4199a0592ef71dc24d852fda7084cf31b89e4172eebf91e660f585a3213ab8257cfa942fa928be5ee7fc8dd2b693a76605b0f9acd38f1033
@@ -0,0 +1,24 @@
1
+ name: test
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ name: build (${{ matrix.ruby }} / ${{ matrix.os }})
8
+ strategy:
9
+ matrix:
10
+ ruby: [ 2.7, 2.6, head ]
11
+ os: [ ubuntu-latest, macos-latest ]
12
+ runs-on: ${{ matrix.os }}
13
+ steps:
14
+ - uses: actions/checkout@master
15
+ - name: Set up Ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: ${{ matrix.ruby }}
19
+ - name: Install dependencies
20
+ run: |
21
+ gem install bundler --no-document
22
+ bundle install
23
+ - name: Run test
24
+ run: rake test
data/Rakefile CHANGED
@@ -7,4 +7,11 @@ Rake::TestTask.new(:test) do |t|
7
7
  t.test_files = FileList["test/**/test_*.rb"]
8
8
  end
9
9
 
10
+ task :sync_tool do
11
+ require 'fileutils'
12
+ FileUtils.cp "../ruby/tool/lib/test/unit/core_assertions.rb", "./test/lib"
13
+ FileUtils.cp "../ruby/tool/lib/envutil.rb", "./test/lib"
14
+ FileUtils.cp "../ruby/tool/lib/find_executable.rb", "./test/lib"
15
+ end
16
+
10
17
  task :default => :test
@@ -30,6 +30,7 @@
30
30
  #
31
31
 
32
32
  module Open3
33
+ VERSION = "0.1.1"
33
34
 
34
35
  # Open stdin, stdout, and stderr streams and start external executable.
35
36
  # In addition, a thread to wait for the started process is created.
@@ -206,6 +207,13 @@ module Open3
206
207
  opts[[:out, :err]] = out_w
207
208
 
208
209
  popen_run(cmd, opts, [in_r, out_w], [in_w, out_r], &block)
210
+ ensure
211
+ if block
212
+ in_r.close
213
+ in_w.close
214
+ out_r.close
215
+ out_w.close
216
+ end
209
217
  end
210
218
  module_function :popen2e
211
219
 
@@ -1,17 +1,23 @@
1
- lib = File.expand_path("lib", __dir__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "open3/version"
1
+ # frozen_string_literal: true
2
+
3
+ name = File.basename(__FILE__, ".gemspec")
4
+ version = ["lib", Array.new(name.count("-"), "..").join("/")].find do |dir|
5
+ break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
6
+ /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
7
+ end rescue nil
8
+ end
4
9
 
5
10
  Gem::Specification.new do |spec|
6
- spec.name = "open3"
7
- spec.version = Open3::VERSION
8
- spec.authors = ["Hiroshi SHIBATA"]
9
- spec.email = ["hsbt@ruby-lang.org"]
11
+ spec.name = name
12
+ spec.version = version
13
+ spec.authors = ["Yukihiro Matsumoto"]
14
+ spec.email = ["matz@ruby-lang.org"]
10
15
 
11
16
  spec.summary = %q{Popen, but with stderr, too}
12
17
  spec.description = spec.summary
13
18
  spec.homepage = "https://github.com/ruby/open3"
14
- spec.license = "BSD-2-Clause"
19
+ spec.licenses = ["Ruby", "BSD-2-Clause"]
20
+ spec.required_ruby_version = ">= 2.6.0"
15
21
 
16
22
  spec.metadata["homepage_uri"] = spec.homepage
17
23
  spec.metadata["source_code_uri"] = spec.homepage
@@ -19,7 +25,7 @@ Gem::Specification.new do |spec|
19
25
  # Specify which files should be added to the gem when it is released.
20
26
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
27
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
22
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
+ `git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
29
  end
24
30
  spec.bindir = "exe"
25
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
metadata CHANGED
@@ -1,24 +1,24 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
- - Hiroshi SHIBATA
8
- autorequire:
7
+ - Yukihiro Matsumoto
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-06 00:00:00.000000000 Z
11
+ date: 2020-12-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Popen, but with stderr, too
14
14
  email:
15
- - hsbt@ruby-lang.org
15
+ - matz@ruby-lang.org
16
16
  executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
+ - ".github/workflows/test.yml"
20
21
  - ".gitignore"
21
- - ".travis.yml"
22
22
  - Gemfile
23
23
  - LICENSE.txt
24
24
  - README.md
@@ -26,15 +26,15 @@ files:
26
26
  - bin/console
27
27
  - bin/setup
28
28
  - lib/open3.rb
29
- - lib/open3/version.rb
30
29
  - open3.gemspec
31
30
  homepage: https://github.com/ruby/open3
32
31
  licenses:
32
+ - Ruby
33
33
  - BSD-2-Clause
34
34
  metadata:
35
35
  homepage_uri: https://github.com/ruby/open3
36
36
  source_code_uri: https://github.com/ruby/open3
37
- post_install_message:
37
+ post_install_message:
38
38
  rdoc_options: []
39
39
  require_paths:
40
40
  - lib
@@ -42,15 +42,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
42
42
  requirements:
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: '0'
45
+ version: 2.6.0
46
46
  required_rubygems_version: !ruby/object:Gem::Requirement
47
47
  requirements:
48
48
  - - ">="
49
49
  - !ruby/object:Gem::Version
50
50
  version: '0'
51
51
  requirements: []
52
- rubygems_version: 3.0.3
53
- signing_key:
52
+ rubygems_version: 3.2.2
53
+ signing_key:
54
54
  specification_version: 4
55
55
  summary: Popen, but with stderr, too
56
56
  test_files: []
@@ -1,6 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- - 2.6.3
5
- - ruby-head
6
- script: rake test
@@ -1,3 +0,0 @@
1
- module Open3
2
- VERSION = "0.1.0"
3
- end