test-cmd.rb 0.5.2 → 0.6.0

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: c2396593840d674fad470e2e4fcb0f0fc74e55987fe5caec27128457b0608453
4
- data.tar.gz: 3b6c43870258be5d3c0a1039e5e8436bff314ea05c03dab2866593dafbf43591
3
+ metadata.gz: 031f9708015f5e2e10d4b9afe09db3841c2a7c8ffa9ee83717d12ff4e078cd02
4
+ data.tar.gz: e1afc91430c82bfb3e146ea3b3a8a58c9fdb047b4c25c2be7b62d2b1470fd694
5
5
  SHA512:
6
- metadata.gz: edb9931271bfc62a1c22be0717659fa83a670652b97ef7ebe74fe98e2605b21fc4c87647c75aa20c4913a8a76e6bd1d3de7a3d28fe74f75d800293844c2b442e
7
- data.tar.gz: 3f95d41e84bb4ddf323798dee95e33872e72ff32869f3c1d82f629c00e1b15e840fd93b504f5fd15c7cfa4aa4dd280da172f7edeffd017ec3b486ce7dd2d8ea3
6
+ metadata.gz: 599e9bd0599c675f58b742e556b60c0d475b3a8fbe50012eddcc633eb1f09492791e88f0fbc7161a63172b96df1268a80304cd1b6dbb738ddd06d48ce9ad30ed
7
+ data.tar.gz: acc8485e9f6fde4c25e80dd354933f5750804fe0f066054b2e4cea3c4093a2020df28d86ab7f055766466658d3a69d6a53d89699bb6f0d3652b3cdd8f46eec3d
data/README.md CHANGED
@@ -1,11 +1,7 @@
1
1
  ## About
2
2
 
3
3
  test-cmd.rb is a library for accessing the output streams
4
- (both stdout and stderr) of a spawned process. The library was
5
- first realized in a test environment, where it provided a path
6
- for verifying that when code examples are run they produce the
7
- expected output. The library can be generally useful outside a
8
- test environment, too.
4
+ (both stdout and stderr) of a spawned process.
9
5
 
10
6
  ## Examples
11
7
 
@@ -53,7 +49,7 @@ require "test/cmd"
53
49
  str = cmd("du")
54
50
  .arg("-s").arg("-h")
55
51
  .spawn.stdout
56
- puts str
52
+ puts str
57
53
  ```
58
54
 
59
55
  ### IO#sync
@@ -96,30 +92,24 @@ Process.wait(pid)
96
92
  p cmd("ruby test.rb").stdout # => "foo\nbar\n"
97
93
  ```
98
94
 
99
- ## Sources
95
+ ## Documentation
100
96
 
101
- * [Source code (GitHub)](https://github.com/0x1eef/test-cmd.rb#readme)
102
- * [Source code (GitLab)](https://gitlab.com/0x1eef/test-cmd.rb#about)
97
+ A complete API reference is available at
98
+ [0x1eef.github.io/x/test-cmd.rb](https://0x1eef.github.io/x/test-cmd.rb).
103
99
 
104
100
  ## Install
105
101
 
106
- test-cmd.rb is distributed as a RubyGem through its git repositories. <br>
107
- [GitHub](https://github.com/0x1eef/test-cmd.rb),
108
- and
109
- [GitLab](https://gitlab.com/0x1eef/test-cmd.rb)
110
- are available as sources.
111
-
112
- ``` ruby
113
- # Gemfile
114
- gem "test-cmd.rb", github: "0x1eef/test-cmd.rb", tag: "v0.5.2"
115
- ```
116
-
117
102
  **Rubygems.org**
118
103
 
119
- test-cmd.rb can also be installed via rubygems.org.
104
+ test-cmd.rb can be installed via rubygems.org.
120
105
 
121
106
  gem install test-cmd.rb
122
107
 
108
+ ## Sources
109
+
110
+ * [GitHub](https://github.com/0x1eef/test-cmd.rb#readme)
111
+ * [GitLab](https://gitlab.com/0x1eef/test-cmd.rb#about)
112
+
123
113
  ## License
124
114
 
125
115
  [BSD Zero Clause](https://choosealicense.com/licenses/0bsd/).
data/lib/test-cmd.rb CHANGED
@@ -3,11 +3,7 @@ end unless defined?(Test)
3
3
 
4
4
  ##
5
5
  # test-cmd.rb is a library for accessing the output streams
6
- # (both stdout and stderr) of a spawned process. The library was
7
- # first realized in a test environment, where it provided a path
8
- # for verifying that when code examples are run they produce the
9
- # expected output. The library can be generally useful outside a
10
- # test environment, too.
6
+ # (both stdout and stderr) of a spawned process.
11
7
  class Test::Cmd
12
8
  require "tempfile"
13
9
 
@@ -112,13 +108,13 @@ class Test::Cmd
112
108
  # @api private
113
109
  def unlink!(file)
114
110
  file.tap do
115
- File.chmod(0000, file.path)
111
+ File.chmod(0, file.path)
116
112
  file.unlink
117
113
  end
118
114
  end
119
115
  end
120
116
 
121
- module Test::CmdMixin
117
+ module Test::Cmd::Mixin
122
118
  ##
123
119
  # @param [String] cmd
124
120
  # A command to execute
@@ -132,5 +128,5 @@ module Test::CmdMixin
132
128
  end
133
129
 
134
130
  module Kernel
135
- include Test::CmdMixin
131
+ include Test::Cmd::Mixin
136
132
  end
data/test-cmd.rb.gemspec CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |gem|
5
5
  gem.authors = ["0x1eef"]
6
6
  gem.email = ["0x1eef@protonmail.com"]
7
7
  gem.homepage = "https://github.com/0x1eef/test-cmd.rb#readme"
8
- gem.version = "0.5.2"
8
+ gem.version = "0.6.0"
9
9
  gem.required_ruby_version = ">= 3.0"
10
10
  gem.licenses = ["0BSD"]
11
11
  gem.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-cmd.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - '0x1eef'
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-01 00:00:00.000000000 Z
11
+ date: 2024-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit