redcap 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +27 -0
- data/lib/redcap/app.rb +4 -4
- data/lib/redcap/version.rb +1 -1
- metadata +4 -4
data/README.textile
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
h1. Redcap
|
2
|
+
|
3
|
+
Redcap was written because I need to track SSH remote forwards by their process id, and all I have is the port they're forwarding to. You can't pair the two together unless you have root access, though - and that's where Redcap comes in. You run Redcap as root, and then you can ask it to do the pairing for you.
|
4
|
+
|
5
|
+
h2. Installation
|
6
|
+
|
7
|
+
<pre><code>gem install redcap</code></pre>
|
8
|
+
|
9
|
+
h2. Usage
|
10
|
+
|
11
|
+
As a server:
|
12
|
+
|
13
|
+
<pre><code>$ sudo redcap</code></pre>
|
14
|
+
|
15
|
+
And in code, as a client:
|
16
|
+
|
17
|
+
<pre><code>require 'rubygems'
|
18
|
+
require 'redcap'
|
19
|
+
Redcap.pid_for_port(10342) #=> 26151</code></pre>
|
20
|
+
|
21
|
+
h2. Author
|
22
|
+
|
23
|
+
"Pat Allan":http://freelancing-gods.com wrote this code in May 2011, but all the hard work for daemonising the process, logging, and a pid file was done in a gist by "James Healy":http://yob.id.au.
|
24
|
+
|
25
|
+
h3. Licence
|
26
|
+
|
27
|
+
Released under the MIT Licence. Fork, contribute, re-use, whatever.
|
data/lib/redcap/app.rb
CHANGED
@@ -49,6 +49,10 @@ class Redcap::App
|
|
49
49
|
exit 1
|
50
50
|
end
|
51
51
|
|
52
|
+
def pid_file
|
53
|
+
@pid_file ||= '/var/tmp/redcap.pid'
|
54
|
+
end
|
55
|
+
|
52
56
|
private
|
53
57
|
|
54
58
|
def update_procline
|
@@ -59,10 +63,6 @@ class Redcap::App
|
|
59
63
|
@log_file ||= '/var/log/redcap.log'
|
60
64
|
end
|
61
65
|
|
62
|
-
def pid_file
|
63
|
-
@log_file ||= '/var/tmp/redcap.pid'
|
64
|
-
end
|
65
|
-
|
66
66
|
def logger
|
67
67
|
@logger ||= begin
|
68
68
|
logger = Logger.new(log_file)
|
data/lib/redcap/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Redcap::Version = '0.1.
|
1
|
+
Redcap::Version = '0.1.1'
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: redcap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Pat Allan
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-10 00:00:00 +10:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -73,7 +73,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
73
|
requirements:
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
hash:
|
76
|
+
hash: -325199160494585366
|
77
77
|
segments:
|
78
78
|
- 0
|
79
79
|
version: "0"
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
requirements:
|
83
83
|
- - ">="
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
hash:
|
85
|
+
hash: -325199160494585366
|
86
86
|
segments:
|
87
87
|
- 0
|
88
88
|
version: "0"
|