simple-feed 2.0.2 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +5 -5
  2. data/.envrc +3 -0
  3. data/.github/workflows/rubocop.yml +33 -0
  4. data/.github/workflows/ruby.yml +34 -0
  5. data/.gitignore +2 -1
  6. data/.relaxed-rubocop-2.4.yml +174 -0
  7. data/.rspec +1 -1
  8. data/.rubocop.yml +43 -1150
  9. data/.rubocop_todo.yml +203 -0
  10. data/.travis.yml +7 -10
  11. data/CHANGELOG.md +120 -0
  12. data/Gemfile +4 -0
  13. data/Guardfile +3 -3
  14. data/README.adoc +601 -0
  15. data/Rakefile +5 -6
  16. data/bin/console +1 -0
  17. data/codecov.yml +28 -0
  18. data/examples/shared/provider_example.rb +51 -26
  19. data/lib/simple-feed.rb +2 -0
  20. data/lib/simple_feed.rb +2 -0
  21. data/lib/simplefeed/activity/base.rb +2 -0
  22. data/lib/simplefeed/activity/multi_user.rb +8 -6
  23. data/lib/simplefeed/activity/single_user.rb +7 -6
  24. data/lib/simplefeed/dsl/activities.rb +4 -3
  25. data/lib/simplefeed/dsl/formatter.rb +79 -40
  26. data/lib/simplefeed/dsl.rb +3 -1
  27. data/lib/simplefeed/event.rb +52 -13
  28. data/lib/simplefeed/feed.rb +36 -28
  29. data/lib/simplefeed/providers/base/provider.rb +7 -4
  30. data/lib/simplefeed/providers/hash.rb +2 -0
  31. data/lib/simplefeed/providers/key.rb +60 -36
  32. data/lib/simplefeed/providers/proxy.rb +28 -14
  33. data/lib/simplefeed/providers/redis/driver.rb +25 -27
  34. data/lib/simplefeed/providers/redis/provider.rb +41 -39
  35. data/lib/simplefeed/providers/redis/stats.rb +12 -13
  36. data/lib/simplefeed/providers/redis.rb +2 -0
  37. data/lib/simplefeed/providers.rb +24 -10
  38. data/lib/simplefeed/response.rb +7 -7
  39. data/lib/simplefeed/version.rb +3 -1
  40. data/lib/simplefeed.rb +27 -21
  41. data/man/running-example-redis-debug.png +0 -0
  42. data/man/running-example.png +0 -0
  43. data/man/sf-color-dump.png +0 -0
  44. data/simple-feed.gemspec +23 -16
  45. metadata +115 -44
  46. data/README.md +0 -415
  47. data/examples/hash_provider_example.rb +0 -24
  48. data/lib/simplefeed/key/template.rb +0 -52
  49. data/lib/simplefeed/key/type.rb +0 -26
  50. data/lib/simplefeed/providers/hash/paginator.rb +0 -31
  51. data/lib/simplefeed/providers/hash/provider.rb +0 -198
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,203 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2022-02-19 05:32:33 UTC using RuboCop version 1.25.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Configuration parameters: Include.
11
+ # Include: **/*.gemspec
12
+ Gemspec/RequiredRubyVersion:
13
+ Exclude:
14
+ - 'simple-feed.gemspec'
15
+
16
+ # Offense count: 1
17
+ # Cop supports --auto-correct.
18
+ # Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
19
+ Layout/LeadingCommentSpace:
20
+ Exclude:
21
+ - 'spec/support/mock_feed.rb'
22
+
23
+ # Offense count: 3
24
+ # Configuration parameters: AllowedMethods.
25
+ # AllowedMethods: enums
26
+ Lint/ConstantDefinitionInBlock:
27
+ Exclude:
28
+ - 'spec/simplefeed/dsl/formatter_spec.rb'
29
+ - 'spec/simplefeed/providers/base/provider_spec.rb'
30
+ - 'spec/simplefeed/providers/redis/provider_spec.rb'
31
+
32
+ # Offense count: 3
33
+ Lint/MissingSuper:
34
+ Exclude:
35
+ - 'lib/simplefeed/activity/single_user.rb'
36
+ - 'lib/simplefeed/providers/base/provider.rb'
37
+ - 'spec/support/mock_feed.rb'
38
+
39
+ # Offense count: 4
40
+ # Cop supports --auto-correct-all.
41
+ # Configuration parameters: AllowedMethods.
42
+ # AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
43
+ Lint/RedundantSafeNavigation:
44
+ Exclude:
45
+ - 'lib/simplefeed/providers/proxy.rb'
46
+ - 'lib/simplefeed/providers/redis/driver.rb'
47
+
48
+ # Offense count: 2
49
+ Lint/ShadowingOuterLocalVariable:
50
+ Exclude:
51
+ - 'lib/simplefeed/providers/redis/provider.rb'
52
+
53
+ # Offense count: 1
54
+ # Configuration parameters: AllowKeywordBlockArguments.
55
+ Lint/UnderscorePrefixedVariableName:
56
+ Exclude:
57
+ - 'lib/simplefeed/providers/redis/provider.rb'
58
+
59
+ # Offense count: 1
60
+ # Cop supports --auto-correct-all.
61
+ # Configuration parameters: AllowComments.
62
+ Lint/UselessMethodDefinition:
63
+ Exclude:
64
+ - 'lib/simplefeed/event.rb'
65
+
66
+ # Offense count: 1
67
+ # Configuration parameters: CheckForMethodsWithNoSideEffects.
68
+ Lint/Void:
69
+ Exclude:
70
+ - 'lib/simplefeed/feed.rb'
71
+
72
+ # Offense count: 1
73
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
74
+ # IgnoredMethods: refine
75
+ Metrics/BlockLength:
76
+ Max: 35
77
+
78
+ # Offense count: 1
79
+ # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
80
+ # CheckDefinitionPathHierarchyRoots: lib, spec, test, src
81
+ # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
82
+ Naming/FileName:
83
+ Exclude:
84
+ - 'lib/simple-feed.rb'
85
+
86
+ # Offense count: 1
87
+ # Configuration parameters: EnforcedStyleForLeadingUnderscores.
88
+ # SupportedStylesForLeadingUnderscores: disallowed, required, optional
89
+ Naming/MemoizedInstanceVariableName:
90
+ Exclude:
91
+ - 'lib/simplefeed/providers/redis/stats.rb'
92
+
93
+ # Offense count: 5
94
+ # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
95
+ # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
96
+ Naming/MethodParameterName:
97
+ Exclude:
98
+ - 'lib/simplefeed/dsl/formatter.rb'
99
+ - 'lib/simplefeed/providers/redis/driver.rb'
100
+ - 'spec/support/mock_feed.rb'
101
+ - 'spec/support/shared_examples_for_providers.rb'
102
+
103
+ # Offense count: 1
104
+ # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
105
+ # NamePrefix: is_, has_, have_
106
+ # ForbiddenPrefixes: is_, has_, have_
107
+ # AllowedMethods: is_a?
108
+ # MethodDefinitionMacros: define_method, define_singleton_method
109
+ Naming/PredicateName:
110
+ Exclude:
111
+ - 'spec/**/*'
112
+ - 'lib/simplefeed/response.rb'
113
+
114
+ # Offense count: 2
115
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
116
+ # SupportedStyles: snake_case, normalcase, non_integer
117
+ # AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
118
+ Naming/VariableNumber:
119
+ Exclude:
120
+ - 'spec/simplefeed/activity/multi_user_spec.rb'
121
+
122
+ # Offense count: 4
123
+ # Cop supports --auto-correct-all.
124
+ Style/CaseLikeIf:
125
+ Exclude:
126
+ - 'lib/simplefeed/providers/redis/driver.rb'
127
+ - 'lib/simplefeed/providers/redis/provider.rb'
128
+ - 'lib/simplefeed/providers/redis/stats.rb'
129
+ - 'spec/simplefeed/providers/base/provider_spec.rb'
130
+
131
+ # Offense count: 2
132
+ # Cop supports --auto-correct.
133
+ Style/ExpandPathArguments:
134
+ Exclude:
135
+ - 'lib/simplefeed.rb'
136
+ - 'spec/spec_helper.rb'
137
+
138
+ # Offense count: 2
139
+ # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, IgnoredMethods.
140
+ # SupportedStyles: annotated, template, unannotated
141
+ Style/FormatStringToken:
142
+ EnforcedStyle: unannotated
143
+
144
+ # Offense count: 1
145
+ # Cop supports --auto-correct.
146
+ Style/GlobalStdStream:
147
+ Exclude:
148
+ - 'lib/simplefeed/providers/redis/driver.rb'
149
+
150
+ # Offense count: 2
151
+ # Configuration parameters: MinBodyLength.
152
+ Style/GuardClause:
153
+ Exclude:
154
+ - 'lib/simplefeed/event.rb'
155
+ - 'lib/simplefeed/providers/base/provider.rb'
156
+
157
+ # Offense count: 2
158
+ # Cop supports --auto-correct-all.
159
+ # Configuration parameters: AllowedReceivers.
160
+ Style/HashEachMethods:
161
+ Exclude:
162
+ - 'lib/simplefeed/providers/redis/stats.rb'
163
+ - 'spec/simplefeed/dsl_spec.rb'
164
+
165
+ # Offense count: 1
166
+ # Cop supports --auto-correct.
167
+ # Configuration parameters: AllowIfModifier.
168
+ Style/IfInsideElse:
169
+ Exclude:
170
+ - 'lib/simplefeed/response.rb'
171
+
172
+ # Offense count: 5
173
+ Style/MissingRespondToMissing:
174
+ Exclude:
175
+ - 'lib/simplefeed.rb'
176
+ - 'lib/simplefeed/providers/proxy.rb'
177
+ - 'lib/simplefeed/providers/redis/driver.rb'
178
+
179
+ # Offense count: 3
180
+ # Cop supports --auto-correct.
181
+ Style/MultilineTernaryOperator:
182
+ Exclude:
183
+ - 'lib/simplefeed/feed.rb'
184
+ - 'lib/simplefeed/providers/redis/provider.rb'
185
+ - 'lib/simplefeed/response.rb'
186
+
187
+ # Offense count: 1
188
+ Style/OptionalArguments:
189
+ Exclude:
190
+ - 'lib/simplefeed/providers/redis/provider.rb'
191
+
192
+ # Offense count: 4
193
+ # Cop supports --auto-correct-all.
194
+ # Configuration parameters: Mode.
195
+ Style/StringConcatenation:
196
+ Exclude:
197
+ - 'lib/simplefeed/dsl/formatter.rb'
198
+
199
+ # Offense count: 1
200
+ # Cop supports --auto-correct.
201
+ Style/StructInheritance:
202
+ Exclude:
203
+ - 'lib/simplefeed/providers/redis/driver.rb'
data/.travis.yml CHANGED
@@ -1,14 +1,11 @@
1
+ language: ruby
1
2
  cache: bundler
