shutup 0.0.5 → 0.0.6

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: 7261c8ab6939050a4e010f834a66943e00e5ebc1
4
- data.tar.gz: 61ccf5c33d39c7b1c9d84e9a73210e60fb32ffcc
3
+ metadata.gz: 88343c0c82a295e8f22cb9eee1eebadaa69b5e5d
4
+ data.tar.gz: d5de0f49322665566e37adc653cf58cba51cbc7b
5
5
  SHA512:
6
- metadata.gz: d085a3e9cf840bf4f159d448e02a077ef01d466218153465d3777c018fd6adbea17547acf833eebce95abd34b816cf48bae32e7487283f415dd008dc788d2575
7
- data.tar.gz: ebf59d364ee0f4d0c9c3866e682300c30b96933b1cebd5befb8c7d0c6ba6289d9cc766d564b8e1c42c6201d60d43f4a5e1442bec63e763da7441c31286c8ba3e
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
- NOTE: try to start the Rails app, open a new terminal window and then type:
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
- rails_killer = Shutup::Rails.new
8
- if rails_killer.hit!
9
- rails_killer.delete_pid
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
- def current_dir
5
- File.expand_path(File.dirname(File.dirname('.')))
6
- end
4
+ class << self
5
+ def current_dir
6
+ File.expand_path(File.dirname(File.dirname('.')))
7
+ end
7
8
 
8
- def pid_file
9
- "#{current_dir}/tmp/pids/server.pid"
10
- end
9
+ def pid_file
10
+ "#{current_dir}/tmp/pids/server.pid"
11
+ end
11
12
 
12
- def pid
13
- begin
14
- File.read(pid_file)
15
- rescue => e
16
- e.message << ' Are you sure that the process is running?'
17
- raise(e)
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
- def hit!
22
- if pid
23
- system "kill -9 #{pid}"
24
- puts "Killed process id: #{pid}"
25
- true
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
- def delete_pid
30
- File.delete(pid_file) if File.exist?(pid_file)
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
@@ -1,3 +1,3 @@
1
1
  module Shutup
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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.5
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