lmb-developers 1.2.2 → 1.2.3
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/.devcontainer/Dockerfile +20 -0
- data/.devcontainer/devcontainer.json +33 -0
- data/README.md +4 -0
- data/lib/lmb/developers/loyalty.rb +17 -19
- data/lmb-developers.gemspec +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9466a7817868f2c4a29301a99f34a881575fd1eb52559b087c6520136cd293cf
|
4
|
+
data.tar.gz: be1c41758fcd5f3568a1451f60a4d70a52e2decf1fbce9946ea37d41faf50b35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28801e5ec6aadc1cff1e83a0c9d51b35b22a68328f060c7ca862ef0b235c49aba5c6ce5932de5c36739c1f49bc197d232b221fc928825fe162e346fd1097677c
|
7
|
+
data.tar.gz: 479438e0752923d95162d094e0f59e24f5a3415213355f51d75fcb4e471276cf6e6fa7ae45c078fb870578db1ca281a1fd8908c1d3f235fc2104b9bc23729015
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/ruby/.devcontainer/base.Dockerfile
|
2
|
+
|
3
|
+
# [Choice] Ruby version: 3, 3.0, 2, 2.7, 2.6
|
4
|
+
ARG VARIANT="3.0"
|
5
|
+
FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT}
|
6
|
+
|
7
|
+
# [Option] Install Node.js
|
8
|
+
ARG INSTALL_NODE="true"
|
9
|
+
ARG NODE_VERSION="lts/*"
|
10
|
+
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
|
11
|
+
|
12
|
+
# [Optional] Uncomment this section to install additional OS packages.
|
13
|
+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
14
|
+
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
15
|
+
|
16
|
+
# [Optional] Uncomment this line to install additional gems.
|
17
|
+
# RUN gem install <your-gem-names-here>
|
18
|
+
|
19
|
+
# [Optional] Uncomment this line to install global node packages.
|
20
|
+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
|
@@ -0,0 +1,33 @@
|
|
1
|
+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
2
|
+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/ruby
|
3
|
+
{
|
4
|
+
"name": "Ruby",
|
5
|
+
"build": {
|
6
|
+
"dockerfile": "Dockerfile",
|
7
|
+
"args": {
|
8
|
+
// Update 'VARIANT' to pick a Ruby version: 3, 3.0, 2, 2.7, 2.6
|
9
|
+
"VARIANT": "3",
|
10
|
+
// Options
|
11
|
+
"INSTALL_NODE": "false",
|
12
|
+
"NODE_VERSION": "lts/*"
|
13
|
+
}
|
14
|
+
},
|
15
|
+
|
16
|
+
// Set *default* container specific settings.json values on container create.
|
17
|
+
"settings": {},
|
18
|
+
|
19
|
+
// Add the IDs of extensions you want installed when the container is created.
|
20
|
+
"extensions": [
|
21
|
+
"rebornix.Ruby"
|
22
|
+
],
|
23
|
+
|
24
|
+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
25
|
+
// "forwardPorts": [],
|
26
|
+
|
27
|
+
// Use 'postCreateCommand' to run commands after the container is created.
|
28
|
+
// "postCreateCommand": "ruby --version",
|
29
|
+
|
30
|
+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
31
|
+
"remoteUser": "vscode"
|
32
|
+
|
33
|
+
}
|
data/README.md
CHANGED
@@ -26,6 +26,10 @@ Or install it yourself as:
|
|
26
26
|
|
27
27
|
### Configuration
|
28
28
|
|
29
|
+
To use the terminal use the following command:
|
30
|
+
|
31
|
+
$ irb -Ilib -rlmb/developers
|
32
|
+
|
29
33
|
```ruby
|
30
34
|
|
31
35
|
# Pass environment and api_key to configure. Note: Use ENV variables to protect data in production environment
|
@@ -7,7 +7,7 @@ module Lmb
|
|
7
7
|
VOUCHER_EXPIRED_PATH = '/v1/loyalty/voucher/expired'.freeze
|
8
8
|
VOUCHER_PROVISIONED_PATH = '/v1/loyalty/voucher/provisioned'.freeze
|
9
9
|
VOUCHER_ACTIVATED_PATH = '/v1/loyalty/voucher/activated'.freeze
|
10
|
-
|
10
|
+
SCORING_REDEMPTION_PATH = '/v1/loyalty/redemption'.freeze
|
11
11
|
|
12
12
|
# Set Inhabitant's Expired Vouchers.
|
13
13
|
#
|
@@ -83,24 +83,22 @@ module Lmb
|
|
83
83
|
@configuration = Lmb::Developers.configuration
|
84
84
|
end
|
85
85
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
# exception
|
103
|
-
# end
|
86
|
+
def self.redemption(redemptions)
|
87
|
+
uri = URI.parse("#{configuration.url}#{SCORING_REDEMPTION_PATH}")
|
88
|
+
request = Net::HTTP::Post.new(uri)
|
89
|
+
request['Apikey'] = configuration.api_key.to_s
|
90
|
+
request['Cache-Control'] = 'no-cache'
|
91
|
+
request.body = redemptions
|
92
|
+
req_options = {
|
93
|
+
use_ssl: uri.scheme == 'https'
|
94
|
+
}
|
95
|
+
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
|
96
|
+
http.request(request)
|
97
|
+
end
|
98
|
+
response.code.to_i == 202
|
99
|
+
rescue StandardError => exception
|
100
|
+
exception
|
101
|
+
end
|
104
102
|
end
|
105
103
|
end
|
106
104
|
end
|
data/lmb-developers.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'lmb-developers'
|
3
|
-
s.version = '1.2.
|
3
|
+
s.version = '1.2.3'
|
4
4
|
s.date = '2019-05-19'
|
5
5
|
s.summary = "Consume APIs at Leroy Merlin Brazil Developer's Portal"
|
6
6
|
s.description = "Gem to consume APIs available at Leroy Merlin Brazil Developer's Portal https://developers.leroymerlin.com.br"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lmb-developers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PRTE - Tecnologia e Soluções
|
@@ -17,6 +17,8 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- ".devcontainer/Dockerfile"
|
21
|
+
- ".devcontainer/devcontainer.json"
|
20
22
|
- ".gitignore"
|
21
23
|
- README.md
|
22
24
|
- Rakefile
|