shellshot 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/shellshot.rb +3 -2
- data/shellshot.gemspec +6 -5
- data/spec/shellshot_spec.rb +1 -1
- metadata +24 -13
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.2
|
data/lib/shellshot.rb
CHANGED
@@ -17,6 +17,7 @@ module Shellshot
|
|
17
17
|
def exec(command, options = {})
|
18
18
|
|
19
19
|
self.options = options
|
20
|
+
timeout = options[:timeout] || DEFAULT_TIMEOUT
|
20
21
|
|
21
22
|
prepare_pipes
|
22
23
|
self.pid = fork do
|
@@ -26,10 +27,10 @@ module Shellshot
|
|
26
27
|
end
|
27
28
|
|
28
29
|
begin
|
29
|
-
wait_for(
|
30
|
+
wait_for(timeout)
|
30
31
|
rescue Timeout::Error => e
|
31
32
|
terminate_child_process
|
32
|
-
raise
|
33
|
+
raise Timeout::Error, "execution of #{command} exceeded #{timeout} seconds"
|
33
34
|
end
|
34
35
|
|
35
36
|
true
|
data/shellshot.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{shellshot}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Petyo Ivanov"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-02-25}
|
13
13
|
s.description = %q{
|
14
14
|
A small library dealing with the obscurities of shell commands, piping and timeouts.
|
15
15
|
Most of the stuff comes from bad experience in http://beanstalkapp.com.
|
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
|
|
36
36
|
s.homepage = %q{http://github.com/underlog/shellshot}
|
37
37
|
s.rdoc_options = ["--charset=UTF-8"]
|
38
38
|
s.require_paths = ["lib"]
|
39
|
-
s.rubygems_version = %q{1.3.
|
39
|
+
s.rubygems_version = %q{1.3.6}
|
40
40
|
s.summary = %q{ruby proxy handling the complexities of system invocations}
|
41
41
|
s.test_files = [
|
42
42
|
"spec/shellshot_spec.rb",
|
@@ -59,3 +59,4 @@ Gem::Specification.new do |s|
|
|
59
59
|
s.add_dependency(%q<SystemTimer>, [">= 0"])
|
60
60
|
end
|
61
61
|
end
|
62
|
+
|
data/spec/shellshot_spec.rb
CHANGED
@@ -24,7 +24,7 @@ describe Shellshot do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should cancel execution on time if timeout provided" do
|
27
|
-
lambda { Shellshot.exec %q[ruby -e 'sleep 10000'], :timeout => 1 }.should raise_error(Timeout::Error)
|
27
|
+
lambda { Shellshot.exec %q[ruby -e 'sleep 10000'], :timeout => 1 }.should raise_error(Timeout::Error, "execution of ruby -e 'sleep 10000' exceeded 1 seconds")
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should raise error if command returned something else." do
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shellshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 4
|
8
|
+
- 2
|
9
|
+
version: 0.4.2
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Petyo Ivanov
|
@@ -9,29 +14,33 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-02-25 00:00:00 +02:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: rspec
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
23
29
|
version: "0"
|
24
|
-
|
30
|
+
type: :development
|
31
|
+
version_requirements: *id001
|
25
32
|
- !ruby/object:Gem::Dependency
|
26
33
|
name: SystemTimer
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
34
|
+
prerelease: false
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
39
|
+
segments:
|
40
|
+
- 0
|
33
41
|
version: "0"
|
34
|
-
|
42
|
+
type: :runtime
|
43
|
+
version_requirements: *id002
|
35
44
|
description: "\n A small library dealing with the obscurities of shell commands, piping and timeouts.\n Most of the stuff comes from bad experience in http://beanstalkapp.com.\n "
|
36
45
|
email: underlog@gmail.com
|
37
46
|
executables: []
|
@@ -67,18 +76,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
76
|
requirements:
|
68
77
|
- - ">="
|
69
78
|
- !ruby/object:Gem::Version
|
79
|
+
segments:
|
80
|
+
- 0
|
70
81
|
version: "0"
|
71
|
-
version:
|
72
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
83
|
requirements:
|
74
84
|
- - ">="
|
75
85
|
- !ruby/object:Gem::Version
|
86
|
+
segments:
|
87
|
+
- 0
|
76
88
|
version: "0"
|
77
|
-
version:
|
78
89
|
requirements: []
|
79
90
|
|
80
91
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.3.
|
92
|
+
rubygems_version: 1.3.6
|
82
93
|
signing_key:
|
83
94
|
specification_version: 3
|
84
95
|
summary: ruby proxy handling the complexities of system invocations
|