tiny-redis 0.0.7 → 0.0.12

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: c10fdb8684fc3377ed6c516b0c07d4ecfe77d3ecd07893b04aff36e6ebe7ee7f
4
- data.tar.gz: 8669162c0bfd1c8edd0e2779b9daac9dbc1600fa785751d3059de716449674c5
3
+ metadata.gz: a3c3bcffcac3db520b0ebd410502ae66d32b94f07f5491ff13476988ec1cd9fd
4
+ data.tar.gz: 813793cec558b3c6800d79e27a7d30ee0f96f65aa73215639092f386424d0058
5
5
  SHA512:
6
- metadata.gz: 4fca70d1889a3f7b7da86eaf8e245fea77af710f5d3a4865d1320b47b9ae62dec776209386d5823b5ce31c01104c62e52861d13e5114f368f8678ba26f419c3b
7
- data.tar.gz: 45e7cb8bb66c998201f605dba108768a059dc15bc066adf1b9a0eda96fcae975ad76080ce70b4524f0ddd6e742df73e17dc3a3e3ed9d332cadb03f5a1ffa00ca
6
+ metadata.gz: a2a6c54e535a422971eef2def1d814885c101e1ef6d47c7fd983003a63ba7a0317367cfb9265438f5ec877effb44a85df8b89c368b32c740e808520d61ddc747
7
+ data.tar.gz: 822f019b23e9d59254475aabe26394e47f8afeb3f58520779727f25e69bf297456f11a3a9a7d67d58a6f62c1b8a89feb8e082ffc8bcce247bdc626364b60dae5
data/README.md CHANGED
@@ -1,28 +1,39 @@
1
- # Tiny::Redis
2
- Short description and motivation.
1
+ ### tiny-redis
3
2
 
4
- ## Usage
5
- How to use my plugin.
3
+ Tiny Redis - encrypted barebones JSON formatted orm.
4
+ Encryption is Rails Credentials based.
6
5
 
7
- ## Installation
8
- Add this line to your application's Gemfile:
6
+ Steps to use:
7
+ ```
8
+ add to Gemfile:
9
+ gem 'tiny-redis'
10
+
11
+ bundle install
9
12
 
10
- ```ruby
11
- gem 'tiny-redis'
13
+ rails g tiny_redis
14
+
15
+ this will install initalizer that creates a pool of redis connections
12
16
  ```
13
17
 
14
- And then execute:
15
- ```bash
16
- $ bundle
18
+ ## How to use
19
+
20
+ ```
21
+ class User
22
+ include Tiny::Redis
23
+
24
+ attr_accessor :email
25
+ alias_method :index, :email # this will tie your records method to indexing parameter
26
+ end
27
+ ```
28
+ Set up credentials:
17
29
  ```
30
+ rails credentials:edit --environment development
18
31
 
19
- Or install it yourself as:
20
- ```bash
21
- $ gem install tiny-redis
32
+ add:
33
+ user:
34
+ encryptkey: abcdabcdabcdadbvabcdabcdabcdadbv
22
35
  ```
23
36
 
24
- ## Contributing
25
- Contribution directions go here.
37
+ Now your records in redis are encrypted. If you wish for more security you can remove config/master.key after server starts. And investigate SE Linux address space protection so hacker can't pry encryption key from the app so easily.
26
38
 
27
- ## License
28
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
39
+ Have fun! 🎉
@@ -0,0 +1,12 @@
1
+ class TinyRedisGenerator < Rails::Generators::Base
2
+ def create_tiny_redis_file
3
+ create_file "config/initializers/tiny-redis.rb", <<EOD
4
+ if Rails.env.test?
5
+ $redis = ConnectionPool::Wrapper.new(size: 5, timeout: 3) { Redis.new(url: 'redis://127.0.0.1:6379/2') }
6
+ $redis.flushall
7
+ else
8
+ $redis = ConnectionPool::Wrapper.new(size: 5, timeout: 3) { Redis.new(url: 'redis://127.0.0.1:6379/1') }
9
+ end
10
+ EOD
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  module Tiny
2
2
  module Redis
3
- VERSION = '0.0.7'
3
+ VERSION = '0.0.12'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Zaitsev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-27 00:00:00.000000000 Z
11
+ date: 2020-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -68,6 +68,7 @@ files:
68
68
  - MIT-LICENSE
69
69
  - README.md
70
70
  - Rakefile
71
+ - lib/generators/tiny_redis_generator.rb
71
72
  - lib/tasks/tiny/redis_tasks.rake
72
73
  - lib/tiny/redis.rb
73
74
  - lib/tiny/redis/railtie.rb