karaden-prg-ruby 1.2.0 → 1.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfe820d3c3ca917f78dba55fb51e0b3d04bcc9e6e133bde0d18927aeb10ec72b
4
- data.tar.gz: e88f8c518f8ac08582b5c4f8a946eb04eaf03b2ca82e5ee05ba923d502e4ab27
3
+ metadata.gz: 7b6eadc4a71ffb028555269758d495cbbd55d64acbf1dd56c866b6d526bad89d
4
+ data.tar.gz: c792f6b657fd7df4debafc7d100f55078c10f93a5886f56f03e843611e244343
5
5
  SHA512:
6
- metadata.gz: 9bb1d1e16c9054c99f73f037551a2c474175997980bb1e4ec1868a51e889eb467b525a666d4355e4b4a543058754aa201b455b2eec7a487b4e46f007554b42bb
7
- data.tar.gz: 0ebbe2c04fa715e0aec8a9d07fc4958e4f7915790f87a92d9ab59485764ec6e8a1c583a2d54ba5c7538baa6bbf9789925a98b522a391bbec6e872c566e66e2ff
6
+ metadata.gz: ffa33a4af4af490f9a9f29d5020f1fe22dcd4cff19a469b07303e18ec7fa6d879f7e0ce17a4b8bfb4510adf2823c704962460506c08d2bee63ec609f3bb481ee
7
+ data.tar.gz: 248a813af69630da1243dc2b11989ecce62eff9cdbf5c1ead7552f23cce911fbd5f4eb4d26282f226298643c503e6d5f30d99e91c1e97a3027cd93db8afd5bdd
@@ -1,45 +1,38 @@
1
1
  // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
2
  // README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3
3
  {
4
- "name": "ruby-sdk",
5
- // Sets the run context to one level up instead of the .devcontainer folder.
6
- "dockerComposeFile": [
7
- "docker-compose.yml"
8
- ],
9
- "service": "ruby",
4
+ "name": "ruby-sdk",
5
+ // Sets the run context to one level up instead of the .devcontainer folder.
6
+ "dockerComposeFile": [
7
+ "docker-compose.yml"
8
+ ],
9
+ "service": "ruby",
10
10
  "workspaceFolder": "/var/task",
11
- "settings": {
12
- "editor.detectIndentation": false,
13
- "editor.tabSize": 2,
14
- "ruby.lint": {
15
- "rubocop": true
16
- },
17
- "ruby.useLanguageServer": true,
18
- "ruby.intellisense": "rubyLocate"
19
- },
20
- "extensions": [
21
- "misogi.ruby-rubocop",
22
- "humao.rest-client",
23
- "koichisasada.vscode-rdbg",
24
- "rebornix.ruby"
25
- ],
26
- // "name": "Ruby",
27
- // // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
28
- // "image": "mcr.microsoft.com/devcontainers/ruby:0-3-bullseye",
29
- "features": {
30
- "ghcr.io/devcontainers/features/ruby:1": {
31
- //"version": "latest",
32
- "version": "3.0"
33
- }
34
- }
35
- // Features to add to the dev container. More info: https://containers.dev/features.
36
- // "features": {},
37
- // Use 'forwardPorts' to make a list of ports inside the container available locally.
38
- // "forwardPorts": [],
39
- // Use 'postCreateCommand' to run commands after the container is created.
40
- // "postCreateCommand": "ruby --version",
41
- // Configure tool-specific properties.
42
- // "customizations": {},
43
- // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
44
- // "remoteUser": "root"
11
+ "customizations": {
12
+ "vscode": {
13
+ "settings": {
14
+ "[ruby]": {
15
+ "editor.defaultFormatter": "Shopify.ruby-lsp",
16
+ "editor.formatOnSave": true,
17
+ "editor.tabSize": 2,
18
+ "editor.insertSpaces": true,
19
+ "editor.semanticHighlighting.enabled": true,
20
+ "editor.formatOnType": true
21
+ }
22
+ },
23
+ "extensions": [
24
+ "Shopify.ruby-extensions-pack",
25
+ "humao.rest-client"
26
+ ]
27
+ }
28
+ },
29
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
30
+ //"forwardPorts": [8080]
31
+
32
+ // Use 'postCreateCommand' to run commands after the container is created.
33
+ // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html"
34
+ "initializeCommand": "cd .devcontainer && sh lifecycle/initialize-command.sh",
35
+
36
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
37
+ "remoteUser": "nttcoms"
45
38
  }
