queues 0.1.0.beta

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1ac46c1e3b120fe5eaf42f17f0206f1fad99f7d99efd00f5264d09bcc2b1c08e
4
+ data.tar.gz: fe8e9f5c08a82e268bcffe8eda486a6385e8c7ff3fb726fb081b32d2e5f20ff8
5
+ SHA512:
6
+ metadata.gz: 115afb8a09a6bfdfe710ef5289d579ce0a988ab673aeef32591f0feb3fe8f01b6e7ef2dc037f3807daebb41c8b075f92c617e13a3bae27e19643f2b11447f3e6
7
+ data.tar.gz: 2955af222225103bcc48d6ab56c6f91b739e2e72e12bee1d0d63c8ffc2420bc667f44cb3b108e3cd7eeb5d2a6d5d03077232b8e6a08b3d86f2af1ff6d8c82cf2
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,175 @@
1
+ # Allow longer lines and methods
2
+ Layout/LineLength:
3
+ Max: 240
4
+
5
+ Metrics/MethodLength:
6
+ Max: 30
7
+
8
+ # Tests are declarative, no block length test
9
+ Metrics/BlockLength:
10
+ IgnoredMethods: ['describe', 'context', 'namespace']
11
+
12
+ AllCops:
13
+ TargetRubyVersion: 2.5
14
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
15
+ # to ignore them, so only the ones explicitly set in this file are enabled.
16
+ DisabledByDefault: true
17
+ Exclude:
18
+
19
+ # Prefer &&/|| over and/or.
20
+ Style/AndOr:
21
+ Enabled: true
22
+
23
+ # Align `when` with `case`.
24
+ Layout/CaseIndentation:
25
+ Enabled: true
26
+
27
+ # Align comments with method definitions.
28
+ Layout/CommentIndentation:
29
+ Enabled: true
30
+
31
+ Layout/ElseAlignment:
32
+ Enabled: true
33
+
34
+ # Align `end` with the matching keyword or starting expression except for
35
+ # assignments, where it should be aligned with the LHS.
36
+ Layout/EndAlignment:
37
+ Enabled: true
38
+ EnforcedStyleAlignWith: variable
39
+ AutoCorrect: true
40
+
41
+ Layout/EmptyLineAfterMagicComment:
42
+ Enabled: true
43
+
44
+ # In a regular class definition, no empty lines around the body.
45
+ Layout/EmptyLinesAroundClassBody:
46
+ Enabled: true
47
+
48
+ # In a regular method definition, no empty lines around the body.
49
+ Layout/EmptyLinesAroundMethodBody:
50
+ Enabled: true
51
+
52
+ # In a regular module definition, no empty lines around the body.
53
+ Layout/EmptyLinesAroundModuleBody:
54
+ Enabled: true
55
+
56
+ Layout/FirstArgumentIndentation:
57
+ Enabled: true
58
+
59
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
60
+ Style/HashSyntax:
61
+ Enabled: true
62
+
63
+ # Method definitions after `private` or `protected` isolated calls need one
64
+ # extra level of indentation.
65
+ Layout/IndentationConsistency:
66
+ Enabled: true
67
+ EnforcedStyle: indented_internal_methods
68
+
69
+ # Two spaces, no tabs (for indentation).
70
+ Layout/IndentationWidth:
71
+ Enabled: true
72
+
73
+ Layout/LeadingCommentSpace:
74
+ Enabled: true
75
+
76
+ Layout/SpaceAfterColon:
77
+ Enabled: true
78
+
79
+ Layout/SpaceAfterComma:
80
+ Enabled: true
81
+
82
+ Layout/SpaceAroundEqualsInParameterDefault:
83
+ Enabled: true
84
+
85
+ Layout/SpaceAroundKeyword:
86
+ Enabled: true
87
+
88
+ Layout/SpaceAroundOperators:
89
+ Enabled: true
90
+
91
+ Layout/SpaceBeforeComma:
92
+ Enabled: true
93
+
94
+ Layout/SpaceBeforeFirstArg:
95
+ Enabled: true
96
+
97
+ Style/DefWithParentheses:
98
+ Enabled: true
99
+
100
+ # Defining a method with parameters needs parentheses.
101
+ Style/MethodDefParentheses:
102
+ Enabled: true
103
+
104
+ # Style/FrozenStringLiteralComment:
105
+ # Enabled: true
106
+ # EnforcedStyle: always
107
+ # Exclude:
108
+ # - 'actionview/test/**/*.builder'
109
+ # - 'actionview/test/**/*.ruby'
110
+ # - 'actionpack/test/**/*.builder'
111
+ # - 'actionpack/test/**/*.ruby'
112
+ # - 'activestorage/db/migrate/**/*.rb'
113
+ # - 'db/migrate/**/*.rb'
114
+ # - 'db/*.rb'
115
+
116
+ # Use `foo {}` not `foo{}`.
117
+ Layout/SpaceBeforeBlockBraces:
118
+ Enabled: true
119
+
120
+ # Use `foo { bar }` not `foo {bar}`.
121
+ Layout/SpaceInsideBlockBraces:
122
+ Enabled: true
123
+
124
+ # Use `{ a: 1 }` not `{a:1}`.
125
+ Layout/SpaceInsideHashLiteralBraces:
126
+ Enabled: true
127
+
128
+ Layout/SpaceInsideParens:
129
+ Enabled: true
130
+
131
+ # Check quotes usage according to lint rule below.
132
+ Style/StringLiterals:
133
+ Enabled: true
134
+ EnforcedStyle: single_quotes
135
+
136
+ # Detect hard tabs, no hard tabs.
137
+ Layout/IndentationStyle:
138
+ Enabled: true
139
+
140
+ # Blank lines should not have any spaces.
141
+ Layout/TrailingEmptyLines:
142
+ Enabled: true
143
+
144
+ # No trailing whitespace.
145
+ Layout/TrailingWhitespace:
146
+ Enabled: true
147
+
148
+ # Use quotes for string literals when they are enough.
149
+ Style/RedundantPercentQ:
150
+ Enabled: true
151
+
152
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
153
+ Lint/RequireParentheses:
154
+ Enabled: true
155
+
156
+ Lint/RedundantStringCoercion:
157
+ Enabled: true
158
+
159
+ # Supports --auto-correct
160
+ Style/RedundantSelf:
161
+ Description: Don't use self where it's not needed.
162
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-self-unless-required
163
+ Enabled: true
164
+
165
+ Style/RedundantReturn:
166
+ Enabled: true
167
+ AllowMultipleReturnValues: true
168
+
169
+ Style/Semicolon:
170
+ Enabled: true
171
+ AllowAsExpressionSeparator: true
172
+
173
+ # Prefer Foo.method over Foo::method
174
+ Style/ColonMethodCall:
175
+ Enabled: true
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## [0.1.0.beta] - 2022-03-01
2
+
3
+ - Initial beta release
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in queues.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
data/Gemfile.lock ADDED
@@ -0,0 +1,197 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ queues (0.1.0.pre)
5
+ rails (>= 5)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (7.0.2.2)
11
+ actionpack (= 7.0.2.2)
12
+ activesupport (= 7.0.2.2)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailbox (7.0.2.2)
16
+ actionpack (= 7.0.2.2)
17
+ activejob (= 7.0.2.2)
18
+ activerecord (= 7.0.2.2)
19
+ activestorage (= 7.0.2.2)
20
+ activesupport (= 7.0.2.2)
21
+ mail (>= 2.7.1)
22
+ net-imap
23
+ net-pop
24
+ net-smtp
25
+ actionmailer (7.0.2.2)
26
+ actionpack (= 7.0.2.2)
27
+ actionview (= 7.0.2.2)
28
+ activejob (= 7.0.2.2)
29
+ activesupport (= 7.0.2.2)
30
+ mail (~> 2.5, >= 2.5.4)
31
+ net-imap
32
+ net-pop
33
+ net-smtp
34
+ rails-dom-testing (~> 2.0)
35
+ actionpack (7.0.2.2)
36
+ actionview (= 7.0.2.2)
37
+ activesupport (= 7.0.2.2)
38
+ rack (~> 2.0, >= 2.2.0)
39
+ rack-test (>= 0.6.3)
40
+ rails-dom-testing (~> 2.0)
41
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
42
+ actiontext (7.0.2.2)
43
+ actionpack (= 7.0.2.2)
44
+ activerecord (= 7.0.2.2)
45
+ activestorage (= 7.0.2.2)
46
+ activesupport (= 7.0.2.2)
47
+ globalid (>= 0.6.0)
48
+ nokogiri (>= 1.8.5)
49
+ actionview (7.0.2.2)
50
+ activesupport (= 7.0.2.2)
51
+ builder (~> 3.1)
52
+ erubi (~> 1.4)
53
+ rails-dom-testing (~> 2.0)
54
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
55
+ activejob (7.0.2.2)
56
+ activesupport (= 7.0.2.2)
57
+ globalid (>= 0.3.6)
58
+ activemodel (7.0.2.2)
59
+ activesupport (= 7.0.2.2)
60
+ activerecord (7.0.2.2)
61
+ activemodel (= 7.0.2.2)
62
+ activesupport (= 7.0.2.2)
63
+ activestorage (7.0.2.2)
64
+ actionpack (= 7.0.2.2)
65
+ activejob (= 7.0.2.2)
66
+ activerecord (= 7.0.2.2)
67
+ activesupport (= 7.0.2.2)
68
+ marcel (~> 1.0)
69
+ mini_mime (>= 1.1.0)
70
+ activesupport (7.0.2.2)
71
+ concurrent-ruby (~> 1.0, >= 1.0.2)
72
+ i18n (>= 1.6, < 2)
73
+ minitest (>= 5.1)
74
+ tzinfo (~> 2.0)
75
+ ast (2.4.2)
76
+ builder (3.2.4)
77
+ concurrent-ruby (1.1.9)
78
+ crass (1.0.6)
79
+ diff-lcs (1.5.0)
80
+ digest (3.1.0)
81
+ erubi (1.10.0)
82
+ globalid (1.0.0)
83
+ activesupport (>= 5.0)
84
+ i18n (1.10.0)
85
+ concurrent-ruby (~> 1.0)
86
+ io-wait (0.2.1)
87
+ loofah (2.14.0)
88
+ crass (~> 1.0.2)
89
+ nokogiri (>= 1.5.9)
90
+ mail (2.7.1)
91
+ mini_mime (>= 0.1.1)
92
+ marcel (1.0.2)
93
+ method_source (1.0.0)
94
+ mini_mime (1.1.2)
95
+ minitest (5.15.0)
96
+ net-imap (0.2.3)
97
+ digest
98
+ net-protocol
99
+ strscan
100
+ net-pop (0.1.1)
101
+ digest
102
+ net-protocol
103
+ timeout
104
+ net-protocol (0.1.2)
105
+ io-wait
106
+ timeout
107
+ net-smtp (0.3.1)
108
+ digest
109
+ net-protocol
110
+ timeout
111
+ nio4r (2.5.8)
112
+ nokogiri (1.13.3-x86_64-darwin)
113
+ racc (~> 1.4)
114
+ parallel (1.21.0)
115
+ parser (3.1.1.0)
116
+ ast (~> 2.4.1)
117
+ racc (1.6.0)
118
+ rack (2.2.3)
119
+ rack-test (1.1.0)
120
+ rack (>= 1.0, < 3)
121
+ rails (7.0.2.2)
122
+ actioncable (= 7.0.2.2)
123
+ actionmailbox (= 7.0.2.2)
124
+ actionmailer (= 7.0.2.2)
125
+ actionpack (= 7.0.2.2)
126
+ actiontext (= 7.0.2.2)
127
+ actionview (= 7.0.2.2)
128
+ activejob (= 7.0.2.2)
129
+ activemodel (= 7.0.2.2)
130
+ activerecord (= 7.0.2.2)
131
+ activestorage (= 7.0.2.2)
132
+ activesupport (= 7.0.2.2)
133
+ bundler (>= 1.15.0)
134
+ railties (= 7.0.2.2)
135
+ rails-dom-testing (2.0.3)
136
+ activesupport (>= 4.2.0)
137
+ nokogiri (>= 1.6)
138
+ rails-html-sanitizer (1.4.2)
139
+ loofah (~> 2.3)
140
+ railties (7.0.2.2)
141
+ actionpack (= 7.0.2.2)
142
+ activesupport (= 7.0.2.2)
143
+ method_source
144
+ rake (>= 12.2)
145
+ thor (~> 1.0)
146
+ zeitwerk (~> 2.5)
147
+ rainbow (3.1.1)
148
+ rake (13.0.6)
149
+ regexp_parser (2.2.1)
150
+ rexml (3.2.5)
151
+ rspec (3.11.0)
152
+ rspec-core (~> 3.11.0)
153
+ rspec-expectations (~> 3.11.0)
154
+ rspec-mocks (~> 3.11.0)
155
+ rspec-core (3.11.0)
156
+ rspec-support (~> 3.11.0)
157
+ rspec-expectations (3.11.0)
158
+ diff-lcs (>= 1.2.0, < 2.0)
159
+ rspec-support (~> 3.11.0)
160
+ rspec-mocks (3.11.0)
161
+ diff-lcs (>= 1.2.0, < 2.0)
162
+ rspec-support (~> 3.11.0)
163
+ rspec-support (3.11.0)
164
+ rubocop (1.25.1)
165
+ parallel (~> 1.10)
166
+ parser (>= 3.1.0.0)
167
+ rainbow (>= 2.2.2, < 4.0)
168
+ regexp_parser (>= 1.8, < 3.0)
169
+ rexml
170
+ rubocop-ast (>= 1.15.1, < 2.0)
171
+ ruby-progressbar (~> 1.7)
172
+ unicode-display_width (>= 1.4.0, < 3.0)
173
+ rubocop-ast (1.16.0)
174
+ parser (>= 3.1.1.0)
175
+ ruby-progressbar (1.11.0)
176
+ strscan (3.0.1)
177
+ thor (1.2.1)
178
+ timeout (0.2.0)
179
+ tzinfo (2.0.4)
180
+ concurrent-ruby (~> 1.0)
181
+ unicode-display_width (2.1.0)
182
+ websocket-driver (0.7.5)
183
+ websocket-extensions (>= 0.1.0)
184
+ websocket-extensions (0.1.5)
185
+ zeitwerk (2.5.4)
186
+
187
+ PLATFORMS
188
+ x86_64-darwin-20
189
+
190
+ DEPENDENCIES
191
+ queues!
192
+ rake (~> 13.0)
193
+ rspec (~> 3.0)
194
+ rubocop (~> 1.21)
195
+
196
+ BUNDLED WITH
197
+ 2.3.7
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Lapo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Rails-Queues
2
+ ![](https://img.shields.io/static/v1?label=Language&message=Ruby&color=red)
3
+ ![](https://img.shields.io/static/v1?label=Latest&message=0.1.0.beta&color=blue)
4
+
5
+ A Rails implementation of Queues and Streams.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'queues'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ ## Usage
20
+
21
+ The gem acts as an orchestrator of Queues and Streamings for Rails applications.
22
+ It won't do much on its own, but it will be the main dependency for all supported frameworks.
23
+
24
+ ## Supported Frameworks
25
+
26
+ * [Rails-Queue Rabbit](https://github.com/LapoElisacci/queues-rabbit) - A RabbitMQ implementation framework
27
+
28
+ ## Contributing
29
+
30
+ Bug reports and pull requests are welcome on GitHub at https://github.com/LapoElisacci/queues.
31
+
32
+ ## License
33
+
34
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require 'rubocop/rake_task'
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rails/generators'
4
+
5
+ # Creates the Queues initializer file for Rails apps.
6
+ #
7
+ # @example Invokation from terminal
8
+ # rails generate queues
9
+ #
10
+ class QueuesGenerator < Rails::Generators::Base
11
+ desc "Description:\n This prepares Rails for Queues"
12
+
13
+ source_root File.expand_path('templates', __dir__)
14
+
15
+ desc 'Initialize Rails for Queues'
16
+
17
+ def generate_layout
18
+ template 'application_queue.rb', 'app/queues/application_queue.rb'
19
+ readme 'README'
20
+ end
21
+ end
@@ -0,0 +1,6 @@
1
+ ____ _ _ ___
2
+ | _ \ __ _(_) |___ / _ \ _ _ ___ _ _ ___ ___
3
+ | |_) / _` | | / __| | | | | | | |/ _ \ | | |/ _ \/ __|
4
+ | _ < (_| | | \__ \ | |_| | |_| | __/ |_| | __/\__ \
5
+ |_| \_\__,_|_|_|___/ \__\_\\__,_|\___|\__,_|\___||___/
6
+
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationQueue < Queues::API
4
+ # rabbit Rabbits::Schema, 'amqp://guest:guest@localhost'
5
+ end
data/lib/queues/api.rb ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Queues
4
+ class API
5
+ class << self
6
+ attr_accessor :rabbits
7
+
8
+ def rabbit(schema, host)
9
+ self.rabbits ||= []
10
+ self.rabbits << Queues::Rabbit.configure(schema, host)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Queues
4
+ VERSION = '0.1.0.beta'
5
+ end
data/lib/queues.rb ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'queues/api'
4
+ require_relative 'queues/version'
5
+
6
+ module Queues
7
+ class Error < StandardError; end
8
+ # Your code goes here...
9
+ end
data/sig/queues.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Queues
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: queues
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0.beta
5
+ platform: ruby
6
+ authors:
7
+ - Lapo
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '5'
27
+ description: ''
28
+ email:
29
+ - lapoelisacci@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".rspec"
35
+ - ".rubocop.yml"
36
+ - CHANGELOG.md
37
+ - Gemfile
38
+ - Gemfile.lock
39
+ - LICENSE.txt
40
+ - README.md
41
+ - Rakefile
42
+ - lib/generators/queues_generator.rb
43
+ - lib/generators/templates/README
44
+ - lib/generators/templates/application_queue.rb
45
+ - lib/queues.rb
46
+ - lib/queues/api.rb
47
+ - lib/queues/version.rb
48
+ - sig/queues.rbs
49
+ homepage: https://github.com/LapoElisacci/queues.git
50
+ licenses:
51
+ - MIT
52
+ metadata:
53
+ homepage_uri: https://github.com/LapoElisacci/queues.git
54
+ source_code_uri: https://github.com/LapoElisacci/queues.git
55
+ changelog_uri: https://github.com/LapoElisacci/queues/blob/main/CHANGELOG.md
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 2.6.0
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">"
68
+ - !ruby/object:Gem::Version
69
+ version: 1.3.1
70
+ requirements: []
71
+ rubygems_version: 3.2.22
72
+ signing_key:
73
+ specification_version: 4
74
+ summary: Rails implementation of Queues, for event-driver applications
75
+ test_files: []