cyclone_lariat 0.3.8 → 0.3.9
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +13 -0
- data/lib/cyclone_lariat/abstract/client.rb +15 -8
- data/lib/cyclone_lariat/configure.rb +14 -0
- data/lib/cyclone_lariat/version.rb +1 -1
- data/lib/cyclone_lariat.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e81df0b814b28eff97a38a58e1d3573ef09efc594242da8b9768ed781eb1f989
|
4
|
+
data.tar.gz: ef8441b399c937518506bacc0514a1fbb68cde9c0d92e99d619edf3bfaee9611
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 216f064daa35c0eb8599b368364ee116c0184e1ee7bd2ad94e39b06ce324d5f958c21fca460f2b368db34fcca287bb23db34af03c14718a676618213765ca150
|
7
|
+
data.tar.gz: 947a143ea181f60a450dba792091f3a122c88d6929638272292370bbaa8a5fe0270ecf6ad4d3ba01b560660478987dc9388879327100efa8426717be9cf75b9a
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.3.8] - 2022-09-05
|
8
|
+
Added
|
9
|
+
- Added configuration options see README.md
|
10
|
+
|
7
11
|
## [0.3.8] - 2022-09-05
|
8
12
|
Changed
|
9
13
|
- Added pagination to sns topics list for receiving all topics
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -34,6 +34,19 @@ name where the change took place plus the verb past-participle. An event happens
|
|
34
34
|
A command can emit any number of events. The sender of the event does not care who receives it or whether it has been
|
35
35
|
received at all.
|
36
36
|
|
37
|
+
## Configure
|
38
|
+
```ruby
|
39
|
+
# 'config/initializers/cyclone_lariat.rb'
|
40
|
+
CycloneLariat.tap do |cl|
|
41
|
+
cl.default_version = 1 # api version default is 1
|
42
|
+
cl.key = # aws key
|
43
|
+
cl.secret_key = # aws secret
|
44
|
+
cl.default_region = # aws default region
|
45
|
+
cl.publisher = 'auth' # name of your publishers, usually name of your application
|
46
|
+
cl.default_instance = APP_INSTANCE # stage, production, test
|
47
|
+
end
|
48
|
+
```
|
49
|
+
|
37
50
|
## SnsClient
|
38
51
|
You can use client directly
|
39
52
|
|
@@ -14,9 +14,6 @@ module CycloneLariat
|
|
14
14
|
dependency(:aws_client_class) { raise ArgumentError, 'Client class should be defined' }
|
15
15
|
dependency(:aws_credentials_class) { Aws::Credentials }
|
16
16
|
|
17
|
-
DEFAULT_VERSION = 1
|
18
|
-
DEFAULT_INSTANCE = :prod
|
19
|
-
|
20
17
|
def initialize(key:, secret_key:, region:, version: nil, publisher: nil, instance: nil)
|
21
18
|
@key = key
|
22
19
|
@secret_key = secret_key
|
@@ -54,15 +51,15 @@ module CycloneLariat
|
|
54
51
|
|
55
52
|
class << self
|
56
53
|
def version(version = nil)
|
57
|
-
version.nil? ? @version ||
|
54
|
+
version.nil? ? @version || CycloneLariat.default_version : @version = version
|
58
55
|
end
|
59
56
|
|
60
57
|
def instance(instance = nil)
|
61
|
-
instance.nil? ? @instance ||
|
58
|
+
instance.nil? ? @instance || CycloneLariat.default_instance || (raise 'You should define instance') : @instance = instance
|
62
59
|
end
|
63
60
|
|
64
61
|
def publisher(publisher = nil)
|
65
|
-
publisher.nil? ? @publisher || (raise 'You should define publisher') : @publisher = publisher
|
62
|
+
publisher.nil? ? @publisher || CycloneLariat.publisher || (raise 'You should define publisher') : @publisher = publisher
|
66
63
|
end
|
67
64
|
end
|
68
65
|
|
@@ -78,9 +75,19 @@ module CycloneLariat
|
|
78
75
|
@instance ||= self.class.instance
|
79
76
|
end
|
80
77
|
|
81
|
-
|
78
|
+
def key
|
79
|
+
@key ||= CycloneLariat.key
|
80
|
+
end
|
81
|
+
|
82
|
+
def secret_key
|
83
|
+
@secret_key ||= CycloneLariat.secret_key
|
84
|
+
end
|
85
|
+
|
86
|
+
def region
|
87
|
+
@region ||= CycloneLariat.default_region
|
88
|
+
end
|
82
89
|
|
83
|
-
|
90
|
+
private
|
84
91
|
|
85
92
|
def aws_client
|
86
93
|
@aws_client ||= aws_client_class.new(credentials: aws_credentials, region: region)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CycloneLariat
|
4
|
+
class << self
|
5
|
+
DEFAULT_VERSION = 1
|
6
|
+
|
7
|
+
attr_accessor :key, :secret_key, :publisher, :default_region, :default_instance
|
8
|
+
attr_writer :default_version
|
9
|
+
|
10
|
+
def default_version
|
11
|
+
@default_version ||= DEFAULT_VERSION
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/cyclone_lariat.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cyclone_lariat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kudrin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-10-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk-sns
|
@@ -269,6 +269,7 @@ files:
|
|
269
269
|
- lib/cyclone_lariat/abstract/client.rb
|
270
270
|
- lib/cyclone_lariat/abstract/message.rb
|
271
271
|
- lib/cyclone_lariat/command.rb
|
272
|
+
- lib/cyclone_lariat/configure.rb
|
272
273
|
- lib/cyclone_lariat/errors.rb
|
273
274
|
- lib/cyclone_lariat/event.rb
|
274
275
|
- lib/cyclone_lariat/list_topics_store.rb
|