im-alive 0.1.1 → 0.1.2
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 +4 -4
- data/README.md +14 -19
- data/Rakefile +6 -4
- data/im-alive.gemspec +1 -0
- data/lib/im_alive/log.rb +1 -1
- data/lib/im_alive/version.rb +1 -1
- data/spec/log_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- metadata +17 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5eb7065a4cb92ef9cae5f8c69f3406f2164ed260
|
4
|
+
data.tar.gz: 938235b37211713616231d8585a3ca71b205fc5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72ab1bbd70d551436aa8ad5b576e1cc18cdef06b044e68b03789e12afe8e09770aae49cfd92d713279b608e27676546da1aee6e4aa8862cb0d53d8438b1842d3
|
7
|
+
data.tar.gz: d0fe1e403a08ce1cefbd43912c940f2fe9834f9a525e7e2b1d5182264364e68b4502131fa77db26b8fec44ead1cc6234b64e7a6d6d5cc8f0ff231525b61eaf2b
|
data/README.md
CHANGED
@@ -1,31 +1,26 @@
|
|
1
1
|
# Im::Alive
|
2
2
|
|
3
|
-
|
3
|
+
Post timestamps to a CouchDB database document. Useful for sending heartbeat signals or proving that an operation took place when it was supposed to.
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
```ruby
|
10
|
-
gem 'im-alive'
|
11
|
-
```
|
5
|
+
The timestamp information that is written is:
|
12
6
|
|
13
|
-
|
7
|
+
`{"timestamp" => "2015-02-01 00:00:00 UTC", "js_timestamp" => 1422748800}`
|
14
8
|
|
15
|
-
|
9
|
+
CouchDB documents can be acessed through HTTP GET request, no special tooling is required to read the values back out, you can use Curl, do it from JS in a web page, from any programming language you can think of etc etc.
|
16
10
|
|
17
|
-
|
11
|
+
## Installation
|
18
12
|
|
19
|
-
|
13
|
+
gem install im-alive
|
20
14
|
|
21
15
|
## Usage
|
22
16
|
|
23
|
-
|
17
|
+
`im-alive https://username@password.heroku.cloudant.com/backups weekly`
|
18
|
+
|
19
|
+
of which
|
20
|
+
- `https://username@password.heroku.cloudant.com` is the URL of the CouchDB instance
|
21
|
+
- `backups` is the name of the CouchDB database. The database will be automatically created if it doesn't exist.
|
22
|
+
- `weekly` it the name of the document to write the timestamps to. The document is created if it doesn't exist.
|
24
23
|
|
25
|
-
##
|
24
|
+
## Development
|
26
25
|
|
27
|
-
|
28
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
-
5. Create a new Pull Request
|
26
|
+
Install the dependencies with `bundle install`, and run the tests with `bundle exec rake`.
|
data/Rakefile
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require 'rake/testtask'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
Rake::TestTask.new(:test) do |t|
|
5
|
+
t.libs.push "spec"
|
6
|
+
t.test_files = FileList['spec/**/*_spec.rb']
|
7
|
+
end
|
8
|
+
|
9
|
+
task :default => :test
|
data/im-alive.gemspec
CHANGED
data/lib/im_alive/log.rb
CHANGED
data/lib/im_alive/version.rb
CHANGED
data/spec/log_spec.rb
CHANGED
@@ -9,7 +9,7 @@ module ImAlive
|
|
9
9
|
|
10
10
|
Timecop.freeze Time.utc(2015, 02, 1, 0, 0, 0) do
|
11
11
|
logger.stub :db, rest_client do
|
12
|
-
rest_client.expect :get
|
12
|
+
rest_client.expect :get!, {}, ['polly']
|
13
13
|
rest_client.expect :save_doc, {}, [{"timestamp" => "2015-02-01 00:00:00 UTC", "js_timestamp" => 1422748800}]
|
14
14
|
|
15
15
|
logger.send
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: im-alive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Griffiths
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: couchrest
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,11 +106,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
106
|
version: '0'
|
93
107
|
requirements: []
|
94
108
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.6.13
|
96
110
|
signing_key:
|
97
111
|
specification_version: 4
|
98
112
|
summary: Sends a quick heartbeat timestamp to a document store.
|
99
113
|
test_files:
|
100
114
|
- spec/log_spec.rb
|
101
115
|
- spec/spec_helper.rb
|
102
|
-
has_rdoc:
|