death 0.6.1 → 0.6.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.
- checksums.yaml +4 -4
- data/README.md +19 -1
- data/lib/death.rb +1 -0
- data/lib/death/command.rb +1 -13
- data/lib/death/killer.rb +19 -0
- data/lib/death/version.rb +1 -1
- data/lib/death/voice.rb +16 -4
- data/lib/tasks/tuning.rb +9 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b4a6b4049045a8498314ab55385caa0da991a2f
|
4
|
+
data.tar.gz: 86399d57cffdaa10dcae3a3a711a8943fa786f49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5665d686d2bc770ef3934208835e97dee5b3916c3b041bb7263eb57c1738b93c47f28247ef14a8a57ddaad65109fb77892f0f87bf73f8849deec6a73d2b99267
|
7
|
+
data.tar.gz: a07aefe80daaafb7ff58aa615de245a72d3f5c32a23e3019ab9c1cb610e323fbce52663b95778376e0aee477498f5adf1f9a029bdde195042e01f054be6a3484
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# death
|
1
|
+
# death [](http://badge.fury.io/rb/death)
|
2
2
|
|
3
3
|
kill command wrapper. say "DEATH" with death voice.
|
4
4
|
|
@@ -27,6 +27,24 @@ lml
|
|
27
27
|
|
28
28
|
Mac OS X (only)
|
29
29
|
|
30
|
+
## for Developers
|
31
|
+
|
32
|
+
### Tuning of death voice
|
33
|
+
|
34
|
+
Supply developers with death voice tuner `rake death:tuning`.
|
35
|
+
|
36
|
+
Check out source code and move to the death-command source directory.
|
37
|
+
|
38
|
+
```
|
39
|
+
rake death:tuning # say "DEATH"
|
40
|
+
```
|
41
|
+
|
42
|
+
adjustable sound pressure using FACTOR=n argument (default 3) .
|
43
|
+
|
44
|
+
```
|
45
|
+
rake death:tuning FACTOR=5 # the deep timbre of death voice
|
46
|
+
```
|
47
|
+
|
30
48
|
## LICENCE
|
31
49
|
|
32
50
|
The MIT Licence
|
data/lib/death.rb
CHANGED
data/lib/death/command.rb
CHANGED
@@ -1,21 +1,9 @@
|
|
1
|
-
require 'open3'
|
2
|
-
require 'shellwords'
|
3
|
-
|
4
1
|
module Death::Command
|
5
2
|
class << self
|
6
3
|
def death(signal, pid, *pids)
|
7
4
|
Death::Voice.say('deeeeeeeeeeeattttth')
|
8
5
|
|
9
|
-
|
10
|
-
|
11
|
-
Open3.popen3(command) do |stdin, stdout, stderr|
|
12
|
-
msg = stderr.read
|
13
|
-
if /kill: illegal process id: kill/ === msg
|
14
|
-
puts 'death: illegal process id: kill'
|
15
|
-
else
|
16
|
-
puts "#{msg.gsub(/kill/, 'death')}"
|
17
|
-
end
|
18
|
-
end
|
6
|
+
Death::Killer.kill(signal, pid, *pids)
|
19
7
|
end
|
20
8
|
|
21
9
|
alias lml death
|
data/lib/death/killer.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'open3'
|
2
|
+
require 'shellwords'
|
3
|
+
|
4
|
+
module Death::Killer
|
5
|
+
class << self
|
6
|
+
def kill(signal, pid, *pids)
|
7
|
+
command = "kill #{[signal, pid, pids].flatten.compact.shelljoin}"
|
8
|
+
|
9
|
+
Open3.popen3(command) do |stdin, stdout, stderr|
|
10
|
+
msg = stderr.read
|
11
|
+
if /kill: illegal process id: kill/ === msg
|
12
|
+
puts 'death: illegal process id: kill'
|
13
|
+
else
|
14
|
+
puts "#{msg.gsub(/kill/, 'death')}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/death/version.rb
CHANGED
data/lib/death/voice.rb
CHANGED
@@ -1,12 +1,24 @@
|
|
1
1
|
require 'facter'
|
2
2
|
require 'shellwords'
|
3
3
|
|
4
|
-
module Death
|
5
|
-
class
|
4
|
+
module Death
|
5
|
+
class Voice
|
6
|
+
class << self
|
7
|
+
def say(message)
|
8
|
+
new.say(message)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize(ressure_factor = 3)
|
13
|
+
@ressure_factor = ressure_factor
|
14
|
+
end
|
15
|
+
|
6
16
|
def say(message)
|
7
17
|
raise 'death command is supporting only Mac OS X.' unless supported_os?
|
8
18
|
|
9
|
-
|
19
|
+
fork do
|
20
|
+
sound_pressure { spawn("say -v Ralph #{Shellwords.shellescape(message)}") }
|
21
|
+
end
|
10
22
|
end
|
11
23
|
|
12
24
|
private
|
@@ -14,7 +26,7 @@ module Death::Voice
|
|
14
26
|
def sound_pressure
|
15
27
|
processor_count = Facter[:processorcount].value
|
16
28
|
|
17
|
-
(processor_count *
|
29
|
+
(processor_count * @ressure_factor).times { yield }
|
18
30
|
end
|
19
31
|
|
20
32
|
def supported_os?
|
data/lib/tasks/tuning.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: death
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ITO Koichi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|
@@ -55,8 +55,10 @@ files:
|
|
55
55
|
- lib/death.rb
|
56
56
|
- lib/death/command.rb
|
57
57
|
- lib/death/core_ext/process.rb
|
58
|
+
- lib/death/killer.rb
|
58
59
|
- lib/death/version.rb
|
59
60
|
- lib/death/voice.rb
|
61
|
+
- lib/tasks/tuning.rb
|
60
62
|
homepage: http://github.com/koic/death-command
|
61
63
|
licenses:
|
62
64
|
- MIT
|
@@ -77,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
79
|
version: '0'
|
78
80
|
requirements: []
|
79
81
|
rubyforge_project:
|
80
|
-
rubygems_version: 2.4.
|
82
|
+
rubygems_version: 2.4.8
|
81
83
|
signing_key:
|
82
84
|
specification_version: 4
|
83
85
|
summary: kill command wrapper. say "DEATH" with death voice.
|