shutup 0.0.5 → 0.0.6
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 +3 -1
- data/exe/shutup +3 -5
- data/lib/shutup.rb +23 -21
- data/lib/shutup/version.rb +1 -1
- data/shutup.gemspec +9 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88343c0c82a295e8f22cb9eee1eebadaa69b5e5d
|
4
|
+
data.tar.gz: d5de0f49322665566e37adc653cf58cba51cbc7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba9db614208223aa7a3ef0ed5b04da7c829dab6a73f5cb6081ca950e11abb20620ec6e4b405f680d19ecb5eaa39803d94a21df075a95d57a11fb0ff1b308d19f
|
7
|
+
data.tar.gz: 31b0d557808b45e2f8ce143cc85f06dc77586448e9c8a28d7f264bed3ed588a8e145ebba35abb23bcdcbcb3115dfae5f647d1b714fab178ae7b9f100419c75d1
|
data/README.md
CHANGED
@@ -22,6 +22,7 @@ But this is boring. And you have to do it all the times. This gems creates a sho
|
|
22
22
|
|
23
23
|
Go in the root folder of your Rails project:
|
24
24
|
|
25
|
+
$ cd PROJECT_ROOT_FOLDER
|
25
26
|
$ gem install shutup
|
26
27
|
|
27
28
|
|
@@ -29,9 +30,10 @@ Go in the root folder of your Rails project:
|
|
29
30
|
|
30
31
|
After installing the gem run:
|
31
32
|
|
33
|
+
$ cd PROJECT_ROOT_FOLDER
|
32
34
|
$ shutup
|
33
35
|
|
34
|
-
|
36
|
+
TEST IT: try to start the Rails app, open a new terminal window and then type:
|
35
37
|
|
36
38
|
$ shutup
|
37
39
|
|
data/exe/shutup
CHANGED
@@ -2,9 +2,7 @@
|
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require 'shutup'
|
5
|
-
puts "Killing the process..."
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
6
|
+
puts "Killing the process."
|
7
|
+
|
8
|
+
Shutup::Rails.hit! && Shutup::Rails.delete_pid
|
data/lib/shutup.rb
CHANGED
@@ -1,33 +1,35 @@
|
|
1
1
|
require "shutup/version"
|
2
2
|
module Shutup
|
3
3
|
class Rails
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
class << self
|
5
|
+
def current_dir
|
6
|
+
File.expand_path(File.dirname(File.dirname('.')))
|
7
|
+
end
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
def pid_file
|
10
|
+
"#{current_dir}/tmp/pids/server.pid"
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
def pid
|
14
|
+
begin
|
15
|
+
File.read(pid_file)
|
16
|
+
rescue => e
|
17
|
+
e.message << ' Are you sure that the process is running?'
|
18
|
+
raise(e)
|
19
|
+
end
|
18
20
|
end
|
19
|
-
end
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
def hit!
|
23
|
+
if pid
|
24
|
+
system "kill -9 #{pid}"
|
25
|
+
puts "Killed process id: #{pid}"
|
26
|
+
true
|
27
|
+
end
|
26
28
|
end
|
27
|
-
end
|
28
29
|
|
29
|
-
|
30
|
-
|
30
|
+
def delete_pid
|
31
|
+
File.delete(pid_file) if File.exist?(pid_file)
|
32
|
+
end
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|
data/lib/shutup/version.rb
CHANGED
data/shutup.gemspec
CHANGED
@@ -29,6 +29,15 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.bindir = "exe"
|
30
30
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
31
|
spec.require_paths = ["lib"]
|
32
|
+
spec.post_install_message = <<-msg
|
33
|
+
----------------------------------------------
|
34
|
+
Thank you for installing Shutup!
|
35
|
+
|
36
|
+
Docs and support: https://github.com/lorenzosinisi/shutup
|
37
|
+
|
38
|
+
by Lorenzo Sinisi
|
39
|
+
----------------------------------------------
|
40
|
+
msg
|
32
41
|
|
33
42
|
spec.add_development_dependency "bundler", "~> 1.13"
|
34
43
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shutup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lorenzo Sinisi
|
@@ -78,7 +78,14 @@ licenses:
|
|
78
78
|
- MIT
|
79
79
|
metadata:
|
80
80
|
allowed_push_host: https://rubygems.org
|
81
|
-
post_install_message:
|
81
|
+
post_install_message: |
|
82
|
+
----------------------------------------------
|
83
|
+
Thank you for installing Shutup!
|
84
|
+
|
85
|
+
Docs and support: https://github.com/lorenzosinisi/shutup
|
86
|
+
|
87
|
+
by Lorenzo Sinisi
|
88
|
+
----------------------------------------------
|
82
89
|
rdoc_options: []
|
83
90
|
require_paths:
|
84
91
|
- lib
|