@@ -1,17 +1,19 @@
1
- FROM mcr.microsoft.com/devcontainers/ruby:0-3-bullseye
1
+ FROM ruby:3.0.6
2
2
 
3
- ARG USERNAME=${USERNAME}
4
- ARG USER_UID=${USER_UID}
5
- ARG USER_GID=${USER_GID}
6
- ARG TIME_ZONE=${TIME_ZONE}
7
- ARG LOCALE=${LOCALE}
3
+ ARG USERNAME
4
+ ARG USER_UID
5
+ ARG USER_GID
6
+ ARG TIME_ZONE
7
+ ARG LOCALE
8
+ ARG WORKING_DIR
8
9
 
9
10
  ENV LANG=${LOCALE}
10
- ENV LANGUAGE=${LANGUAGE}
11
11
  ENV TZ=${TIME_ZONE}
12
12
 
13
13
  RUN apt-get update \
14
- && apt-get install -y locales \
14
+ && apt-get install -y sudo git
15
+
16
+ RUN apt-get install -y locales \
15
17
  && locale-gen ja_JP.UTF-8 \
16
18
  && localedef -f UTF-8 -i ja_JP ja_JP.UTF-8 \
17
19
  && update-locale LANG=ja_JP.UTF-8
@@ -19,12 +21,19 @@ RUN apt-get update \
19
21
  RUN ln -snf /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime \
20
22
  && echo ${TIME_ZONE} > /etc/timezone
21
23
 
24
+ RUN /usr/sbin/groupadd --gid ${USER_GID} ${USERNAME} \
25
+ && /usr/sbin/useradd -s /bin/bash --uid ${USER_UID} --gid ${USER_GID} -m ${USERNAME} \
26
+ && echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} \
27
+ && chmod 0440 /etc/sudoers.d/${USERNAME}
28
+
22
29
  USER ${USER_UID}
23
30
 
24
31
  RUN curl https://get.volta.sh | bash
25
32
 
26
- RUN echo -n "\n\
27
- LANG="${LANG}"\n\
28
- LANGUAGE="${LANGUAGE}"\n\
29
- LC_ALL="${LOCALE}"\n\
33
+ RUN /bin/echo -e "\n\
34
+ LANG=\"${LANG}\"\n\
35
+ LC_ALL=\"${LOCALE}\"\n\
30
36
  " >> ~/.bashrc
37
+
38
+ RUN sudo rm -rf /var/task \
39
+ && sudo ln -s ${WORKING_DIR} /var/task
@@ -10,7 +10,8 @@ services:
10
10
  USER_GID: ${USER_GID-1000}
11
11
  TIME_ZONE: ${TIME_ZONE-UTC}
12
12
  LOCALE: ${LOCALE-C}
13
+ WORKING_DIR: ${WORKING_DIR}
13
14
  tty: true
14
15
  volumes:
15
- - ../:/var/task
16
- working_dir: /var/task
16
+ - ../:${WORKING_DIR}
17
+ working_dir: ${WORKING_DIR}
@@ -0,0 +1,6 @@
1
+ #!/bin/bash -eu
2
+
3
+ echo "USERNAME=${USER}\n\
4
+ LOCALE=ja_JP.UTF-8\n\
5
+ TIME_ZONE=Asia/Tokyo\n\
6
+ WORKING_DIR=$(realpath `pwd`/..)" > .env
data/.rubocop.yml CHANGED
@@ -1,3 +1,8 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.0
3
+ Style/StringLiterals:
4
+ Enabled: false
5
+
1
6
  Style/FrozenStringLiteralComment:
2
7
  Enabled: false
