lite-redis 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -2
  3. data/CHANGELOG.md +6 -20
  4. data/Gemfile +1 -1
  5. data/Gemfile.lock +29 -29
  6. data/README.md +12 -19
  7. data/Rakefile +2 -2
  8. data/bin/console +3 -3
  9. data/docs/CONNECTION.md +8 -4
  10. data/docs/GEO.md +8 -4
  11. data/docs/HASH.md +8 -4
  12. data/docs/HYPER_LOG_LOG.md +7 -3
  13. data/docs/KEY.md +7 -3
  14. data/docs/LIST.md +7 -3
  15. data/docs/PUB_SUB.md +6 -2
  16. data/docs/SCRIPT.md +7 -3
  17. data/docs/SET.md +7 -3
  18. data/docs/SORTED_SET.md +8 -4
  19. data/docs/STRING.md +7 -3
  20. data/docs/TRANSACTION.md +8 -4
  21. data/lib/generators/lite/redis/install_generator.rb +2 -2
  22. data/lib/lite/redis/base.rb +53 -2
  23. data/lib/lite/redis/configuration.rb +2 -0
  24. data/lib/lite/redis/connection.rb +96 -3
  25. data/lib/lite/redis/geo.rb +24 -3
  26. data/lib/lite/redis/hash.rb +60 -3
  27. data/lib/lite/redis/hyper_log_log.rb +12 -3
  28. data/lib/lite/redis/key.rb +86 -3
  29. data/lib/lite/redis/list.rb +124 -3
  30. data/lib/lite/redis/pub_sub.rb +36 -3
  31. data/lib/lite/redis/railtie.rb +1 -1
  32. data/lib/lite/redis/script.rb +12 -3
  33. data/lib/lite/redis/set.rb +60 -3
  34. data/lib/lite/redis/sorted_set.rb +127 -3
  35. data/lib/lite/redis/string.rb +87 -3
  36. data/lib/lite/redis/transaction.rb +20 -3
  37. data/lib/lite/redis/version.rb +1 -1
  38. data/lib/lite/redis.rb +17 -32
  39. data/lib/tasks/redis.rake +10 -10
  40. data/lite-redis.gemspec +27 -34
  41. metadata +7 -16
  42. data/lib/lite/redis/helpers/base_helper.rb +0 -41
  43. data/lib/lite/redis/helpers/connection_helper.rb +0 -105
  44. data/lib/lite/redis/helpers/geo_helper.rb +0 -33
  45. data/lib/lite/redis/helpers/hash_helper.rb +0 -69
  46. data/lib/lite/redis/helpers/hyper_log_log_helper.rb +0 -21
  47. data/lib/lite/redis/helpers/key_helper.rb +0 -95
  48. data/lib/lite/redis/helpers/list_helper.rb +0 -133
  49. data/lib/lite/redis/helpers/pub_sub_helper.rb +0 -45
  50. data/lib/lite/redis/helpers/script_helper.rb +0 -21
  51. data/lib/lite/redis/helpers/set_helper.rb +0 -69
  52. data/lib/lite/redis/helpers/sorted_set_helper.rb +0 -136
  53. data/lib/lite/redis/helpers/string_helper.rb +0 -96
  54. data/lib/lite/redis/helpers/transaction_helper.rb +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 642392448791c4c6ad57bf6a3891dbe5328846ffdf8c9dd642a2cee7c9be55f2
4
- data.tar.gz: 5669cd7aea321718b45576ba3d1ab39bf132bb66002b6c135c1cd4e22f39c490
3
+ metadata.gz: fecc0a6a4777336e6cc102628f7bf2327a1e4c2e15a4bc0751e90548f03df99e
4
+ data.tar.gz: dda8f438f3294cda99f4bf02c54d6597fd7dbdc20f6a932bcfe37576f2b5d965
5
5
  SHA512:
