bio-commandeer 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 +4 -4
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/VERSION +1 -1
- data/lib/bio-commandeer/commandeer.rb +1 -1
- data/spec/bio-commandeer_spec.rb +7 -7
- data/spec/spec_helper.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c544cb54f4692c602acb4c3b7b4ed6b433abe8d1
|
4
|
+
data.tar.gz: 4f46eee196608fa65fb2a3d8bfcf246615ddea1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e66f6b0c25450feb81a939758ef9fb761f6deba44ecf03f7e23aee62f26fdaf0f735a9ac084cc6a2dd309ef3b2c56238a9d58bd17f7c6315cb318822cae7c5e
|
7
|
+
data.tar.gz: 013a8046ced4623cb65e86afd180898a9f43d2c275f83cdafe54279033e096a2c73263602286d6dca0325774ba8b628d1baccca14f5b56c2388754a0575964a6
|
data/Gemfile
CHANGED
@@ -8,7 +8,7 @@ gem 'systemu', '~>2.6'
|
|
8
8
|
# Add dependencies to develop your gem here.
|
9
9
|
# Include everything needed to run rake, tests, features, etc.
|
10
10
|
group :development do
|
11
|
-
gem "rspec", "~> 2
|
11
|
+
gem "rspec", "~> 3.2"
|
12
12
|
gem "rdoc", "~> 3.12"
|
13
13
|
gem "jeweler", "~> 2.0"
|
14
14
|
gem "bundler", "~> 1.3"
|
data/README.md
CHANGED
@@ -37,8 +37,8 @@ puts Bio::Commandeer.run 'echo 5', :log=>true
|
|
37
37
|
```
|
38
38
|
On stderr this gives
|
39
39
|
```
|
40
|
-
INFO bio-commandeer: Running command: echo 5
|
41
|
-
INFO bio-commandeer: Command finished with exitstatus 0
|
40
|
+
INFO bio-commandeer: Running command: echo 5
|
41
|
+
INFO bio-commandeer: Command finished with exitstatus 0
|
42
42
|
```
|
43
43
|
Or a logging can be given directly, so long as it has an `info` method:
|
44
44
|
```ruby
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -32,7 +32,7 @@ module Bio
|
|
32
32
|
end
|
33
33
|
|
34
34
|
if status.exitstatus != 0
|
35
|
-
raise Bio::CommandFailedException, "Command returned non-zero exit status (#{status.exitstatus}), likely indicating failure. Command run was #{command} and the STDERR was:\n#{stderr}"
|
35
|
+
raise Bio::CommandFailedException, "Command returned non-zero exit status (#{status.exitstatus}), likely indicating failure. Command run was #{command} and the STDERR was:\n#{stderr}\nSTDOUTT was: #{stdout}"
|
36
36
|
end
|
37
37
|
|
38
38
|
return stdout
|
data/spec/bio-commandeer_spec.rb
CHANGED
@@ -3,15 +3,15 @@ require 'tempfile'
|
|
3
3
|
|
4
4
|
describe "BioCommandeer" do
|
5
5
|
it "should return stdout" do
|
6
|
-
Bio::Commandeer.run("echo 1 3").
|
6
|
+
expect(Bio::Commandeer.run("echo 1 3")).to eq "1 3\n"
|
7
7
|
end
|
8
8
|
|
9
9
|
it 'should raise when exit status the command fails' do
|
10
|
-
expect
|
10
|
+
expect{Bio::Commandeer.run("cat /definitelyNotAFile")}.to raise_error(Bio::CommandFailedException)
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'should accept stdin' do
|
14
|
-
Bio::Commandeer.run('cat', :stdin => 'dog').
|
14
|
+
expect(Bio::Commandeer.run('cat', :stdin => 'dog')).to eq "dog"
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'should do logging with bio-logger' do
|
@@ -26,9 +26,9 @@ describe "BioCommandeer" do
|
|
26
26
|
|
27
27
|
status, stdout, stderr = systemu "RUBYLIB=$RUBYLIB:#{lib} ruby #{f.path}"
|
28
28
|
|
29
|
-
stderr.
|
29
|
+
expect(stderr).to eq " INFO bio-commandeer: Running command: echo 5\n"+
|
30
30
|
" INFO bio-commandeer: Command finished with exitstatus 0\n"
|
31
|
-
stdout.
|
31
|
+
expect(stdout).to eq "5\n"
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -46,9 +46,9 @@ describe "BioCommandeer" do
|
|
46
46
|
status, stdout, stderr = systemu "RUBYLIB=$RUBYLIB:#{lib} ruby #{f.path}"
|
47
47
|
|
48
48
|
# Note the source of the log
|
49
|
-
stderr.
|
49
|
+
expect(stderr).to eq " INFO anotherlog: Running command: echo 50\n"+
|
50
50
|
" INFO anotherlog: Command finished with exitstatus 0\n"
|
51
|
-
stdout.
|
51
|
+
expect(stdout).to eq "50\n"
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bio-commandeer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben J. Woodcroft
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bio-logger
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '2
|
47
|
+
version: '3.2'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '2
|
54
|
+
version: '3.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rdoc
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
137
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.2.
|
138
|
+
rubygems_version: 2.2.2
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: dead simple method of running shell commands from within Ruby
|