im-alive 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b3fcfe6ed955de5b393d957655893c2662b8697
4
- data.tar.gz: fbf714c7cc2d2eab0ea47f1b81f02fdec162cee1
3
+ metadata.gz: 5eb7065a4cb92ef9cae5f8c69f3406f2164ed260
4
+ data.tar.gz: 938235b37211713616231d8585a3ca71b205fc5f
5
5
  SHA512:
6
- metadata.gz: 451a7d20d8a00e12e3842b1f1de11b40d64ea6e9818306dbc7c6daa6bb4453629e1514f8777c7e357d7f53a043d56aa42c5fc18d47a4696c261d6d3c2607c758
7
- data.tar.gz: 270b56a1d34fa1b6d982cb632cd8f65ea6ee75c37b112d1841c3c8f53c52118f52f71ed05f142ea634a2935b35658f248f68a67a1ca6e4770292d5b05f61d2bb
6
+ metadata.gz: 72ab1bbd70d551436aa8ad5b576e1cc18cdef06b044e68b03789e12afe8e09770aae49cfd92d713279b608e27676546da1aee6e4aa8862cb0d53d8438b1842d3
7
+ data.tar.gz: d0fe1e403a08ce1cefbd43912c940f2fe9834f9a525e7e2b1d5182264364e68b4502131fa77db26b8fec44ead1cc6234b64e7a6d6d5cc8f0ff231525b61eaf2b
data/README.md CHANGED
@@ -1,31 +1,26 @@
1
1
  # Im::Alive
2
2
 
3
- TODO: Write a gem description
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
- ## Installation
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
- And then execute:
7
+ `{"timestamp" => "2015-02-01 00:00:00 UTC", "js_timestamp" => 1422748800}`
14
8
 
15
- $ bundle
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
- Or install it yourself as:
11
+ ## Installation
18
12
 
19
- $ gem install im-alive
13
+ gem install im-alive
20
14
 
21
15
  ## Usage
22
16
 
23
- TODO: Write usage instructions here
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
- ## Contributing
24
+ ## Development
26
25
 
27
- 1. Fork it ( https://github.com/alphasights/im-alive/fork )
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
- Rake::TestTask.new do |t|
5
- t.libs.push "spec"
6
- t.test_files = FileList['spec/**/*_spec.rb']
7
- end
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
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_development_dependency "minitest", "~> 5.5"
21
21
  spec.add_development_dependency "timecop"
22
+ spec.add_development_dependency "rake"
22
23
 
23
24
  spec.add_runtime_dependency "couchrest", ["~> 2.0.0.rc2"]
24
25
  end
@@ -9,7 +9,7 @@ module ImAlive
9
9
 
10
10
  def send
11
11
  doc = begin
12
- db.get(document_id)
12
+ db.get!(document_id)
13
13
  rescue CouchRest::NotFound
14
14
  {'_id' => document_id}
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module ImAlive
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -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, {}, ['polly']
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
@@ -1,4 +1,3 @@
1
1
  require 'im_alive'
2
2
  require 'minitest/autorun'
3
- require 'minitest/pride'
4
3
  require 'timecop'
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.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: 2015-11-05 00:00:00.000000000 Z
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.4.5.1
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: