litestream_rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 16364fd870caac32d1ebd6384fdf8efa2df6ffe03d869fc2b81690e17dee918f
4
+ data.tar.gz: ee3fd64699cb1e653af24b8fb18cfdb90e2dba88f97eed0233cc077e9880cb98
5
+ SHA512:
6
+ metadata.gz: bf308da1364cd89cae383a9a611f44f6d9f8ad887e1a98b5129197a712776fb731ae48ee2586371a9e78981771bbc856d067a4c2fbfff530a5046c0a197feb3a
7
+ data.tar.gz: 031747b8616a4f7fe095a1e54bbeed0ce62183bd7a29df3d33a44c6dcc425446c8228eabd1bd4750a7da8895bd52be2eb26aa485fb4b721b51b9f79d9dd4e93f
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # LitestreamRails
2
+
3
+ TODO: Delete this and the text below, and describe your gem
4
+
5
+ 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/litestream_rails`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ ## Installation
8
+
9
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
+
11
+ Install the gem and add to the application's Gemfile by executing:
12
+
13
+ $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
14
+
15
+ If bundler is not being used to manage dependencies, install the gem by executing:
16
+
17
+ $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
+
27
+ 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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
+
29
+ ## Contributing
30
+
31
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/litestream_rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/litestream_rails/blob/main/CODE_OF_CONDUCT.md).
32
+
33
+ ## License
34
+
35
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
36
+
37
+ ## Code of Conduct
38
+
39
+ Everyone interacting in the LitestreamRails project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/litestream_rails/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create
7
+
8
+ require "standard/rake"
9
+
10
+ task default: %i[test standard]
@@ -0,0 +1,7 @@
1
+ module LitestreamRails
2
+ class ApplicationController < ActionController::Base
3
+ protect_from_forgery with: :exception
4
+
5
+ http_basic_authenticate_with name: LitestreamRails.username, password: LitestreamRails.password if LitestreamRails.password
6
+ end
7
+ end
@@ -0,0 +1,32 @@
1
+ module LitestreamRails
2
+ class DatabasesController < ApplicationController
3
+ around_action :force_english_locale!
4
+
5
+ # GET /databases
6
+ def index
7
+ @databases = LitestreamRails.databases
8
+ [{"path"=>"/Users/fractaled/Code/Playgrounds/wrocloverb/storage/production.sqlite3",
9
+ "replicas"=>"s3",
10
+ "generations"=>
11
+ [{"generation"=>"5f4341bc3d22d615",
12
+ "name"=>"s3",
13
+ "lag"=>"3s",
14
+ "start"=>"2024-04-17T19:48:09Z",
15
+ "end"=>"2024-04-17T19:48:09Z",
16
+ "snapshots"=>[{"index"=>"0", "size"=>"4645465", "created"=>"2024-04-17T19:48:09Z"}]},
17
+ {"generation"=>"a184b05a685589f3",
18
+ "name"=>"s3",
19
+ "lag"=>"19h46m52s",
20
+ "start"=>"2024-04-17T00:01:19Z",
21
+ "end"=>"2024-04-17T00:01:19Z",
22
+ "snapshots"=>[{"index"=>"1", "size"=>"4645465", "created"=>"2024-04-17T00:01:19Z"}]}]}]
23
+ end
24
+
25
+ private
26
+
27
+ def force_english_locale!(&action)
28
+ I18n.with_locale(:en, &action)
29
+ end
30
+ end
31
+ end
32
+