downtime 0.0.3 → 0.1.0

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWU1ZjUwMzdiYWM2ODFjYzJhODUyMjFiOWM5ZDBjNDJhM2ZkM2NhNQ==
4
+ NTdlODVlYzBjNzY0ZWU0NjFlMjUwOWNkOGVlZjc3MTgyMDQyYzJiNA==
5
5
  data.tar.gz: !binary |-
6
- NzViNzg5MjdjMDcyMDdkNmUzNmM3N2I4YmE4ZjQ1MWJlZTgzZTE2OQ==
6
+ ZDM1MGM3MDA5MTJhNTc2OTVjNDNhMjIxM2FkYjllMDdkZDEwYWVhYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2ZkYjcyZDJiOGNlN2MzOWM2ZDU0MDZhYzEwN2JlZTVmNGY0YjQ4MmZmOGNh
10
- ZGRhMDYxMTNhMDIwMzAwNjMzZDc1YzIxZTMyN2Q1ZWQ5N2FhNGIyNzBjNzBm
11
- Y2Q5ZThiMGQxNTQ0YjI5NWU4NzQwY2YwMzAzNTVhZWIxYmMzOGM=
9
+ MmQ1YzQzYjc1ODgzNGI4NGNiOGNjZDk5ZDkyN2IzZGY2NWE3MDllNzE0MWY3
10
+ ZGNjZjRiNjA1ZWQ2ZDg0MzJmZWU3ZDUwMTE5MmM3NjVkNmUxNmE1OTI5YzM3
11
+ ZjZkMzNjMWZhYTJhOTM3ZmQ0NmU4ZTE1MTFlMTc2OGUxOTFlZDQ=
12
12
  data.tar.gz: !binary |-
13
- MmFiY2U1Y2I1Y2ZkNTI1NjdiN2ZhOWQ5MjYxZDBmNGMzZjQ2NGIyYTc3NzYy
14
- MjQ0MWM5MTgzNWZjNWFjYzQ4MDUyMWZhNTBmOGYwODk4NzM5OTdiNGY5ZTEz
15
- ZDkwNTNmZTIxODFkOWE4MDA2NjNmZDUyNWEwYmJiMDczOTc4YzE=
13
+ NDZkODQwOGU3YmVjMTJkZmFhYmJlZDY0YTFjNTc1NTEzYzZjN2QxNTZkNzEy
14
+ MTViYTU2YzVkZTkwMmFmNDJiZTUxOTkwZDBiMWI0NTIwMDE4NmJlMmQ0Mzli
15
+ ZjZjZWNkMzAzYmNlNjhhYjYxZGQ1YjdjMDFkY2E3OWJhMmM1MGE=
data/README.md CHANGED
@@ -24,24 +24,35 @@ Or install it yourself as:
24
24
 
25
25
  ## Usage
26
26
 
27
- Use as a cron-job (use [god]-gem if you like).
28
-
29
27
  Call as `downtime`.
30
28
  It will create a `downtime.log` file in the current working directory.
31
29
 
32
30
  The file (`downtime.log`) will look like this:
33
31
 
34
32
  # This file was generated by the downtime ruby gem.
35
- 2015-01-01-10-22 up till 2015-01-02-08-10
36
- ! went down after 1000 minutes up
37
- 2015-01-02-08-10 down till 2015-01-03-08-40
38
- ! went up after 30 minutes down
39
- 2015-01-02-08-40 up till 2015-01-03-08-45
33
+ 2015-01-01-10-22 up till 2015-01-02-08-10 (1000 minutes)
34
+ ! went down after 1000 minutes of uptime.
35
+ 2015-01-02-08-10 down till 2015-01-03-08-40 (30 minutes)
36
+ ! went up after 30 minutes of downtime.
37
+ 2015-01-02-08-40 up till 2015-01-03-08-45 (5 minutes)
38
+
39
+ Use as a cron-job (use [god]-gem if you like), e.g. with `crontab -e`:
40
+
41
+ # m h dom mon dow command
42
+ */5 * * * * cd /home/downtime-service/downtime && ~/.rvm/wrappers/default/downtime
43
+
44
+ (this assumes you use `rvm` and the given path exists), will result in information put into `/home/downtime-service/downtime/downtime.log`.
45
+
40
46
 
41
47
  ## Caveats
42
48
 
43
49
  Its assumed you run in CET timezone.
44
50
 
51
+ ## License
52
+
53
+ Copyright 2015 Felix Wolfsteller, Siedlungsgenossenschaft Ökodorf e.G.
54
+ all code licensed under the GPL, version 3, which is included in the file `gpl-3.0.txt`.
55
+
45
56
  ## Contributing
46
57
 
47
58
  0. Contact me, either by creating an issue or sending me a mail - sometimes stuff is more easily done at two!
data/bin/downtime CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'downtime'
4
4
 
5
- if ARGV.length
5
+ if ARGV.length >= 1
6
6
  puts "downtime #{Downtime::VERSION} - updates downtime.log according to output of dig command."
7
7
  exit 0
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module Downtime
2
- VERSION = "0.0.3"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/downtime.rb CHANGED
@@ -27,7 +27,6 @@ module Downtime
27
27
  if lines.length > 1
28
28
  first_timestamp = lines[-1][/^[0-9-]*/]
29
29
  minutes = (@timestamp - Timestamp.from_s(first_timestamp))
30
- puts minutes
31
30
  end
32
31
  if was_down || lines.length <= 1
33
32
  if up
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: downtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Wolfsteller