6
- metadata.gz: 71cf4f8c52403688529fcec71ff8501370b9b65aa472dbe03483fd17901e132552161309a5f6af2b5cb26981ac471c6498686e1669725f4770b5b328b99e3c57
7
- data.tar.gz: 55ce0ddfc26b79422f9f1e3bc46fed1df9b548b53253ef69ce68311d8c44be7729e2ef08df3838f05f1ade27f47095b51e32dd751e80d65b6eddcd009344182e
6
+ metadata.gz: 5445af5825a97e587b2bcbaeeceec785a008fc1dffefd50d5b0c1001dc5c17177737cab713b88ad966a7cca40e09e32e36fc9ca888af7ab4f591be16da020706
7
+ data.tar.gz: 0d33ac48c3d09f2ccf834c826eca89a961032d1e5ffa9ba8d99b111ea9e86edcb1b60e67de08490beebab83ae201143fd5e601f644c0b114aa8bf32496b580f0
data/.rubocop.yml CHANGED
@@ -3,7 +3,6 @@ require:
3
3
  - rubocop-rake
4
4
  - rubocop-rspec
5
5
  AllCops:
6
- TargetRubyVersion: 3.0
7
6
  NewCops: enable
8
7
  DisplayCopNames: true
9
8
  DisplayStyleGuide: true
@@ -19,7 +18,7 @@ Layout/EmptyLinesAroundClassBody:
19
18
  Layout/EmptyLinesAroundModuleBody:
20
19
  EnforcedStyle: empty_lines_except_namespace
21
20
  Layout/LineLength:
22
- Max: 100
21
+ Enabled: false
23
22
  Layout/SpaceAroundMethodCallOperator:
24
23
  Enabled: true
25
24
  Lint/RaiseException:
@@ -30,6 +29,8 @@ Metrics/BlockLength:
30
29
  Exclude:
31
30
  - 'spec/**/**/*'
32
31
  - '*.gemspec'
32
+ Naming/BlockForwarding:
33
+ Enabled: false
33
34
  Naming/InclusiveLanguage:
34
35
  Enabled: false
35
36
  RSpec/EmptyExampleGroup:
@@ -44,3 +45,5 @@ Style/Documentation:
44
45
  Enabled: false
45
46
  Style/ExpandPathArguments:
46
47
  Enabled: false
48
+ Style/StringLiterals:
49
+ EnforcedStyle: double_quotes
data/CHANGELOG.md CHANGED
@@ -7,62 +7,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [1.2.0] - 2022-09-26
10
+ ## [1.3.0] - 2022-11-19
11
+ ### Changed
12
+ - Improved docs
13
+ - Improve internal setup
14
+ - Improved rubocop setup
11
15
 
16
+ ## [1.2.0] - 2022-09-26
12
17
  ### Removed
13
-
14
18
  - Removed deprecated `Redis.exists_returns_integer`
15
19
 
16
20
  ## [1.1.2] - 2021-07-22
17
-
18
21
  ### Changed
19
-
20
22
  - Improved setup
21
23
 
22
24
  ## [1.1.1] - 2021-07-21
23
-
24
25
  ### Changed
25
-
26
26
  - Improved Railtie support
27
27
 
28
28
  ## [1.1.0] - 2021-07-19
29
-
30
29
  ### Added
31
-
32
30
  - Added Ruby 3.0 support
33
31
 
34
32
  ## [1.0.5] - 2020-07-03
35
-
36
33
  ### Added
37
-
38
34
  - Added Ruby 2.7 support
39
35
 
40
36
  ## [1.0.4] - 2019-08-24
41
-
42
37
  ### Changed
43
-
44
38
  - Improved how configuration works
45
39
 
46
40
  ## [1.0.3] - 2019-08-15
47
-
48
41
  ### Changed
49
-
50
42
  - Fix broken rake task
51
43
 
52
44
  ## [1.0.2] - 2019-08-15
53
-
54
45
  ### Changed
55
-
56
46
  - Underscore initializer file name
57
47
 
58
48
  ## [1.0.1] - 2019-07-09
59
-
60
49
  ### Changed
61
-
62
50
  - Updated the client method construction
63
51
 
