json_api_toolbox 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.version +1 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +17 -15
- data/bin/docker +61 -0
- data/bin/setup.sh +12 -9
- data/bitbucket-pipelines.yml +3 -5
- data/lib/json_api_toolbox/rspec.rb +0 -2
- data/lib/json_api_toolbox/version.rb +1 -1
- data/lib/postable.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07cee6578d3ec72b85799bb88a7b8f0fee45c63950516209dca50d65ee0d4bcb
|
4
|
+
data.tar.gz: 9e6171341031bba7809a8337256d882e05ee5b11095bedd58e2f7ff2f62000d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24ab8d780ec3b8a21ace2100b29c8f60593bc01cef3f23dbe81a6d3993687aa7c3a93a22dd6e04c9647de17b62f693452c8e7b1a40941d191459879f89342c35
|
7
|
+
data.tar.gz: 5aa57f37c3c11b462755ab90a3d85986ade02bdbb9d1d5a78a3f6ac5df025f5ee73eeb23ba9011277ace4a3a3742626a516ef8d62573976156d30cdc50bec496
|
data/.version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.0.1
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [2.0.1] - 2021-08-13
|
10
|
+
### Fixed
|
11
|
+
- Fixed a constant loading problem on rails
|
12
|
+
|
9
13
|
## [2.0.0] - 2021-06-23
|
10
14
|
### Added
|
11
15
|
- New README file describing the gem and it's uses
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
json_api_toolbox (2.0.
|
4
|
+
json_api_toolbox (2.0.1)
|
5
5
|
activerecord (>= 5.1.0)
|
6
6
|
activesupport (>= 5.1.0)
|
7
7
|
json-api-vanilla
|
@@ -83,8 +83,8 @@ GEM
|
|
83
83
|
domain_name (0.5.20190701)
|
84
84
|
unf (>= 0.0.5, < 1.0.0)
|
85
85
|
erubi (1.10.0)
|
86
|
-
globalid (0.
|
87
|
-
activesupport (>=
|
86
|
+
globalid (0.5.2)
|
87
|
+
activesupport (>= 5.0)
|
88
88
|
http-accept (1.7.0)
|
89
89
|
http-cookie (1.0.4)
|
90
90
|
domain_name (~> 0.5)
|
@@ -107,7 +107,7 @@ GEM
|
|
107
107
|
logstash-event (1.2.02)
|
108
108
|
logstash-logger (0.26.1)
|
109
109
|
logstash-event (~> 1.2)
|
110
|
-
loofah (2.
|
110
|
+
loofah (2.12.0)
|
111
111
|
crass (~> 1.0.2)
|
112
112
|
nokogiri (>= 1.5.9)
|
113
113
|
mail (2.7.1)
|
@@ -120,11 +120,13 @@ GEM
|
|
120
120
|
mini_mime (1.1.0)
|
121
121
|
minitest (5.14.4)
|
122
122
|
netrc (0.11.0)
|
123
|
-
nio4r (2.5.
|
124
|
-
nokogiri (1.
|
123
|
+
nio4r (2.5.8)
|
124
|
+
nokogiri (1.12.3-x86_64-darwin)
|
125
|
+
racc (~> 1.4)
|
126
|
+
nokogiri (1.12.3-x86_64-linux)
|
125
127
|
racc (~> 1.4)
|
126
128
|
parallel (1.20.1)
|
127
|
-
parser (3.0.
|
129
|
+
parser (3.0.2.0)
|
128
130
|
ast (~> 2.4.1)
|
129
131
|
pry (0.13.1)
|
130
132
|
coderay (~> 1.1)
|
@@ -163,7 +165,7 @@ GEM
|
|
163
165
|
rake (>= 0.13)
|
164
166
|
thor (~> 1.0)
|
165
167
|
rainbow (3.0.0)
|
166
|
-
rake (13.0.
|
168
|
+
rake (13.0.6)
|
167
169
|
regexp_parser (2.1.1)
|
168
170
|
request_store (1.5.0)
|
169
171
|
rack (>= 1.4)
|
@@ -186,20 +188,20 @@ GEM
|
|
186
188
|
diff-lcs (>= 1.2.0, < 2.0)
|
187
189
|
rspec-support (~> 3.10.0)
|
188
190
|
rspec-support (3.10.2)
|
189
|
-
rubocop (1.
|
191
|
+
rubocop (1.19.0)
|
190
192
|
parallel (~> 1.10)
|
191
193
|
parser (>= 3.0.0.0)
|
192
194
|
rainbow (>= 2.2.2, < 4.0)
|
193
195
|
regexp_parser (>= 1.8, < 3.0)
|
194
196
|
rexml
|
195
|
-
rubocop-ast (>= 1.
|
197
|
+
rubocop-ast (>= 1.9.1, < 2.0)
|
196
198
|
ruby-progressbar (~> 1.7)
|
197
199
|
unicode-display_width (>= 1.4.0, < 3.0)
|
198
|
-
rubocop-ast (1.
|
200
|
+
rubocop-ast (1.10.0)
|
199
201
|
parser (>= 3.0.1.1)
|
200
202
|
ruby-progressbar (1.11.0)
|
201
|
-
shoulda-matchers (
|
202
|
-
activesupport (>=
|
203
|
+
shoulda-matchers (5.0.0)
|
204
|
+
activesupport (>= 5.2.0)
|
203
205
|
sprockets (4.0.2)
|
204
206
|
concurrent-ruby (~> 1.0)
|
205
207
|
rack (> 1, < 3)
|
@@ -217,7 +219,7 @@ GEM
|
|
217
219
|
websocket-driver (0.7.5)
|
218
220
|
websocket-extensions (>= 0.1.0)
|
219
221
|
websocket-extensions (0.1.5)
|
220
|
-
will_paginate (3.3.
|
222
|
+
will_paginate (3.3.1)
|
221
223
|
zeitwerk (2.4.2)
|
222
224
|
|
223
225
|
PLATFORMS
|
@@ -234,4 +236,4 @@ DEPENDENCIES
|
|
234
236
|
shoulda-matchers
|
235
237
|
|
236
238
|
BUNDLED WITH
|
237
|
-
2.2.
|
239
|
+
2.2.25
|
data/bin/docker
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
#! /usr/bin/env sh
|
2
|
+
|
3
|
+
NAMETAG="json-api-toolbox:dev"
|
4
|
+
COMMAND=${1:-help}
|
5
|
+
shift
|
6
|
+
|
7
|
+
command_help() {
|
8
|
+
echo "
|
9
|
+
Usage: docker COMMAND [code]
|
10
|
+
|
11
|
+
A simple script to control the project container
|
12
|
+
|
13
|
+
Commands:
|
14
|
+
run Run [code] on a new container
|
15
|
+
exec Run [code] on the current active container
|
16
|
+
build Build the project image
|
17
|
+
help Show this help message
|
18
|
+
"
|
19
|
+
}
|
20
|
+
|
21
|
+
command_build() {
|
22
|
+
docker build -t $NAMETAG --ssh=default .
|
23
|
+
}
|
24
|
+
|
25
|
+
config_ssh_agent() {
|
26
|
+
if [ uname == "Darwin" ]; then
|
27
|
+
AUTH_PATH="/run/host-services/ssh-auth.sock"
|
28
|
+
else
|
29
|
+
AUTH_PATH=$(echo $SSH_AUTH_SOCK)
|
30
|
+
fi
|
31
|
+
|
32
|
+
echo "-v $(echo $HOME)/.ssh:/root/.ssh \
|
33
|
+
-v $(echo $AUTH_PATH):/ssh-agent \
|
34
|
+
-e SSH_AUTH_SOCK=/ssh-agent \
|
35
|
+
"
|
36
|
+
}
|
37
|
+
|
38
|
+
command_run() {
|
39
|
+
[[ $1 == "--build" ]] && { command_build; shift; }
|
40
|
+
|
41
|
+
docker volume create bundler_cache > /dev/null
|
42
|
+
docker run -it \
|
43
|
+
-v bundler_cache:/usr/local/bundle \
|
44
|
+
-v $(pwd):/gem \
|
45
|
+
$(config_ssh_agent) \
|
46
|
+
$NAMETAG
|
47
|
+
$@
|
48
|
+
}
|
49
|
+
|
50
|
+
command_exec() {
|
51
|
+
[[ $1 == "--build" ]] && { command_build; shift; }
|
52
|
+
|
53
|
+
docker exec $NAMETAG $@
|
54
|
+
}
|
55
|
+
|
56
|
+
case $COMMAND in
|
57
|
+
build) command_build "$@" ;;
|
58
|
+
exec) command_exec "$@" ;;
|
59
|
+
run) command_run "$@" ;;
|
60
|
+
*) command_help "$@" ;;
|
61
|
+
esac
|
data/bin/setup.sh
CHANGED
@@ -3,28 +3,31 @@
|
|
3
3
|
DEFAULT_REPO=git@bitbucket.org:guideinvestimentos/rails_defaults.git
|
4
4
|
STRICT=${1:-no}
|
5
5
|
ONE_WEEK_AGO=$(( $(date +%s) - 604800 ))
|
6
|
-
|
6
|
+
|
7
|
+
if [ -f .rubocop.base.yml ]; then
|
8
|
+
FILE_TIME=$(date -r .rubocop.base.yml +%s)
|
9
|
+
fi
|
7
10
|
|
8
11
|
info(){
|
9
|
-
|
12
|
+
printf "\033[34;1m$1\033[0m\n"
|
10
13
|
}
|
11
14
|
|
12
15
|
step(){
|
13
|
-
printf "- $1:
|
16
|
+
printf " - $1: \0337\n"
|
14
17
|
}
|
15
18
|
|
16
19
|
success(){
|
17
|
-
printf "
|
20
|
+
printf "\0338\033[1A\033[32;1mOK!\033[0m\n\033[2K"
|
18
21
|
}
|
19
22
|
|
20
23
|
skipped(){
|
21
|
-
printf "
|
24
|
+
printf "\0338\033[1A\033[33;1mSKIPPED ($1)\033[0m\n\033[2K"
|
22
25
|
}
|
23
26
|
|
24
27
|
error() {
|
25
|
-
printf "
|
26
|
-
printf "
|
27
|
-
[ $STRICT
|
28
|
+
printf "\0338\033[1A\033[31;1mERRO!\033[0m\n\033[2K"
|
29
|
+
printf "\033[31m $1\033[0m\n"
|
30
|
+
[ $STRICT -eq "--strict" ] && exit $2
|
28
31
|
}
|
29
32
|
|
30
33
|
info "Configurando o projeto\n"
|
@@ -48,7 +51,7 @@ step "Instalando dependências"
|
|
48
51
|
|
49
52
|
bundle check 2>&1 > /dev/null && skipped "up-to date" || {
|
50
53
|
RESULT=$(bundle install 2>&1 > /dev/null)
|
51
|
-
[ $?
|
54
|
+
[ $? -eq "0" ] && success || error "$RESULT" 2
|
52
55
|
}
|
53
56
|
|
54
57
|
info "\nConfiguração executada com sucesso"
|
data/bitbucket-pipelines.yml
CHANGED
@@ -22,12 +22,10 @@ definitions:
|
|
22
22
|
- gem update --system
|
23
23
|
- bundle config set --local path "vendor/bundle"
|
24
24
|
- bundle install
|
25
|
-
-
|
26
|
-
- curl -u $RUBYGEMS_USERNAME:$RUBYGEMS_PASSWORD https://rubygems.org/api/v1/api_key.yaml -o ~/.gem/credentials
|
25
|
+
- mkdir -p ~/.gem/
|
26
|
+
- curl -sSL -u $RUBYGEMS_USERNAME:$RUBYGEMS_PASSWORD https://rubygems.org/api/v1/api_key.yaml -o ~/.gem/credentials
|
27
27
|
- chmod 0600 ~/.gem/credentials
|
28
|
-
- bundle exec rake release
|
29
|
-
caches:
|
30
|
-
- bundler-26
|
28
|
+
- bundle exec rake release --trace
|
31
29
|
|
32
30
|
pipelines:
|
33
31
|
pull-requests:
|
data/lib/postable.rb
CHANGED
@@ -7,7 +7,7 @@ module JsonApiToolbox
|
|
7
7
|
associations = model.reflect_on_all_associations.map(&:name)
|
8
8
|
normalized_hash = hash.map do |key, value|
|
9
9
|
child_model = association_class(model, key) if value.is_a? Hash
|
10
|
-
key =
|
10
|
+
key = "#{key}_attributes" if associations.include?(key.to_sym)
|
11
11
|
hash_value = check_child_association(value, key, model, child_model)
|
12
12
|
[key, hash_value]
|
13
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_api_toolbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adriano Bacha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -216,12 +216,14 @@ files:
|
|
216
216
|
- ".gitignore"
|
217
217
|
- ".rspec"
|
218
218
|
- ".rubocop.yml"
|
219
|
+
- ".version"
|
219
220
|
- CHANGELOG.md
|
220
221
|
- Dockerfile
|
221
222
|
- Gemfile
|
222
223
|
- Gemfile.lock
|
223
224
|
- README.md
|
224
225
|
- Rakefile
|
226
|
+
- bin/docker
|
225
227
|
- bin/setup.sh
|
226
228
|
- bitbucket-pipelines.yml
|
227
229
|
- docker-entrypoint.sh
|