couchdb-extras 0.0.3 → 0.0.4

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.
Files changed (2) hide show
  1. data/bin/infinite-run +34 -0
  2. metadata +3 -1
data/bin/infinite-run ADDED
@@ -0,0 +1,34 @@
1
+ #!/bin/bash
2
+
3
+ if [[ ! $1 ]]; then
4
+ echo "Must provide script to run."
5
+ exit 1
6
+ fi
7
+
8
+ [[ ! $TIME_SPAN ]] && TIME_SPAN=3600
9
+
10
+ OK=true
11
+ function ctrl_c() {
12
+ if [[ $PID ]]; then
13
+ kill $PID
14
+ OK=false
15
+ fi
16
+ }
17
+
18
+ trap ctrl_c INT
19
+
20
+ while $OK :
21
+ do
22
+ sleep 1
23
+ echo "# Starting $1"
24
+ $@ &
25
+ PID=$!
26
+ echo "# Started as $PID"
27
+ echo "# Will wait $TIME_SPAN seconds"
28
+ sleep $TIME_SPAN
29
+ echo "# Trying to kill $PID"
30
+ kill $PID
31
+ echo "# Killed $1"
32
+ done
33
+
34
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchdb-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -17,6 +17,7 @@ executables:
17
17
  - couchdb2couchdb
18
18
  - couchdb2history
19
19
  - couchdb2elasticsearch
20
+ - infinite-run
20
21
  extensions: []
21
22
  extra_rdoc_files: []
22
23
  files:
@@ -24,6 +25,7 @@ files:
24
25
  - bin/couchdb2couchdb
25
26
  - bin/couchdb2history
26
27
  - bin/couchdb2elasticsearch
28
+ - bin/infinite-run
27
29
  homepage: https://github.com/cncflora/couchdb-extras
28
30
  licenses:
29
31
  - MIT