wolf_core 0.1.79 → 0.1.81

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c473b8e90d8d68a02e1efb3750f5a9af41eed306f68054496d26fbe769e5640
4
- data.tar.gz: 8e362026d5c23766d664b29cc30e51910a7259862ae26bdb9b117ebc6df30de6
3
+ metadata.gz: 4d8f5848e0da080deb068e1249aa74d70f8c87d247708a0a8d0ea1a696969126
4
+ data.tar.gz: d00831a1455a158cc7faeb8399e88ab1271c4835a34b2ebd99445c3b37dc0abe
5
5
  SHA512:
6
- metadata.gz: 46d05456586f91a6badea88c0118fb776a7098d7382882f7fe7fe591e5c62d90cb7284b25942eb75d45f845ab1eb06d825e339b0fabd842114cf02267492daa3
7
- data.tar.gz: 5eada455445f5d9207113dccbd6252e444e48ae0c1f458d9c9cbc7d0c13d061f8e1d05331104de0fc1389278c7f5eb771a22b17ec06bd49da9649af2519d07ba
6
+ metadata.gz: 78598feba5aa74437332e0bc8a7b09781a1bafbb0751b2911a6580a08544e28dd06c79ff6f8ae6e01f279115a96b3eb6e3c1f78e4cbfbdcc2092378a00f6fc67
7
+ data.tar.gz: 2c8d15ebb467c97fd2f471e031e2dad412025bd40947e4cb097c77ef83b16c9c0d7d13b979bb31f7617c34f0c6835f0cb89a47f5a09e79dfd259778133a267cf
@@ -3,7 +3,7 @@ module WolfCore
3
3
  module_function
4
4
 
5
5
  def init
6
- @@redis = Redis.new(host: ENV['REDIS_ENDPOINT'], port: ENV['REDIS_PORT'].to_i)
6
+ @@redis = Redis.new(host: ENV['REDIS_ENDPOINT'])
7
7
  end
8
8
 
9
9
  def instance
@@ -0,0 +1,27 @@
1
+ module WolfCore
2
+ module NoSqlDbDataSource
3
+ module_function
4
+
5
+ def init(region: 'us-east-1')
6
+ @@dynamodb_client ||= Aws::DynamoDB::Client.new(region: region)
7
+ end
8
+
9
+ def instance
10
+ @@dynamodb_client
11
+ end
12
+
13
+ def put_item(table_name:, item:)
14
+ instance.put_item({
15
+ table_name: table_name,
16
+ item: item
17
+ })
18
+ end
19
+
20
+ def get_item(table_name:, key:)
21
+ instance.get_item({
22
+ table_name: table_name,
23
+ key: key
24
+ }).item
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,17 @@
1
+ module WolfCore
2
+ module NoSqlDbOperations
3
+ def put_no_sql_item(table_name:, item:)
4
+ WolfCore::NoSqlDbDataSource.put_item(
5
+ table_name: table_name,
6
+ item: item,
7
+ )
8
+ end
9
+
10
+ def get_no_sql_item(table_name:, key:)
11
+ WolfCore::NoSqlDbDataSource.get_item(
12
+ table_name: table_name,
13
+ key: key,
14
+ )
15
+ end
16
+ end
17
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "0.1.79"
4
+ VERSION = "0.1.81"
5
5
  end
data/lib/wolf_core.rb CHANGED
@@ -7,6 +7,7 @@ require 'active_support'
7
7
  require 'active_support/core_ext'
8
8
  require 'aws-sdk-lambda'
9
9
  require 'redis'
10
+ require 'aws-sdk-dynamodb'
10
11
 
11
12
  module WolfCore; end
12
13
 
@@ -14,4 +15,5 @@ require 'wolf_core/utils/file_utils'
14
15
 
15
16
  WolfCore::FileUtils.require_relative_folder(__dir__, 'wolf_core')
16
17
  WolfCore::LambdaFunctionDataSource.init
17
- WolfCore::InMemoryStorageDataSource.init
18
+ WolfCore::InMemoryStorageDataSource.init
19
+ WolfCore::NoSqlDbDataSource.init
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolf_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.79
4
+ version: 0.1.81
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-26 00:00:00.000000000 Z
11
+ date: 2024-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: aws-sdk-dynamodb
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: Repository to store shared code among Ruby projects.
70
84
  email:
71
85
  - jroncallo96@gmail.com
@@ -88,6 +102,8 @@ files:
88
102
  - lib/wolf_core/infrastructure/in_memory_storage_operations.rb
89
103
  - lib/wolf_core/infrastructure/lambda_function_data_source.rb
90
104
  - lib/wolf_core/infrastructure/lambda_function_operations.rb
105
+ - lib/wolf_core/infrastructure/no_sql_db_data_source.rb
106
+ - lib/wolf_core/infrastructure/no_sql_db_operations.rb
91
107
  - lib/wolf_core/utils/array_utils.rb
92
108
  - lib/wolf_core/utils/async_utils.rb
93
109
  - lib/wolf_core/utils/file_utils.rb
@@ -117,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
133
  - !ruby/object:Gem::Version
118
134
  version: '0'
119
135
  requirements: []
120
- rubygems_version: 3.5.14
136
+ rubygems_version: 3.5.18
121
137
  signing_key:
122
138
  specification_version: 4
123
139
  summary: Repository to store shared code among Ruby projects.