2
3
  rvm:
3
- - 2.3.3
4
- - 2.4.0
4
+ - 2.3.8
5
+ - 2.4.10
6
+ - 2.5.3
7
+ - 2.6.6
8
+ - 2.7.1
5
9
  services:
6
10
  - redis-server
7
- before_script:
8
- script: bundle exec rspec
9
- after_success:
10
- - bundle exec codeclimate-test-reporter
11
- env:
12
- notifications:
13
- slack:
14
- secure: QaaD9WpCYoGFITVd8ku3cjkw1ADJ/rqsPgFGsbRxjPOj1HDzkkUVs20IK0AysxeI6CPY31rfWqbBcE4I4dUE49uIhpOoBXZ8GDYunUONeEmqGwrqZtV/8NqMLNc0Ouu5Jp/KVlnMO93Pcg97BBW81t1koxqyvgSU5oEmJdTmQZIsRNprhczeCj7T6jbb12LEA8uKi2qnp+FAhL5NJczHxqWCd2pWThtbA+hiRmH/mU0480n1eRForN51jDYUrgxb4PamhfUUG1xkzMPzGsvJTMCQDOG4eyHaq71vlZ3z9BbQG6vbcjfEQHVwfrPRz1k0luIlxMXJxszCFnnLVqeRYs85y4FOQSrLsDfsyLCU+1NgLqtseN6jNKOtY624Ok7YvYzsVYez/CPWUG1d2NIRMYQ+BoL2VQ3SDfvr4bYQ02QmqlhM1bKqmBoM+WmiH1FQk6CKOFcmlSkgkFilLi6YSB/EisQ5V5jo7DnzD38VVACo6J6SgVk2D6soONE3zev34Qa6PIOuwTTlXl6JKH0cpiG058lI+Oza+0xi0jg58sZG3jxeGM7m4wg66htgyN1oRQjIukSR+IJ3PZlFKTLvx2rCUcYz+8fRpPCMTSIVLeju5oPqOm0VRUni2dG5JGyNACV8EhI4ZMcfl7+uFTIagCnllRftBx8lY6AxWN3WpDE=
11
+ script: bundle update && bundle exec rspec
data/CHANGELOG.md ADDED
@@ -0,0 +1,120 @@
1
+ # Changelog
2
+
3
+ ## [v3.1.1](https://github.com/kigster/simple-feed/tree/v3.1.1) (2022-02-22)
4
+
5
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v3.1.0...v3.1.1)
6
+
7
+ **Closed issues:**
8
+
9
+ - Fix pipelined usage for redis.rb 5.0.0 [\#28](https://github.com/kigster/simple-feed/issues/28)
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Redis library 5.0.0 + Removing Hash Provider [\#29](https://github.com/kigster/simple-feed/pull/29) ([kigster](https://github.com/kigster))
14
+ - Add license scan report and status [\#24](https://github.com/kigster/simple-feed/pull/24) ([fossabot](https://github.com/fossabot))
15
+
16
+ ## [v3.1.0](https://github.com/kigster/simple-feed/tree/v3.1.0) (2022-02-21)
17
+
18
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v3.0.1...v3.1.0)
19
+
20
+ **Closed issues:**
21
+
22
+ - Error after upgrading to 3.0 [\#19](https://github.com/kigster/simple-feed/issues/19)
23
+
24
+ ## [v3.0.1](https://github.com/kigster/simple-feed/tree/v3.0.1) (2020-06-17)
25
+
26
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v3.0.0...v3.0.1)
27
+
28
+ **Merged pull requests:**
29
+
30
+ - Use standard \*args expansion for Ruby \< 2.7 [\#21](https://github.com/kigster/simple-feed/pull/21) ([kigster](https://github.com/kigster))
31
+ - Switch to tty-box for color\_dump and examples [\#20](https://github.com/kigster/simple-feed/pull/20) ([kigster](https://github.com/kigster))
32
+
33
+ ## [v3.0.0](https://github.com/kigster/simple-feed/tree/v3.0.0) (2020-05-25)
34
+
35
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v2.1.0...v3.0.0)
36
+
37
+ **Merged pull requests:**
38
+
39
+ - First pass on meta/data refactor to allow different publisher/consumer [\#18](https://github.com/kigster/simple-feed/pull/18) ([kigster](https://github.com/kigster))
40
+ - \(v2.1.0\) Support for non-integer user\_ids [\#17](https://github.com/kigster/simple-feed/pull/17) ([kigster](https://github.com/kigster))
41
+ - Not sure how this is working for everyone else? [\#15](https://github.com/kigster/simple-feed/pull/15) ([rromanchuk](https://github.com/rromanchuk))
42
+ - Adding Codecov [\#14](https://github.com/kigster/simple-feed/pull/14) ([kigster](https://github.com/kigster))
43
+
44
+ ## [v2.1.0](https://github.com/kigster/simple-feed/tree/v2.1.0) (2020-05-24)
45
+
46
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v2.0.2...v2.1.0)
47
+
48
+ **Closed issues:**
49
+
50
+ - Support string or UUID user\_id across the board [\#16](https://github.com/kigster/simple-feed/issues/16)
51
+ - Document overwriting logic, provide override? [\#13](https://github.com/kigster/simple-feed/issues/13)
52
+ - How exactly is data structured and stored into keys? [\#12](https://github.com/kigster/simple-feed/issues/12)
53
+ - Base62 encoding for @user\_id is problematic for namespacing [\#11](https://github.com/kigster/simple-feed/issues/11)
54
+ - Caching conventions? [\#10](https://github.com/kigster/simple-feed/issues/10)
55
+ - Optional secondary index? [\#9](https://github.com/kigster/simple-feed/issues/9)
56
+ - Group feeds? [\#8](https://github.com/kigster/simple-feed/issues/8)
57
+
58
+ ## [v2.0.2](https://github.com/kigster/simple-feed/tree/v2.0.2) (2017-12-07)
59
+
60
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v2.0.1...v2.0.2)
61
+
62
+ **Closed issues:**
63
+
64
+ - Permissions on all .rb file are not correct [\#7](https://github.com/kigster/simple-feed/issues/7)
65
+ - Can I add a connector to use Elasticsearch? [\#6](https://github.com/kigster/simple-feed/issues/6)
66
+ - Multi-feeds aggregation ? [\#4](https://github.com/kigster/simple-feed/issues/4)
67
+ - Explain when feed items are removed/expire from the feed [\#3](https://github.com/kigster/simple-feed/issues/3)
68
+ - how I can periodic export data from Redis to DB \(Postgres, MySQL, etc\) ? [\#2](https://github.com/kigster/simple-feed/issues/2)
69
+
70
+ **Merged pull requests:**
71
+
72
+ - Silence Hashie warnings [\#5](https://github.com/kigster/simple-feed/pull/5) ([wa0x6e](https://github.com/wa0x6e))
73
+
74
+ ## [v2.0.1](https://github.com/kigster/simple-feed/tree/v2.0.1) (2016-12-29)
75
+
76
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v1.0.4...v2.0.1)
77
+
78
+ ## [v1.0.4](https://github.com/kigster/simple-feed/tree/v1.0.4) (2016-12-13)
79
+
80
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v1.0.3...v1.0.4)
81
+
82
+ ## [v1.0.3](https://github.com/kigster/simple-feed/tree/v1.0.3) (2016-12-13)
83
+
84
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v1.0.2...v1.0.3)
85
+
86
+ ## [v1.0.2](https://github.com/kigster/simple-feed/tree/v1.0.2) (2016-12-08)
87
+
88
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v1.0.1...v1.0.2)
89
+
90
+ ## [v1.0.1](https://github.com/kigster/simple-feed/tree/v1.0.1) (2016-12-08)
91
+
92
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v1.0.0...v1.0.1)
93
+
94
+ ## [v1.0.0](https://github.com/kigster/simple-feed/tree/v1.0.0) (2016-12-02)
95
+
96
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v0.5.1...v1.0.0)
97
+
98
+ ## [v0.5.1](https://github.com/kigster/simple-feed/tree/v0.5.1) (2016-12-01)
99
+
100
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v0.5.0...v0.5.1)
101
+
102
+ ## [v0.5.0](https://github.com/kigster/simple-feed/tree/v0.5.0) (2016-11-30)
103
+
104
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v0.4.1...v0.5.0)
105
+
106
+ **Merged pull requests:**
107
+
108
+ - Redis provider implementation \[DO NOT MERGE\] [\#1](https://github.com/kigster/simple-feed/pull/1) ([kigster](https://github.com/kigster))
109
+
110
+ ## [v0.4.1](https://github.com/kigster/simple-feed/tree/v0.4.1) (2016-11-22)
111
+
112
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/v0.4.0...v0.4.1)
113
+
114
+ ## [v0.4.0](https://github.com/kigster/simple-feed/tree/v0.4.0) (2016-11-22)
115
+
116
+ [Full Changelog](https://github.com/kigster/simple-feed/compare/1255221c85540264be91293f2927ddf5a9754dd1...v0.4.0)
117
+
118
+
119
+
120
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile CHANGED
@@ -1,4 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
5
+ gem 'tty-box', git: 'https://github.com/kigster/tty-box'
6
+
3
7
  # Specify your gem's dependencies in activity-feed.gemspec
4
8
  gemspec
data/Guardfile CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  require 'guard/rspec'
3
5
 
4
6
  guard :rspec,
@@ -8,11 +10,9 @@ guard :rspec,
8
10
  all_after_pass: false,
9
11
  all_on_start: false,
10
12
  keep_failed: false do
11
-
12
- watch(%r{.*\.gemspec}) { 'spec' }
13
+ watch(/.*\.gemspec/) { 'spec' }
13
14
  watch(%r{^lib/(.+)\.rb$}) { 'spec' }
14
15
  watch(%r{^spec/.+_spec\.rb$})
15
16
  watch('spec/spec_helper.rb') { 'spec' }
16
17
  watch(%r{spec/support/.*}) { 'spec' }
17
18
  end
18
-