mutils 1.3.3 → 1.3.4
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/.github/ISSUE_TEMPLATE/bug_report.md +33 -28
- data/.github/ISSUE_TEMPLATE/documentation_issue.md +29 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +31 -14
- data/.github/ISSUE_TEMPLATE/question_or_help.md +25 -0
- data/.github/ISSUE_TEMPLATE/report_a_security_vulnerability.md +74 -0
- data/.github/ISSUE_TEMPLATE/translations.md +51 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +38 -9
- data/.github/dependabot.yml +3 -2
- data/.github/release-drafter.yml +148 -0
- data/.github/workflows/ci.yml +45 -0
- data/.github/workflows/codeql.yml +31 -33
- data/.github/workflows/release-drafter.yml +27 -0
- data/.github/workflows/release.yml +43 -0
- data/.rubocop.yml +11 -6
- data/.ruby-version +1 -0
- data/CHANGELOG.md +26 -0
- data/Gemfile +7 -5
- data/Gemfile.lock +48 -36
- data/Version +1 -1
- data/bin/rspec +27 -0
- data/bin/rubocop +27 -0
- data/lib/mutils/serialization/methods/attributes.rb +3 -1
- data/lib/mutils/serialization/methods/relations.rb +3 -1
- data/lib/mutils/serialization/results/relations.rb +9 -5
- data/lib/mutils/version.rb +1 -2
- data/mutils.gemspec +3 -3
- metadata +18 -18
- data/.github/CONTRIBUTING.md +0 -30
- data/.github/ISSUE_TEMPLATE.md +0 -32
- data/.github/workflows/create-release.yml +0 -29
- data/.github/workflows/master.yml +0 -33
- data/.github/workflows/publish-gem.yml +0 -44
- data/.github/workflows/test.yml +0 -32
- data/.rubocop_todo.yml +0 -49
- data/commitlint.config.js +0 -1
- data/gemdeploy.sh +0 -10
@@ -2,13 +2,12 @@ name: "CodeQL"
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
-
branches: [
|
5
|
+
branches: ["*"]
|
6
6
|
pull_request:
|
7
7
|
# The branches below must be a subset of the branches above
|
8
|
-
branches: [
|
9
|
-
merge_group:
|
8
|
+
branches: ["*"]
|
10
9
|
schedule:
|
11
|
-
- cron:
|
10
|
+
- cron: "26 6 * * 5"
|
12
11
|
|
13
12
|
jobs:
|
14
13
|
analyze:
|
@@ -22,45 +21,44 @@ jobs:
|
|
22
21
|
strategy:
|
23
22
|
fail-fast: false
|
24
23
|
matrix:
|
25
|
-
language: [
|
24
|
+
language: ["ruby"]
|
26
25
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
27
26
|
# Use only 'java' to analyze code written in Java, Kotlin or both
|
28
27
|
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
|
29
28
|
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
30
29
|
|
31
30
|
steps:
|
32
|
-
|
33
|
-
|
31
|
+
- name: Checkout repository
|
32
|
+
uses: actions/checkout@v5
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
34
|
+
# Initializes the CodeQL tools for scanning.
|
35
|
+
- name: Initialize CodeQL
|
36
|
+
uses: github/codeql-action/init@v3
|
37
|
+
with:
|
38
|
+
languages: ${{ matrix.language }}
|
39
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
40
|
+
# By default, queries listed here will override any specified in a config file.
|
41
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
43
42
|
|
44
|
-
|
45
|
-
|
43
|
+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
44
|
+
# queries: security-extended,security-and-quality
|
46
45
|
|
46
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
|
47
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
48
|
+
- name: Autobuild
|
49
|
+
uses: github/codeql-action/autobuild@v3
|
47
50
|
|
48
|
-
|
49
|
-
|
50
|
-
- name: Autobuild
|
51
|
-
uses: github/codeql-action/autobuild@v2
|
51
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
52
|
+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
52
53
|
|
53
|
-
|
54
|
-
|
54
|
+
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
55
|
+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
55
56
|
|
56
|
-
|
57
|
-
|
57
|
+
# - run: |
|
58
|
+
# echo "Run, Build Application using script"
|
59
|
+
# ./location_of_script_within_repo/buildscript.sh
|
58
60
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
- name: Perform CodeQL Analysis
|
64
|
-
uses: github/codeql-action/analyze@v2
|
65
|
-
with:
|
66
|
-
category: "/language:${{matrix.language}}"
|
61
|
+
- name: Perform CodeQL Analysis
|
62
|
+
uses: github/codeql-action/analyze@v3
|
63
|
+
with:
|
64
|
+
category: "/language:${{matrix.language}}"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: Release Drafter
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
pull_request:
|
8
|
+
types: [opened, reopened, synchronize]
|
9
|
+
|
10
|
+
permissions:
|
11
|
+
contents: write
|
12
|
+
pull-requests: read
|
13
|
+
|
14
|
+
jobs:
|
15
|
+
release_drafter:
|
16
|
+
permissions:
|
17
|
+
contents: write
|
18
|
+
pull-requests: write
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
steps:
|
21
|
+
- uses: release-drafter/release-drafter@v6
|
22
|
+
with:
|
23
|
+
config-name: release-drafter.yml
|
24
|
+
disable-releaser: ${{ github.event_name != 'push' }}
|
25
|
+
disable-autolabeler: ${{ github.event_name != 'pull_request' }}
|
26
|
+
env:
|
27
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
name: Release
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- "v*"
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
test:
|
10
|
+
name: Run RSpec
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- name: Checkout
|
14
|
+
uses: actions/checkout@v5
|
15
|
+
- name: Set up Ruby
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
bundler-cache: true
|
19
|
+
- name: RSpec
|
20
|
+
run: bin/rspec
|
21
|
+
|
22
|
+
push:
|
23
|
+
runs-on: ubuntu-latest
|
24
|
+
needs: test
|
25
|
+
permissions:
|
26
|
+
contents: write
|
27
|
+
id-token: write
|
28
|
+
environment: release
|
29
|
+
steps:
|
30
|
+
- uses: actions/checkout@v5
|
31
|
+
with:
|
32
|
+
persist-credentials: false
|
33
|
+
- name: Set up Ruby
|
34
|
+
uses: ruby/setup-ruby@v1
|
35
|
+
with:
|
36
|
+
bundler-cache: true
|
37
|
+
ruby-version: ruby
|
38
|
+
- name: Configure RubyGems Credentials
|
39
|
+
uses: rubygems/configure-rubygems-credentials@main
|
40
|
+
- name: Release
|
41
|
+
run: |
|
42
|
+
gem build mutils.gemspec
|
43
|
+
gem push mutils-*.gem
|
data/.rubocop.yml
CHANGED
@@ -1,8 +1,13 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
plugins:
|
2
|
+
- rubocop-rake
|
3
|
+
- rubocop-rspec
|
3
4
|
AllCops:
|
4
|
-
TargetRubyVersion: "2.7.0"
|
5
5
|
NewCops: enable
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
TargetRubyVersion: 3.2
|
7
|
+
SuggestExtensions: true
|
8
|
+
Metrics/MethodLength:
|
9
|
+
Max: 20
|
10
|
+
RSpec/MultipleExpectations:
|
11
|
+
Max: 10
|
12
|
+
RSpec/ExampleLength:
|
13
|
+
Max: 15
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.4.3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,29 @@
|
|
1
|
+
## [1.3.4](https://github.com/Code-Vedas/mutils/compare/v1.3.3...v1.3.4) (2025-08-17)
|
2
|
+
|
3
|
+
## 🧰 Maintenance
|
4
|
+
|
5
|
+
- build: bump dry-inflector from 1.1.0 to 1.2.0 @[dependabot[bot]](https://github.com/apps/dependabot) (#345)
|
6
|
+
- build: bump actions/checkout from 3 to 5 @[dependabot[bot]](https://github.com/apps/dependabot) (#344)
|
7
|
+
- build: bump github/codeql-action from 2 to 3 @[dependabot[bot]](https://github.com/apps/dependabot) (#343)
|
8
|
+
- build: bump rubocop from 1.77.0 to 1.79.2 @[dependabot[bot]](https://github.com/apps/dependabot) (#341)
|
9
|
+
- build: bump json from 2.12.2 to 2.13.2 @[dependabot[bot]](https://github.com/apps/dependabot) (#340)
|
10
|
+
- build(deps): bump rubocop from 1.75.8 to 1.77.0 @[dependabot[bot]](https://github.com/apps/dependabot) (#339)
|
11
|
+
- build(deps): bump rubocop from 1.75.2 to 1.75.8 @[dependabot[bot]](https://github.com/apps/dependabot) (#334)
|
12
|
+
- build(deps): bump rspec from 3.13.0 to 3.13.1 @[dependabot[bot]](https://github.com/apps/dependabot) (#333)
|
13
|
+
- build(deps): bump json from 2.9.1 to 2.12.2 @[dependabot[bot]](https://github.com/apps/dependabot) (#332)
|
14
|
+
- build(deps): bump rubocop from 1.69.2 to 1.75.2 @[dependabot[bot]](https://github.com/apps/dependabot) (#329)
|
15
|
+
- build(deps): bump json from 2.8.2 to 2.9.1 @[dependabot[bot]](https://github.com/apps/dependabot) (#315)
|
16
|
+
- build(deps): bump rubocop from 1.68.0 to 1.69.2 @[dependabot[bot]](https://github.com/apps/dependabot) (#314)
|
17
|
+
- build(deps): bump json from 2.7.6 to 2.8.2 @[dependabot[bot]](https://github.com/apps/dependabot) (#310)
|
18
|
+
- build(deps): bump json from 2.7.5 to 2.7.6 @[dependabot[bot]](https://github.com/apps/dependabot) (#308)
|
19
|
+
- build(deps): bump rubocop from 1.67.0 to 1.68.0 @[dependabot[bot]](https://github.com/apps/dependabot) (#307)
|
20
|
+
- build(deps): bump json from 2.7.2 to 2.7.5 @[dependabot[bot]](https://github.com/apps/dependabot) (#306)
|
21
|
+
- build(deps): bump rubocop from 1.66.1 to 1.67.0 @[dependabot[bot]](https://github.com/apps/dependabot) (#303)
|
22
|
+
|
23
|
+
## ⚙️ CI
|
24
|
+
|
25
|
+
- ci: Refactor CI/CD pipelines and project configuration @niteshpurohit (#342)
|
26
|
+
|
1
27
|
## [1.3.3](https://github.com/Code-Vedas/mutils/compare/v1.3.2...v1.3.3) (2024-09-05)
|
2
28
|
|
3
29
|
|
data/Gemfile
CHANGED
@@ -3,14 +3,16 @@
|
|
3
3
|
source 'https://rubygems.org'
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in mutils.gemspec
|
6
|
-
gem '
|
6
|
+
gem 'benchmark'
|
7
|
+
gem 'bundler'
|
7
8
|
gem 'coveralls', '>= 0.8.23'
|
8
|
-
gem 'json'
|
9
|
-
gem '
|
10
|
-
gem 'rake', '~> 13.2'
|
9
|
+
gem 'json'
|
10
|
+
gem 'rake'
|
11
11
|
gem 'rspec'
|
12
12
|
gem 'rspec-benchmark'
|
13
13
|
gem 'rspec-json_expectations'
|
14
|
-
gem 'rubocop'
|
14
|
+
gem 'rubocop'
|
15
|
+
gem 'rubocop-rake'
|
16
|
+
gem 'rubocop-rspec'
|
15
17
|
gem 'simplecov-lcov', git: 'https://github.com/niteshpurohit/simplecov-lcov'
|
16
18
|
gemspec
|
data/Gemfile.lock
CHANGED
@@ -7,43 +7,43 @@ GIT
|
|
7
7
|
PATH
|
8
8
|
remote: .
|
9
9
|
specs:
|
10
|
-
mutils (1.3.
|
10
|
+
mutils (1.3.4)
|
11
11
|
dry-inflector
|
12
12
|
|
13
13
|
GEM
|
14
14
|
remote: https://rubygems.org/
|
15
15
|
specs:
|
16
|
-
ast (2.4.
|
16
|
+
ast (2.4.3)
|
17
|
+
benchmark (0.4.1)
|
17
18
|
benchmark-malloc (0.2.0)
|
18
19
|
benchmark-perf (0.6.0)
|
19
20
|
benchmark-trend (0.4.0)
|
20
|
-
bigdecimal (3.
|
21
|
-
bigdecimal (3.
|
21
|
+
bigdecimal (3.2.2)
|
22
|
+
bigdecimal (3.2.2-java)
|
22
23
|
coveralls (0.8.23)
|
23
24
|
json (>= 1.8, < 3)
|
24
25
|
simplecov (~> 0.16.1)
|
25
26
|
term-ansicolor (~> 1.3)
|
26
27
|
thor (>= 0.19.4, < 2.0)
|
27
28
|
tins (~> 1.6)
|
28
|
-
diff-lcs (1.
|
29
|
+
diff-lcs (1.6.2)
|
29
30
|
docile (1.4.1)
|
30
|
-
dry-inflector (1.
|
31
|
-
json (2.
|
32
|
-
json (2.
|
33
|
-
language_server-protocol (3.17.0.
|
34
|
-
|
35
|
-
|
31
|
+
dry-inflector (1.2.0)
|
32
|
+
json (2.13.2)
|
33
|
+
json (2.13.2-java)
|
34
|
+
language_server-protocol (3.17.0.5)
|
35
|
+
lint_roller (1.1.0)
|
36
|
+
parallel (1.27.0)
|
37
|
+
parser (3.3.9.0)
|
36
38
|
ast (~> 2.4.1)
|
37
39
|
racc
|
38
|
-
|
39
|
-
pre-commit (0.40.0)
|
40
|
-
pluginator (~> 1.5)
|
40
|
+
prism (1.4.0)
|
41
41
|
racc (1.8.1)
|
42
42
|
racc (1.8.1-java)
|
43
43
|
rainbow (3.1.1)
|
44
|
-
rake (13.
|
45
|
-
regexp_parser (2.
|
46
|
-
rspec (3.13.
|
44
|
+
rake (13.3.0)
|
45
|
+
regexp_parser (2.11.2)
|
46
|
+
rspec (3.13.1)
|
47
47
|
rspec-core (~> 3.13.0)
|
48
48
|
rspec-expectations (~> 3.13.0)
|
49
49
|
rspec-mocks (~> 3.13.0)
|
@@ -52,28 +52,36 @@ GEM
|
|
52
52
|
benchmark-perf (~> 0.6)
|
53
53
|
benchmark-trend (~> 0.4)
|
54
54
|
rspec (>= 3.0)
|
55
|
-
rspec-core (3.13.
|
55
|
+
rspec-core (3.13.5)
|
56
56
|
rspec-support (~> 3.13.0)
|
57
|
-
rspec-expectations (3.13.
|
57
|
+
rspec-expectations (3.13.5)
|
58
58
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
59
|
rspec-support (~> 3.13.0)
|
60
60
|
rspec-json_expectations (2.2.0)
|
61
|
-
rspec-mocks (3.13.
|
61
|
+
rspec-mocks (3.13.5)
|
62
62
|
diff-lcs (>= 1.2.0, < 2.0)
|
63
63
|
rspec-support (~> 3.13.0)
|
64
|
-
rspec-support (3.13.
|
65
|
-
rubocop (1.
|
64
|
+
rspec-support (3.13.4)
|
65
|
+
rubocop (1.79.2)
|
66
66
|
json (~> 2.3)
|
67
|
-
language_server-protocol (
|
67
|
+
language_server-protocol (~> 3.17.0.2)
|
68
|
+
lint_roller (~> 1.1.0)
|
68
69
|
parallel (~> 1.10)
|
69
70
|
parser (>= 3.3.0.2)
|
70
71
|
rainbow (>= 2.2.2, < 4.0)
|
71
|
-
regexp_parser (>= 2.
|
72
|
-
rubocop-ast (>= 1.
|
72
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
73
|
+
rubocop-ast (>= 1.46.0, < 2.0)
|
73
74
|
ruby-progressbar (~> 1.7)
|
74
|
-
unicode-display_width (>= 2.4.0, <
|
75
|
-
rubocop-ast (1.
|
76
|
-
parser (>= 3.3.
|
75
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
76
|
+
rubocop-ast (1.46.0)
|
77
|
+
parser (>= 3.3.7.2)
|
78
|
+
prism (~> 1.4)
|
79
|
+
rubocop-rake (0.7.1)
|
80
|
+
lint_roller (~> 1.1)
|
81
|
+
rubocop (>= 1.72.1)
|
82
|
+
rubocop-rspec (3.6.0)
|
83
|
+
lint_roller (~> 1.1)
|
84
|
+
rubocop (~> 1.72, >= 1.72.1)
|
77
85
|
ruby-progressbar (1.13.0)
|
78
86
|
simplecov (0.16.1)
|
79
87
|
docile (~> 1.1)
|
@@ -83,27 +91,31 @@ GEM
|
|
83
91
|
sync (0.5.0)
|
84
92
|
term-ansicolor (1.11.2)
|
85
93
|
tins (~> 1.0)
|
86
|
-
thor (1.
|
87
|
-
tins (1.
|
94
|
+
thor (1.4.0)
|
95
|
+
tins (1.39.1)
|
88
96
|
bigdecimal
|
89
97
|
sync
|
90
|
-
unicode-display_width (
|
98
|
+
unicode-display_width (3.1.5)
|
99
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
100
|
+
unicode-emoji (4.0.4)
|
91
101
|
|
92
102
|
PLATFORMS
|
93
103
|
java
|
94
104
|
ruby
|
95
105
|
|
96
106
|
DEPENDENCIES
|
97
|
-
|
107
|
+
benchmark
|
108
|
+
bundler
|
98
109
|
coveralls (>= 0.8.23)
|
99
|
-
json
|
110
|
+
json
|
100
111
|
mutils!
|
101
|
-
|
102
|
-
rake (~> 13.2)
|
112
|
+
rake
|
103
113
|
rspec
|
104
114
|
rspec-benchmark
|
105
115
|
rspec-json_expectations
|
106
|
-
rubocop
|
116
|
+
rubocop
|
117
|
+
rubocop-rake
|
118
|
+
rubocop-rspec
|
107
119
|
simplecov-lcov!
|
108
120
|
|
109
121
|
BUNDLED WITH
|
data/Version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
v1.3.
|
1
|
+
v1.3.4
|
data/bin/rspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
12
|
+
|
13
|
+
bundle_binstub = File.expand_path('bundle', __dir__)
|
14
|
+
|
15
|
+
if File.file?(bundle_binstub)
|
16
|
+
if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
|
17
|
+
load(bundle_binstub)
|
18
|
+
else
|
19
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
20
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
require 'rubygems'
|
25
|
+
require 'bundler/setup'
|
26
|
+
|
27
|
+
load Gem.bin_path('rspec-core', 'rspec')
|
data/bin/rubocop
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rubocop' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
12
|
+
|
13
|
+
bundle_binstub = File.expand_path('bundle', __dir__)
|
14
|
+
|
15
|
+
if File.file?(bundle_binstub)
|
16
|
+
if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
|
17
|
+
load(bundle_binstub)
|
18
|
+
else
|
19
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
20
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
require 'rubygems'
|
25
|
+
require 'bundler/setup'
|
26
|
+
|
27
|
+
load Gem.bin_path('rubocop', 'rubocop')
|
@@ -25,7 +25,9 @@ module Mutils
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def attribute(method_name, options = {}, &proc)
|
28
|
-
|
28
|
+
if options[:if] && !options[:if].instance_of?(Proc)
|
29
|
+
raise "if: should be a Proc object for attribute #{method_name}"
|
30
|
+
end
|
29
31
|
|
30
32
|
if proc.instance_of? Proc
|
31
33
|
self.attributes_to_serialize_blocks = {} if attributes_to_serialize_blocks.nil?
|
@@ -9,7 +9,9 @@ module Mutils
|
|
9
9
|
# Module Relations
|
10
10
|
module Relations
|
11
11
|
def relationship(relationship_name, options = {})
|
12
|
-
|
12
|
+
if options[:if] && !options[:if].instance_of?(Proc)
|
13
|
+
raise "if: should be a Proc object for attribute #{relationship_name}"
|
14
|
+
end
|
13
15
|
|
14
16
|
options = prepare_options(relationship_name, options, __callee__)
|
15
17
|
self.relationships = {} if relationships.nil?
|
@@ -10,13 +10,17 @@ module Mutils
|
|
10
10
|
def hash_relationships(relationships_array, result_hash)
|
11
11
|
relationships = relationships_array&.compact
|
12
12
|
relationships&.each do |key, s_options|
|
13
|
-
|
14
|
-
name = s_options[:label]
|
15
|
-
Lib::Helper.instance.collection?(object) && (name = Lib::Helper.instance.pluralize(name))
|
16
|
-
name = name.to_sym
|
17
|
-
check_if_included(s_options, key) && (result_hash[name] = Lib::Helper.instance.constantize(s_options[:serializer]).new(object).to_h)
|
13
|
+
hash_relationship(key, s_options, result_hash)
|
18
14
|
end
|
19
15
|
end
|
16
|
+
|
17
|
+
def hash_relationship(key, s_options, result_hash)
|
18
|
+
object = scope.send(key)
|
19
|
+
name = s_options[:label]
|
20
|
+
Lib::Helper.instance.collection?(object) && (name = Lib::Helper.instance.pluralize(name))
|
21
|
+
name = name.to_sym
|
22
|
+
check_if_included(s_options, key) && (result_hash[name] = Lib::Helper.instance.constantize(s_options[:serializer]).new(object).to_h)
|
23
|
+
end
|
20
24
|
end
|
21
25
|
end
|
22
26
|
end
|
data/lib/mutils/version.rb
CHANGED
data/mutils.gemspec
CHANGED
@@ -20,13 +20,13 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.bindir = 'exe'
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ['lib']
|
23
|
-
spec.required_ruby_version = '>= 2
|
24
|
-
spec.required_rubygems_version = '>= 1.8.11'
|
23
|
+
spec.required_ruby_version = '>= 3.2'
|
25
24
|
spec.add_dependency('dry-inflector')
|
26
25
|
|
27
26
|
spec.metadata = {
|
28
27
|
'bug_tracker_uri' => 'https://github.com/code-vedas/mutils/issues',
|
29
|
-
'source_code_uri' =>
|
28
|
+
'source_code_uri' => 'https://github.com/Code-Vedas/mutils.git',
|
29
|
+
'homepage_uri' => 'https://github.com/code-vedas/mutils',
|
30
30
|
'rubygems_mfa_required' => 'true'
|
31
31
|
}
|
32
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nitesh Purohit
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: dry-inflector
|
@@ -32,23 +31,25 @@ extensions: []
|
|
32
31
|
extra_rdoc_files: []
|
33
32
|
files:
|
34
33
|
- ".codeclimate.yml"
|
35
|
-
- ".github/CONTRIBUTING.md"
|
36
|
-
- ".github/ISSUE_TEMPLATE.md"
|
37
34
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
35
|
+
- ".github/ISSUE_TEMPLATE/documentation_issue.md"
|
38
36
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
37
|
+
- ".github/ISSUE_TEMPLATE/question_or_help.md"
|
38
|
+
- ".github/ISSUE_TEMPLATE/report_a_security_vulnerability.md"
|
39
|
+
- ".github/ISSUE_TEMPLATE/translations.md"
|
39
40
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
40
41
|
- ".github/dependabot.yml"
|
42
|
+
- ".github/release-drafter.yml"
|
43
|
+
- ".github/workflows/ci.yml"
|
41
44
|
- ".github/workflows/codeql.yml"
|
42
|
-
- ".github/workflows/
|
43
|
-
- ".github/workflows/
|
44
|
-
- ".github/workflows/publish-gem.yml"
|
45
|
-
- ".github/workflows/test.yml"
|
45
|
+
- ".github/workflows/release-drafter.yml"
|
46
|
+
- ".github/workflows/release.yml"
|
46
47
|
- ".gitignore"
|
47
48
|
- ".jrubyrc"
|
48
49
|
- ".releaserc"
|
49
50
|
- ".rspec"
|
50
51
|
- ".rubocop.yml"
|
51
|
-
- ".
|
52
|
+
- ".ruby-version"
|
52
53
|
- CHANGELOG.md
|
53
54
|
- CODE_OF_CONDUCT.md
|
54
55
|
- Gemfile
|
@@ -59,9 +60,9 @@ files:
|
|
59
60
|
- SECURITY.md
|
60
61
|
- Version
|
61
62
|
- bin/console
|
63
|
+
- bin/rspec
|
64
|
+
- bin/rubocop
|
62
65
|
- bin/setup
|
63
|
-
- commitlint.config.js
|
64
|
-
- gemdeploy.sh
|
65
66
|
- lib/generators/mutils/USAGE
|
66
67
|
- lib/generators/mutils/serializer_generator.rb
|
67
68
|
- lib/generators/mutils/templates/serializer.rb.tt
|
@@ -85,9 +86,9 @@ licenses:
|
|
85
86
|
- MIT
|
86
87
|
metadata:
|
87
88
|
bug_tracker_uri: https://github.com/code-vedas/mutils/issues
|
88
|
-
source_code_uri: https://github.com/
|
89
|
+
source_code_uri: https://github.com/Code-Vedas/mutils.git
|
90
|
+
homepage_uri: https://github.com/code-vedas/mutils
|
89
91
|
rubygems_mfa_required: 'true'
|
90
|
-
post_install_message:
|
91
92
|
rdoc_options: []
|
92
93
|
require_paths:
|
93
94
|
- lib
|
@@ -95,15 +96,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
95
96
|
requirements:
|
96
97
|
- - ">="
|
97
98
|
- !ruby/object:Gem::Version
|
98
|
-
version: 2
|
99
|
+
version: '3.2'
|
99
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
101
|
requirements:
|
101
102
|
- - ">="
|
102
103
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
104
|
+
version: '0'
|
104
105
|
requirements: []
|
105
|
-
rubygems_version: 3.
|
106
|
-
signing_key:
|
106
|
+
rubygems_version: 3.6.9
|
107
107
|
specification_version: 4
|
108
108
|
summary: mutils Utilities for rails app
|
109
109
|
test_files: []
|
data/.github/CONTRIBUTING.md
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# Contributing
|
2
|
-
|
3
|
-
We love pull requests from everyone. By participating in this project, you
|
4
|
-
agree to abide by the [code of conduct].
|
5
|
-
|
6
|
-
[code of conduct]: https://github.com/code-vedas/mutils/blob/master/CODE_OF_CONDUCT.md
|
7
|
-
|
8
|
-
Fork, then clone the repo:
|
9
|
-
|
10
|
-
git clone git@github.com:code-vedas/mutils.git
|
11
|
-
|
12
|
-
Set up your machine:
|
13
|
-
|
14
|
-
./bin/setup
|
15
|
-
|
16
|
-
Make sure the tests pass:
|
17
|
-
|
18
|
-
rake
|
19
|
-
|
20
|
-
Make your change. Add tests for your change. Make the tests pass:
|
21
|
-
|
22
|
-
rake
|
23
|
-
|
24
|
-
Push to your fork and [submit a pull request][pr].
|
25
|
-
|
26
|
-
[pr]: https://github.com/code-vedas/mutils/compare/
|
27
|
-
|
28
|
-
At this point you're waiting on us. We like to at least comment on pull requests
|
29
|
-
within three business days (and, typically, one business day). We may suggest
|
30
|
-
some changes or improvements or alternatives.
|