3
8
  Style/Documentation:
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 NTTCom Online Marketing Solutions Corporation
3
+ Copyright (c) NTT DOCOMO BUSINESS X, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  module Karaden
2
2
  class Config
3
- VERSION = '1.2.0'.freeze
3
+ VERSION = '1.2.1'.freeze
4
4
  DEFAULT_API_BASE = 'https://prg.karaden.jp/api'.freeze
5
5
  DEFALUT_API_VERSION = '2024-03-01'.freeze
6
6
 
@@ -3,7 +3,7 @@ module Karaden
3
3
  class Requestor < RequestorInterface
4
4
  DEFAULT_USER_AGENT = 'Karaden/Ruby/'.freeze
5
5
 
6
- def send(method, path, content_type = nil, params = nil, data = nil, request_options = nil, is_no_contents = false)
6
+ def send(method, path, content_type = nil, params = nil, data = nil, request_options = nil, is_no_contents: false)
7
7
  request_options = Karaden::RequestOptions.new if request_options.nil?
8
8
  options = Karaden::Config.as_request_options.merge(request_options).validate
9
9
  headers = {
@@ -11,7 +11,7 @@ module Karaden
11
11
  'Karaden-Client-User-Agent': build_client_user_agent,
12
12
  'Karaden-Version' => options.api_version,
13
13
  'Content-Type': content_type,
14
- 'Authorization': build_authorization(options),
14
+ 'Authorization': build_authorization(options)
15
15
  }
16
16
 
17
17
  uri = URI.parse(build_http_url(path, params, options))
@@ -1,7 +1,7 @@
1
1
  module Karaden
2
2
  module Net
3
3
  class RequestorInterface
4
- def send(method, path, content_type = nil, params = nil, data = nil, request_options = nil, is_no_contents = false)
4
+ def send(method, path, content_type = nil, params = nil, data = nil, request_options = nil, is_no_contents: false)
5
5
  raise NotImplementedError
6
6
  end
7
7
  end
@@ -76,4 +76,3 @@ module Karaden
76
76
  end
77
77
  end
78
78
  end
79
-
@@ -22,33 +22,20 @@ module Karaden
22
22
 
23
23
  def validate
24
24
  errors = Karaden::Model::KaradenObject.new
25
- has_error = false
26
25
 
27
26
  messages = validate_id
28
- unless messages.empty?
29
- errors.set_property('id', messages)
30
- has_error = true
31
- end
27
+ errors.set_property('id', messages) unless messages.empty?
32
28
 
33
29
  messages = validate_directory_path
34
- unless messages.empty?
35
- errors.set_property('directory_path', messages)
36
- has_error = true
37
- end
30
+ errors.set_property('directory_path', messages) unless messages.empty?
38
31
 
39
32
  messages = validate_max_retries
40
- unless messages.empty?
41
- errors.set_property('max_retries', messages)
42
- has_error = true
43
- end
33
+ errors.set_property('max_retries', messages) unless messages.empty?
44
34
 
45
35
  messages = validate_retry_interval
46
- unless messages.empty?
47
- errors.set_property('retry_interval', messages)
48
- has_error = true
49
- end
36
+ errors.set_property('retry_interval', messages) unless messages.empty?
50
37
 
51
- if has_error
38
+ unless errors.property_keys.filter { |key| !errors.property(key).nil? }.empty?
52
39
  e = Karaden::Exception::InvalidParamsException.new
53
40
  error = Karaden::Model::Error.new
54
41
  error.set_property('object', Karaden::Model::Error::OBJECT_NAME)
@@ -27,33 +27,20 @@ module Karaden
27
27
 
28
28
  def validate
29
29
  errors = Karaden::Model::KaradenObject.new
30
- has_error = false
31
30
 
32
31
  messages = validate_api_base
33
- unless messages.empty?
34
- errors.set_property('api_base', messages)
35
- has_error = true
36
- end
32
+ errors.set_property('api_base', messages) unless messages.empty?
37
33
 
38
34
  messages = validate_api_key
