killrails 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 478f7671382243a6b668814c9d1e2e6c8c6499d5
4
+ data.tar.gz: e737674f89cdde3e0d9d7db833abb03e74be6505
5
+ SHA512:
6
+ metadata.gz: 2f827269508b7a3d93ff1ec37bacae37a8407b958d702a73cad6ae2e3f212a201d106928414725679cac3f894520d46965ef684c3e8453487b3fffdc09ec23dc
7
+ data.tar.gz: 6082ed845adf1cfa700c421de30d64b0cbe182beed2d6726bf49d4b4659c2137bbdf7717507a1391b9fca1d07e17c821e52d98b2fa4f46d557724e42a0aa2f2e
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
6
+ *.gem
7
+ .bundle
8
+ .rvmrc
9
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in killrails.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 William Flannery
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,7 @@
1
+ Kill Rails
2
+ ===
3
+ Because killing a Rails Server is a (minor) pain
4
+ ---
5
+ This is a fun little gem to kill a Rails development server that holds onto the process after shutting it down.
6
+
7
+ Functional on Linux and Mac OS currently. Windows support coming!
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ require "bundler/gem_tasks"
2
+ ails::Server.options[:Port]
3
+ end
data/bin/killrails ADDED
@@ -0,0 +1,6 @@
1
+ #!/user/bin/env ruby
2
+
3
+ require 'killrails'
4
+
5
+ killenv = Killrails::Kill.new
6
+ killenv.kill_process
data/killrails.gemspec ADDED
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'killrails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "killrails"
8
+ spec.version = Killrails::VERSION
9
+ spec.authors = ["William Flannery"]
10
+ spec.email = ["wjflannery@gmail.com"]
11
+ spec.description = %q{Killrails kills a rails server that holds onto the process after shutting it down.}
12
+ spec.summary = %q{Killrails kills a rails server that holds onto the process after shutting it down.}
13
+ spec.homepage = "https://github.com/wjflannery/killrails"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ end
@@ -0,0 +1,3 @@
1
+ module Killrails
2
+ VERSION = "0.0.1"
3
+ end
data/lib/killrails.rb ADDED
@@ -0,0 +1,20 @@
1
+ require "killrails/version"
2
+
3
+ module Killrails
4
+ class Kill
5
+ def kill_process
6
+ if ARGV[0].nil?
7
+ port = 3000
8
+ else
9
+ port = ARGV[0]
10
+ end
11
+
12
+ system("kill -9 $(lsof -t -wni tcp:#{port}) >/dev/null 2>&1")
13
+ if $? == 0
14
+ puts "Rails server on port #{port} killed"
15
+ else
16
+ puts "Port isn't valid or server process is not running"
17
+ end
18
+ end
19
+ end
20
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: killrails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - William Flannery
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-10-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Killrails kills a rails server that holds onto the process after shutting
42
+ it down.
43
+ email:
44
+ - wjflannery@gmail.com
45
+ executables:
46
+ - killrails
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - .gitignore
51
+ - Gemfile
52
+ - LICENSE.txt
53
+ - README.md
54
+ - Rakefile
55
+ - bin/killrails
56
+ - killrails.gemspec
57
+ - lib/killrails.rb
58
+ - lib/killrails/version.rb
59
+ homepage: https://github.com/wjflannery/killrails
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.1.3
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: Killrails kills a rails server that holds onto the process after shutting
83
+ it down.
84
+ test_files: []