killrails 0.0.1 → 0.0.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: 478f7671382243a6b668814c9d1e2e6c8c6499d5
4
- data.tar.gz: e737674f89cdde3e0d9d7db833abb03e74be6505
3
+ metadata.gz: 1cd2050245e04f731f9200a18f0ae3160b0d9aa3
4
+ data.tar.gz: 6749e82f80ece7b3239699e0e06799b09b9e63e4
5
5
  SHA512:
6
- metadata.gz: 2f827269508b7a3d93ff1ec37bacae37a8407b958d702a73cad6ae2e3f212a201d106928414725679cac3f894520d46965ef684c3e8453487b3fffdc09ec23dc
7
- data.tar.gz: 6082ed845adf1cfa700c421de30d64b0cbe182beed2d6726bf49d4b4659c2137bbdf7717507a1391b9fca1d07e17c821e52d98b2fa4f46d557724e42a0aa2f2e
6
+ metadata.gz: e084008a15ba71445ce2e76e919af2697c14f3d22d1c33655d2e017304fcc3442d7a58b8e41d3e0a3a12a0b07123064f795a90ab061d06ef3c4a534353af545c
7
+ data.tar.gz: 40622267da63984684e52fcc7ceaabd355c58bdcddc3ea2ba210c004983222ec82d0723548bd1a71e3b2135999bd92693b7a0eef5b2017e2009b1f7bcd141049
data/README.md CHANGED
@@ -1,7 +1,23 @@
1
- Kill Rails
1
+ killrails
2
2
  ===
3
3
  Because killing a Rails Server is a (minor) pain
4
4
  ---
5
- This is a fun little gem to kill a Rails development server that holds onto the process after shutting it down.
5
+ This is a little gem to kill a Rails development server that holds onto the process after shutting it down on Linux or Mac.
6
6
 
7
- Functional on Linux and Mac OS currently. Windows support coming!
7
+ In your Rails gemfile, add killrails to development:
8
+
9
+ group :development do
10
+ gem 'killrails'
11
+ end
12
+
13
+
14
+ Usage
15
+ ---
16
+ Kill a Rails dev server on the default port of 3000:
17
+
18
+ $ killrails
19
+
20
+ Kill a Rails dev server on specified port:
21
+
22
+ $ killrails [port]
23
+ $ killrails 4567
data/Rakefile CHANGED
@@ -1,3 +1,3 @@
1
1
  require "bundler/gem_tasks"
2
- ails::Server.options[:Port]
2
+ Rails::Server.options[:Port]
3
3
  end
@@ -2,5 +2,6 @@
2
2
 
3
3
  require 'killrails'
4
4
 
5
- killenv = Killrails::Kill.new
5
+ port = ARGV[0] ||= 3000
6
+ killenv = Killrails::Kill.new(port)
6
7
  killenv.kill_process
@@ -2,18 +2,16 @@ require "killrails/version"
2
2
 
3
3
  module Killrails
4
4
  class Kill
5
- def kill_process
6
- if ARGV[0].nil?
7
- port = 3000
8
- else
9
- port = ARGV[0]
10
- end
5
+ def initialize(port)
6
+ @port = port.to_i
7
+ end
11
8
 
12
- system("kill -9 $(lsof -t -wni tcp:#{port}) >/dev/null 2>&1")
9
+ def kill_process
10
+ system("kill -15 $(lsof -t -wni tcp:#@port) >/dev/null 2>&1")
13
11
  if $? == 0
14
- puts "Rails server on port #{port} killed"
12
+ puts "Rails server on port #@port killed"
15
13
  else
16
- puts "Port isn't valid or server process is not running"
14
+ puts "Port is not valid or server process is not running"
17
15
  end
18
16
  end
19
17
  end
@@ -1,3 +1,3 @@
1
1
  module Killrails
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killrails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Flannery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-14 00:00:00.000000000 Z
11
+ date: 2014-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.1.3
79
+ rubygems_version: 2.2.2
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: Killrails kills a rails server that holds onto the process after shutting