safety_net_heroku 1.0.1 → 1.0.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
  SHA256:
3
- metadata.gz: 3d980c0aecf55ecccff0fe9699cadb2df3fa403923c68509fea4b0b4294ff847
4
- data.tar.gz: 17bed72bc17641f432ec2f70e87f4b614674ba734000a51c46b4705472673183
3
+ metadata.gz: 0bde90f66614acbce4d3b9b7e8a0ee25e31275c0b624bfa04f0186b7a14a464b
4
+ data.tar.gz: 6e022e24f351c98211fbdce14205ff5f0c0551b810215ec9069f1a7f5c660c3f
5
5
  SHA512:
6
- metadata.gz: aee358e251a00bfb6372333ca5a71f3687ecb803ca431100b4da5c7636711c04bf214247b9a8a887485b981a6610963fb993e253a5c43c01967f81d3844b5ab1
7
- data.tar.gz: 47a8567c08419e1f8779c76cae1bd1267052659c42d8511fc1676add7bc0a13843c2e2af06a6aec9c22e1f5f7dfdd11965c67fa50f72c1d4f9174eb69a84b467
6
+ metadata.gz: 460ad3c85f4d4dbad723eb75dc953e65100c2f53bdfba25a1ad641ff7143305602f5658367eed1cc1c6063d2c685a53c08297fbdf68a8a7c6087f2da637b7345
7
+ data.tar.gz: 10a6b195697c9518fcbcd44625187febd919365f23838465334e022d44bf1715af28a054b2f88b38ddbf3e7a0d1fe9f4caf04d6503636e5ed115d6f1cf0fafe1
data/README.md CHANGED
@@ -1,39 +1,48 @@
1
- # SafetyNetHeroku
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/safety_net_heroku`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
1
+ A simple gem for backing up a MongoDB database to AWS when hosted on Heroku using a Sidekiq worker.
6
2
 
7
3
  ## Installation
8
4
 
9
- Add this line to your application's Gemfile:
10
-
11
5
  ```ruby
12
6
  gem 'safety_net_heroku'
13
7
  ```
14
8
 
15
- And then execute:
9
+ ## Usage
16
10
 
17
- $ bundle
11
+ Create a new Safety Net Heroku initializer:
18
12
 
19
- Or install it yourself as:
13
+ ```ruby
14
+ # safety_net_heroku.rb
20
15
 
21
- $ gem install safety_net_heroku
16
+ SafetyNetHeroku.config[:database_name] = 'database_name'
17
+ SafetyNetHeroku.config[:aws_region] = 's3_region'
18
+ SafetyNetHeroku.config[:aws_bucket] = 's3_bucket'
19
+ SafetyNetHeroku.config[:aws_backups_directory] = s3_directory'
22
20
 
23
- ## Usage
21
+ ```
24
22
 
25
- TODO: Write usage instructions here
23
+ In your sidekiq initializer, import the Sidekiq worker:
26
24
 
27
- ## Development
25
+ ```ruby
26
+ # sidekiq.rb
27
+
28
+ require 'safety_net_heroku/backup_database_worker'
29
+ ```
30
+ Add the worker to your sidekiq schedule as a cron job:
28
31
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
32
+ ```ruby
33
+ # sidekiq_schedule.yml
34
+
35
+ backup_database:
36
+ cron: "0 3 * * *"
37
+ class: "SafetyNetHeroku::BackupDatabaseWorker"
38
+ ```
30
39
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
40
+ #### Your database will now be backed up to the AWS directory specified periodically based on your cron settings! 🎉
32
41
 
33
- ## Contributing
42
+ ## Author
34
43
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/safety_net_heroku.
44
+ Dalton Hinterscher, daltonhint4@gmail.com
36
45
 
37
46
  ## License
38
47
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
48
+ Safety Net Heroku is available under the MIT license. See the LICENSE file for more info.
@@ -1,5 +1,4 @@
1
1
  require "safety_net_heroku/version"
2
- #require "safety_net_heroku/backup_database_worker"
3
2
 
4
3
  module SafetyNetHeroku
5
4
  def self.config
@@ -1,3 +1,3 @@
1
1
  module SafetyNetHeroku
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safety_net_heroku
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - daltron