64
52
  ## [1.0.0] - 2019-07-08
65
-
66
53
  ### Added
67
-
68
54
  - Initial project version
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in lite-redis.gemspec
6
6
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-redis (1.2.0)
4
+ lite-redis (1.3.0)
5
5
  redis
6
6
 
7
7
  GEM
@@ -50,7 +50,7 @@ GEM
50
50
  method_source (1.0.0)
51
51
  mini_portile2 (2.8.0)
52
52
  minitest (5.16.3)
53
- nokogiri (1.13.8)
53
+ nokogiri (1.13.9)
54
54
  mini_portile2 (~> 2.8.0)
55
55
  racc (~> 1.4)
56
56
  parallel (1.22.1)
@@ -75,47 +75,47 @@ GEM
75
75
  rainbow (3.1.1)
76
76
  rake (13.0.6)
77
77
  redis (4.8.0)
78
- regexp_parser (2.5.0)
78
+ regexp_parser (2.6.1)
79
79
  rexml (3.2.5)
80
- rspec (3.11.0)
81
- rspec-core (~> 3.11.0)
82
- rspec-expectations (~> 3.11.0)
83
- rspec-mocks (~> 3.11.0)
84
- rspec-core (3.11.0)
85
- rspec-support (~> 3.11.0)
86
- rspec-expectations (3.11.1)
80
+ rspec (3.12.0)
81
+ rspec-core (~> 3.12.0)
82
+ rspec-expectations (~> 3.12.0)
83
+ rspec-mocks (~> 3.12.0)
84
+ rspec-core (3.12.0)
85
+ rspec-support (~> 3.12.0)
86
+ rspec-expectations (3.12.0)
87
87
  diff-lcs (>= 1.2.0, < 2.0)
88
- rspec-support (~> 3.11.0)
89
- rspec-mocks (3.11.1)
88
+ rspec-support (~> 3.12.0)
89
+ rspec-mocks (3.12.0)
90
90
  diff-lcs (>= 1.2.0, < 2.0)
91
- rspec-support (~> 3.11.0)
92
- rspec-rails (5.1.2)
93
- actionpack (>= 5.2)
94
- activesupport (>= 5.2)
95
- railties (>= 5.2)
96
- rspec-core (~> 3.10)
97
- rspec-expectations (~> 3.10)
98
- rspec-mocks (~> 3.10)
99
- rspec-support (~> 3.10)
100
- rspec-support (3.11.1)
101
- rubocop (1.36.0)
91
+ rspec-support (~> 3.12.0)
92
+ rspec-rails (6.0.1)
93
+ actionpack (>= 6.1)
94
+ activesupport (>= 6.1)
95
+ railties (>= 6.1)
96
+ rspec-core (~> 3.11)
97
+ rspec-expectations (~> 3.11)
98
+ rspec-mocks (~> 3.11)
99
+ rspec-support (~> 3.11)
100
+ rspec-support (3.12.0)
101
+ rubocop (1.39.0)
102
102
  json (~> 2.3)
103
103
  parallel (~> 1.10)
104
104
  parser (>= 3.1.2.1)
105
105
  rainbow (>= 2.2.2, < 4.0)
106
106
  regexp_parser (>= 1.8, < 3.0)
107
107
  rexml (>= 3.2.5, < 4.0)
108
- rubocop-ast (>= 1.20.1, < 2.0)
108
+ rubocop-ast (>= 1.23.0, < 2.0)
109
109
  ruby-progressbar (~> 1.7)
110
110
  unicode-display_width (>= 1.4.0, < 3.0)
111
- rubocop-ast (1.21.0)
111
+ rubocop-ast (1.23.0)
112
112
  parser (>= 3.1.1.0)
113
- rubocop-performance (1.15.0)
113
+ rubocop-performance (1.15.1)
114
114
  rubocop (>= 1.7.0, < 2.0)
115
115
  rubocop-ast (>= 0.4.0)
116
116
  rubocop-rake (0.6.0)
117
117
  rubocop (~> 1.0)