39
- unless messages.empty?
40
- errors.set_property('api_key', messages)
41
- has_error = true
42
- end
35
+ errors.set_property('api_key', messages) unless messages.empty?
43
36
 
44
37
  messages = validate_api_version
45
- unless messages.empty?
46
- errors.set_property('api_version', messages)
47
- has_error = true
48
- end
38
+ errors.set_property('api_version', messages) unless messages.empty?
49
39
 
50
40
  messages = validate_tenant_id
51
- unless messages.empty?
52
- errors.set_property('tenant_id', messages)
53
- has_error = true
54
- end
41
+ errors.set_property('tenant_id', messages) unless messages.empty?
55
42
 
56
- if has_error
43
+ unless errors.property_keys.filter { |key| !errors.property(key).nil? }.empty?
57
44
  e = Karaden::Exception::InvalidRequestOptionsException.new
58
45
  error = Karaden::Model::Error.new
59
46
  error.set_property('object', Karaden::Model::Error::OBJECT_NAME)
@@ -1,7 +1,7 @@
1
1
  module Karaden
2
2
  module Service
3
3
  class BulkMessageService
4
- REGEX_PATTERN = /filename="([^"]+)"/.freeze
4
+ REGEX_PATTERN = /filename="([^"]+)"/
5
5
 
6
6
  def self.create(filename, request_options = nil)
7
7
  raise Karaden::Exception::FileNotFoundException unless File.file?(filename)
@@ -58,9 +58,9 @@ module Karaden
58
58
  true
59
59
  end
60
60
 
61
- def self.check_bulk_message_status(retry_count, retry_interval, params, request_options)
61
+ def self.check_bulk_message_status(retry_count, _retry_interval, params, request_options)
62
62
  result = false
63
- (0..retry_count).each do |count|
63
+ (0..retry_count).each do |_count|
64
64
  # sleep retry_interval if count.positive?
65
65
  bulk_message = Karaden::Model::BulkMessage.show(params, request_options)
66
66
  raise Exception::BulkMessageCreateFailedException if bulk_message.status == Karaden::Model::BulkMessage::STATUS_ERROR
@@ -73,9 +73,9 @@ module Karaden
73
73
  result
74
74
  end
75
75
 
76
- def self.get_download_url(retry_count, retry_interval, params, request_options)
76
+ def self.get_download_url(retry_count, _retry_interval, params, request_options)
77
77
  result = nil
78
- (0..retry_count).each do |count|
78
+ (0..retry_count).each do |_count|
79
79
  # sleep retry_interval if count.positive?
80
80
  output = Karaden::Model::BulkMessage.list_message(params, request_options)
81
81
  unless output.nil?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karaden-prg-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - cpaas-dev-admin-om
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-23 00:00:00.000000000 Z
11
+ date: 2026-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -100,7 +100,7 @@ dependencies:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
- description:
103
+ description:
104
104
  email:
105
105
  - cpaas-dev-admin-om@nttcoms.com
106
106
  executables: []
@@ -110,6 +110,7 @@ files:
110
110
  - ".devcontainer/devcontainer.json"
111
111
  - ".devcontainer/docker-compose.yml"
112
112
  - ".devcontainer/docker/ruby/Dockerfile"
113
+ - ".devcontainer/lifecycle/initialize-command.sh"
113
114
  - ".rspec"
114
115
  - ".rubocop.yml"
115
116
  - ".vscode/launch.json"
@@ -174,7 +175,7 @@ licenses:
174
175
  metadata:
175
176
  homepage_uri: https://github.com/karaden-prg/karaden-prg-ruby
176
177
  source_code_uri: https://github.com/karaden-prg/karaden-prg-ruby
177
- post_install_message:
178
+ post_install_message:
178
179
  rdoc_options: []
179
180
  require_paths:
180
181
  - lib
@@ -190,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
191
  version: '0'
191
192
  requirements: []
192
193
  rubygems_version: 3.2.33
193
- signing_key:
194
+ signing_key:
194
195
  specification_version: 4
195
196
  summary: Ruby library for the Karaden API.
196
197
  test_files: []