ats-sdk 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +3 -0
- data/LICENSE +22 -0
- data/README.md +0 -0
- data/ats-sdk.gemspec +19 -0
- data/lib/ats/event.rb +17 -0
- data/lib/ats/version.rb +3 -0
- data/lib/ats-sdk.rb +22 -0
- metadata +64 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2cc57165dd92bd828b321a7527599fa9a4a8e923f614377df9adc4e0ba92e0e3
|
4
|
+
data.tar.gz: bd42dfdb04df86825c81546a01bfc4560b742e02b535f90461a48548c3d90f2e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b3bbcf30297abdc28977fae82b0885b02bf6c5832f2e4790d0001403cfbace0e610855e9a761bb0d0132cff60e8e39ed6100c814dc3ee8fdbc2be199c3610aba
|
7
|
+
data.tar.gz: cf4d5fe52daf290fc8232e8fd6af61e4b277fd9b875f3d0a001054a9195bd5ae6d9f6518162c7c94e6903c9048750bef0f92703ca5efdda71c1cd19a0ddcfbf3
|
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2020 Lokalise team, Ilya Bodrov
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
File without changes
|
data/ats-sdk.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'ats-sdk'
|
3
|
+
s.version = '1.0.0'
|
4
|
+
s.summary = "Ruby sdk for Entera's Activity Tracking System"
|
5
|
+
s.description = 'ATS tracks activities using the Event Grammar.'
|
6
|
+
s.authors = ['Carlos González']
|
7
|
+
s.email = 'carlosgonzalez@sudomafia.com'
|
8
|
+
s.homepage =
|
9
|
+
'https://rubygems.org/gems/ats-sdk'
|
10
|
+
s.license = 'MIT'
|
11
|
+
|
12
|
+
s.files = Dir['README.md', 'LICENSE',
|
13
|
+
'CHANGELOG.md', 'lib/**/*.rb',
|
14
|
+
'lib/**/*.rake',
|
15
|
+
'ats-sdk.gemspec', '.github/*.md',
|
16
|
+
'Gemfile', 'Rakefile']
|
17
|
+
|
18
|
+
s.add_dependency 'aws-sdk-sns', '~> 1.53.0'
|
19
|
+
end
|
data/lib/ats/event.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module ATS
|
2
|
+
class Event
|
3
|
+
def self.create(params = {})
|
4
|
+
sns = Aws::SNS::Resource.new(region: ATS.region)
|
5
|
+
topic = sns.topic(ATS.topic)
|
6
|
+
event = {
|
7
|
+
id: SecureRandom.uuid,
|
8
|
+
version: "v1",
|
9
|
+
client_timestamp: DateTime.now.to_s
|
10
|
+
}
|
11
|
+
|
12
|
+
event.merge!(params)
|
13
|
+
|
14
|
+
topic.publish({ message: JSON.generate(event) })
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/ats/version.rb
ADDED
data/lib/ats-sdk.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'aws-sdk-sns'
|
2
|
+
require 'securerandom'
|
3
|
+
require 'json'
|
4
|
+
require 'date'
|
5
|
+
|
6
|
+
require_relative 'ats/version'
|
7
|
+
require_relative 'ats/event'
|
8
|
+
|
9
|
+
module ATS
|
10
|
+
class << self
|
11
|
+
attr_accessor :topic
|
12
|
+
attr_writer :region
|
13
|
+
|
14
|
+
def configure
|
15
|
+
yield self
|
16
|
+
end
|
17
|
+
|
18
|
+
def region
|
19
|
+
@region || 'us-east-1'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ats-sdk
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Carlos González
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-06-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: aws-sdk-sns
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.53.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.53.0
|
27
|
+
description: ATS tracks activities using the Event Grammar.
|
28
|
+
email: carlosgonzalez@sudomafia.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- CHANGELOG.md
|
34
|
+
- Gemfile
|
35
|
+
- LICENSE
|
36
|
+
- README.md
|
37
|
+
- ats-sdk.gemspec
|
38
|
+
- lib/ats-sdk.rb
|
39
|
+
- lib/ats/event.rb
|
40
|
+
- lib/ats/version.rb
|
41
|
+
homepage: https://rubygems.org/gems/ats-sdk
|
42
|
+
licenses:
|
43
|
+
- MIT
|
44
|
+
metadata: {}
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
requirements: []
|
60
|
+
rubygems_version: 3.1.4
|
61
|
+
signing_key:
|
62
|
+
specification_version: 4
|
63
|
+
summary: Ruby sdk for Entera's Activity Tracking System
|
64
|
+
test_files: []
|