118
- rubocop-rspec (2.13.2)
118
+ rubocop-rspec (2.15.0)
119
119
  rubocop (~> 1.33)
120
120
  ruby-progressbar (1.11.0)
121
121
  ruby_parser (3.19.1)
@@ -125,7 +125,7 @@ GEM
125
125
  tzinfo (2.0.5)
126
126
  concurrent-ruby (~> 1.0)
127
127
  unicode-display_width (2.3.0)
128
- zeitwerk (2.6.0)
128
+ zeitwerk (2.6.6)
129
129
 
130
130
  PLATFORMS
131
131
  ruby
@@ -146,4 +146,4 @@ DEPENDENCIES
146
146
  rubocop-rspec
147
147
 
148
148
  BUNDLED WITH
149
- 2.3.22
149
+ 2.3.26
data/README.md CHANGED
@@ -5,8 +5,6 @@
5
5
 
6
6
  Lite::Redis is a library for accessing Redis with an ActiveRecord like ORM interface.
7
7
 
8
- **NOTE:** If you are coming from `ActiveRedisDB`, please read the [port](#port) section.
9
-
10
8
  ## Installation
11
9
 
12
10
  Add this line to your application's Gemfile:
@@ -29,12 +27,11 @@ Or install it yourself as:
29
27
  * [Pooling](#pooling)
30
28
  * [Commands](#commands)
31
29
  * [Callers](#callers)
32
- * [Port](#port)
33
30
 
34
31
  ## Configurations
35
32
 
36
- `rails g lite:redis:install` will generate the following file:
37
- `../config/initalizers/lite_redis.rb`
33
+ `rails g lite:redis:install` will generate the following file in your application root:
34
+ `config/initalizers/lite_redis.rb`
38
35
 
39
36
  ```ruby
40
37
  Lite::Redis.configure do |config|
@@ -69,25 +66,21 @@ end
69
66
 
70
67
  ## Callers
71
68
 
72
- There are two ways to access Redis commands, single class and multiple instance access.
73
- Multiple instance access reuses a Redis connection for better performance.
69
+ Redis commands could be via a class or instance call.
70
+ Instance access reuses a Redis connection for better performance.
74
71
 
72
+ #### Instance
75
73
  ```ruby
76
- # Single class access
77
- Lite::Redis::String.create(:example, '123')
78
- Lite::Redis::String.find(:example)
79
-
80
- # - or -
81
-
82
- # Multiple instance access
83
74
  string = Lite::Redis::String.new
84
75
  string.create(:example, '123')
85
76
  string.find(:example)
86
77
  ```
87
78
 
88
- ## Port
89
-
90
- `Lite::Redis` is a near compatible port of [ActiveRedisDB](https://github.com/drexed/active_redis_db).
79
+ #### Class
80
+ ```ruby
81
+ Lite::Redis::String.create(:example, '123')
82
+ Lite::Redis::String.find(:example)
83
+ ```
91
84
 
92
85
  ## Development
93
86
 
@@ -97,7 +90,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
97
90
 
98
91
  ## Contributing
99
92
 
100
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lite-redis. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
93
+ Bug reports and pull requests are welcome on GitHub at https://github.com/drexed/lite-redis. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
101
94
 
102
95
  ## License
103
96
 
@@ -105,4 +98,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
105
98
 
106
99
  ## Code of Conduct
107
100
 
108
- Everyone interacting in the Lite::Redis project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lite-redis/blob/master/CODE_OF_CONDUCT.md).
101
+ Everyone interacting in the Lite::Redis project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/drexed/lite-redis/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
data/bin/console CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'bundler/setup'
5
- require 'lite/redis'
4
+ require "bundler/setup"
5
+ require "lite/redis"
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
@@ -11,5 +11,5 @@ require 'lite/redis'
11
11
  # require "pry"
12
12
  # Pry.start
13
13
 
14
- require 'irb'
14
+ require "irb"
15
15
  IRB.start(__FILE__)
data/docs/CONNECTION.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # Connection
2
2
 
3
- #### Usage
3
+ ## Usage
4
4
 
5
- Please read the corresponding [helper](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/helpers/connection_helper.rb) file to see all available methods.
5
+ Please read the corresponding [class](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/connection.rb) file to see all available methods.
6
6
 
7
7
  Please read the corresponding [spec](https://github.com/drexed/lite-redis/blob/master/spec/lite/redis/connection_spec.rb) file to see more example usages.
8
8
 
9
+ #### Instance
9
10
  ```ruby
10
11
  connection = Lite::Redis::Connection.new
11
- connection.authenticate('pass') #=> 'OK'
12
+ connection.connected? #=> true
13
+ ```
12
14
 
13
- Lite::Redis::Connection.connected? #=> true
15
+ #### Class
16
+ ```ruby
17
+ Lite::Redis::Connection.connected? #=> true
14
18
  ```
data/docs/GEO.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # Geo
2
2
 
3
- #### Usage
3
+ ## Usage
4
4
 
5
- Please read the corresponding [helper](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/helpers/geo_helper.rb) file to see all available methods.
5
+ Please read the corresponding [class](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/geo.rb) file to see all available methods.
6
6
 
7
7
  Please read the corresponding [spec](https://github.com/drexed/lite-redis/blob/master/spec/lite/redis/geo_spec.rb) file to see more example usages.
8
8
 
9
+ #### Instance
9
10
  ```ruby
10
11
  geo = Lite::Redis::Geo.new
11
- geo.create('Sicily', 13.361389, 38.115556) #=> 1
12
+ geo.position('Sicily', 'Catania') #=> [['15.08726745843887329', '37.50266842333162032']]
13
+ ```
12
14
 
13
- Lite::Redis::Geo.position('Sicily', 'Catania') #=> [['15.08726745843887329', '37.50266842333162032']]
15
+ #### Class
16
+ ```ruby
17
+ Lite::Redis::Geo.position('Sicily', 'Catania') #=> [['15.08726745843887329', '37.50266842333162032']]
14
18
  ```
data/docs/HASH.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # Hash
2
2
 
3
- #### Usage
3
+ ## Usage
4
4
 
5
- Please read the corresponding [helper](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/helpers/hash_helper.rb) file to see all available methods.
5
+ Please read the corresponding [class](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/hash.rb) file to see all available methods.
6
6
 
7
7
  Please read the corresponding [spec](https://github.com/drexed/lite-redis/blob/master/spec/lite/redis/hash_spec.rb) file to see more example usages.
8
8
 
9
+ #### Instance
9
10
  ```ruby
10
11
  hash = Lite::Redis::Hash.new
11
- hash.create(:example, :name, 1)
12
+ hash.find(:example, :name) #=> 1
13
+ ```
12
14
 
13
- Lite::Redis::Hash.find(:example, :name) #=> 1
15
+ #### Class
16
+ ```ruby
17
+ Lite::Redis::Hash.find(:example, :name) #=> 1
14
18
  ```
@@ -1,14 +1,18 @@
1
1
  # HyperLogLog
2
2
 
3
- #### Usage
3
+ ## Usage
4
4
 
5
- Please read the corresponding [helper](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/helpers/hyper_log_log_helper.rb) file to see all available methods.
5
+ Please read the corresponding [class](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/hyper_log_log.rb) file to see all available methods.
6
6
 
7
7
  Please read the corresponding [spec](https://github.com/drexed/lite-redis/blob/master/spec/lite/redis/hyper_log_log_spec.rb) file to see more example usages.
8
8
 
9
+ #### Instance
9
10
  ```ruby
10
11
  hyper_log_log = Lite::Redis::HyperLogLog.new
11
- hyper_log_log.create(:foo, 's1') #=> true
12
+ hyper_log_log.count(:foo) #=> 1
13
+ ```
12
14
 
15
+ #### Class
16
+ ```ruby
13
17
  Lite::Redis::HyperLogLog.count(:foo) #=> 1
14
18
  ```
data/docs/KEY.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # Key
2
2
 
3
- #### Usage
3
+ ## Usage
4
4
 
5
- Please read the corresponding [helper](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/helpers/key_helper.rb) file to see all available methods.
5
+ Please read the corresponding [class](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/key.rb) file to see all available methods.
6
6
 
7
7
  Please read the corresponding [spec](https://github.com/drexed/lite-redis/blob/master/spec/lite/redis/key_spec.rb) file to see more example usages.
8
8
 
9
+ #### Instance
9
10
  ```ruby
10
11
  key = Lite::Redis::Key.new
11
- key.create(:example, 'hello') #=> 'OK'
12
+ key.exists?(:example) #=> true
13
+ ```
12
14
 
15
+ #### Class
16
+ ```ruby
13
17
  Lite::Redis::Key.exists?(:example) #=> true
14
18
  ```
data/docs/LIST.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # List
2
2
 
3
- #### Usage
3
+ ## Usage
4
4
 
5
- Please read the corresponding [helper](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/helpers/list_helper.rb) file to see all available methods.
5
+ Please read the corresponding [class](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/list.rb) file to see all available methods.
6
6
 
7
7
  Please read the corresponding [spec](https://github.com/drexed/lite-redis/blob/master/spec/lite/redis/list_spec.rb) file to see more example usages.
8
8
 
9
+ #### Instance
9
10
  ```ruby
10
11
  list = Lite::Redis::List.new
11
- list.create(:example, 'one') #=> 'OK'
12
+ list.first(:example) #=> 'one'
13
+ ```
12
14
 
15
+ #### Class
16
+ ```ruby
13
17
  Lite::Redis::List.first(:example) #=> 'one'
14
18
  ```
data/docs/PUB_SUB.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # PubSub
2
2
 
3
- #### Usage
3
+ ## Usage
4
4
 
5
- Please read the corresponding [helper](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/helpers/pub_sub_helper.rb) file to see all available methods.
5
+ Please read the corresponding [class](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/pub_sub.rb) file to see all available methods.
6
6
 
7
7
  Please read the corresponding [spec](https://github.com/drexed/lite-redis/blob/master/spec/lite/redis/pub_sub_spec.rb) file to see more example usages.
8
8
 
9
+ #### Instance
9
10
  ```ruby
10
11
  pub_sub = Lite::Redis::PubSub.new
11
12
  pub_sub.subscribe('foo') do |on|
@@ -26,6 +27,9 @@ pub_sub.subscribe('foo') do |on|
26
27
  @t2 = total
27
28
  end
28
29
  end
30
+ ```
29
31
 
32
+ #### Class
33
+ ```ruby
30
34
  Lite::Redis::PubSub.subscribed? #=> true
31
35
  ```
data/docs/SCRIPT.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # Script
2
2
 
3
- #### Usage
3
+ ## Usage
4
4
 
5
- Please read the corresponding [helper](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/helpers/script_helper.rb) file to see all available methods.
5
+ Please read the corresponding [class](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/script.rb) file to see all available methods.
6
6
 
7
7
  Please read the corresponding [spec](https://github.com/drexed/lite-redis/blob/master/spec/lite/redis/script_spec.rb) file to see more example usages.
8
8
 
9
+ # Instance
9
10
  ```ruby
10
11
  script = Lite::Redis::Script.new
11
- script.script(:load, script) #=> 'OK'
12
+ script.eval('return #KEYS') #=> 0
13
+ ```
12
14
 
15
+ #### Class
16
+ ```ruby
13
17
  Lite::Redis::Script.eval('return #KEYS') #=> 0
14
18
  ```
data/docs/SET.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # Set
2
2
 
3
- #### Usage
3
+ ## Usage
4
4
 
5
- Please read the corresponding [helper](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/helpers/set_helper.rb) file to see all available methods.
5
+ Please read the corresponding [class](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/set.rb) file to see all available methods.
6
6
 
7
7
  Please read the corresponding [spec](https://github.com/drexed/lite-redis/blob/master/spec/lite/redis/set_spec.rb) file to see more example usages.
8
8
 
9
+ #### Instance
9
10
  ```ruby
10
11
  set = Lite::Redis::Set.new
11
- set.create(:example, '1') #=> 'OK'
12
+ set.find(:example) #=> ['1']
13
+ ```
12
14
 
15
+ #### Class
16
+ ```ruby
13
17
  Lite::Redis::Set.find(:example) #=> ['1']
14
18
  ```
data/docs/SORTED_SET.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # Sorted Set
2
2
 
3
- #### Usage
3
+ ## Usage
4
4
 
5
- Please read the corresponding [helper](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/helpers/sorted_set_helper.rb) file to see all available methods.
5
+ Please read the corresponding [class](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/sorted_set.rb) file to see all available methods.
6
6
 
7
7
  Please read the corresponding [spec](https://github.com/drexed/lite-redis/blob/master/spec/lite/redis/sorted_set_spec.rb) file to see more example usages.
8
8
 
9
+ #### Instance
9
10
  ```ruby
10
11
  sorted_set = Lite::Redis::SortedSet.new
11
- sorted_set.create(:example, 1, 1, 2, 'two', 3, '3') #=> 'OK'
12
+ sorted_set.find(:example, 2) #=> 'two'
13
+ ```
12
14
 
13
- Lite::Redis::SortedSet.find(:example, 2) #=> 'two'
15
+ #### Class
16
+ ```ruby
17
+ Lite::Redis::SortedSet.find(:example, 2) #=> 'two'
14
18
  ```
data/docs/STRING.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # String
2
2
 
3
- #### Usage
3
+ ## Usage
4
4
 
5
- Please read the corresponding [helper](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/helpers/string_helper.rb) file to see all available methods.
5
+ Please read the corresponding [class](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/string.rb) file to see all available methods.
6
6
 
7
7
  Please read the corresponding [spec](https://github.com/drexed/lite-redis/blob/master/spec/lite/redis/string_spec.rb) file to see more example usages.
8
8
 
9
+ #### Instance
9
10
  ```ruby
10
11
  string = Lite::Redis::String.new
11
- string.create(:example1, '123') #=> 'OK'
12
+ string.create(:example1, '123') #=> 'OK'
13
+ ```
12
14
 
15
+ #### Class
16
+ ```ruby
13
17
  Lite::Redis::String.find(:example1) #=> '123'
14
18
  ```
data/docs/TRANSACTION.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # Transaction
2
2
 
3
- #### Usage
3
+ ## Usage
4
4
 
5
- Please read the corresponding [helper](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/helpers/transaction_helper.rb) file to see all available methods.
5
+ Please read the corresponding [class](https://github.com/drexed/lite-redis/blob/master/lib/lite/redis/transaction.rb) file to see all available methods.
6
6
 
7
7
  Please read the corresponding [spec](https://github.com/drexed/lite-redis/blob/master/spec/lite/redis/transaction_spec.rb) file to see more example usages.
8
8
 
9
+ #### Instance
9
10
  ```ruby
10
11
  transaction = Lite::Redis::Transaction.new
11
- transaction.multi { |m| m.set('foo', 's1') } #=> 'OK'
12
+ transaction.discard #=> 'OK'
13
+ ```
12
14
 
13
- Lite::Redis::Transaction.discard #=> 'OK'
15
+ #### Class
16
+ ```ruby
17
+ Lite::Redis::Transaction.discard #=> 'OK'
14
18
  ```
@@ -4,10 +4,10 @@ module Lite
4
4
  module Redis
5
5
  class InstallGenerator < Rails::Generators::Base
6
6
 
7
- source_root File.expand_path('../templates', __FILE__)
7
+ source_root File.expand_path("../templates", __FILE__)
8
8
 
9
9
  def copy_initializer_file
10
- copy_file('install.rb', 'config/initializers/lite_redis.rb')
10
+ copy_file("install.rb", "config/initializers/lite_redis.rb")
11
11
  end
12
12
 
13
13
  end