death 0.6.1 → 0.6.2

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
  SHA1:
3
- metadata.gz: c2184dccf480c922ee731562b8343a45b3fddced
4
- data.tar.gz: 6084956ad72d841c55adde6540e9204f378c8966
3
+ metadata.gz: 2b4a6b4049045a8498314ab55385caa0da991a2f
4
+ data.tar.gz: 86399d57cffdaa10dcae3a3a711a8943fa786f49
5
5
  SHA512:
6
- metadata.gz: e6581d7fc4fc5d42cd6a9b5cac2a6727633cf856f5102322f2ff68379b3ed14c6157378b2cd2100e116c180a4360ea5221131d057c2626c47dcb4d8c79bcc586
7
- data.tar.gz: 787f054cc41e6beda3c56ea3755235b064a8ea61d9f1d2c0c9e405d4b513d787890ec3906901f0fb6dd0cfec295beedebf27c16d7ae4879b800326a3493238bd
6
+ metadata.gz: 5665d686d2bc770ef3934208835e97dee5b3916c3b041bb7263eb57c1738b93c47f28247ef14a8a57ddaad65109fb77892f0f87bf73f8849deec6a73d2b99267
7
+ data.tar.gz: a07aefe80daaafb7ff58aa615de245a72d3f5c32a23e3019ab9c1cb610e323fbce52663b95778376e0aee477498f5adf1f9a029bdde195042e01f054be6a3484
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # death
1
+ # death [![Gem Version](https://badge.fury.io/rb/death.svg)](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
@@ -1,4 +1,5 @@
1
1
  module Death; end
2
2
  require 'death/command'
3
3
  require 'death/core_ext/process'
4
+ require 'death/killer'
4
5
  require 'death/voice'
@@ -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
- command = "kill #{[signal, pid, pids].flatten.compact.shelljoin}"
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Death
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
@@ -1,12 +1,24 @@
1
1
  require 'facter'
2
2
  require 'shellwords'
3
3
 
4
- module Death::Voice
5
- class << self
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
- sound_pressure { system("say -v Ralph #{Shellwords.shellescape(message)} &") }
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 * 3).times { yield }
29
+ (processor_count * @ressure_factor).times { yield }
18
30
  end
19
31
 
20
32
  def supported_os?
@@ -0,0 +1,9 @@
1
+ require 'death'
2
+
3
+ namespace :death do
4
+ task :tuning do
5
+ death_voice = Death::Voice.new(ENV['FACTOR'])
6
+
7
+ death_voice.say('deeeeeeeeeeeattttth')
8
+ end
9
+ end
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.1
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-12 00:00:00.000000000 Z
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.5
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.