dry-transformer 0.1.0 → 0.1.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/dry-transformer.gemspec +17 -10
- data/lib/dry/transformer/hash.rb +2 -1
- data/lib/dry/transformer/version.rb +1 -1
- metadata +10 -56
- data/.codeclimate.yml +0 -12
- data/.github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md +0 -10
- data/.github/ISSUE_TEMPLATE/---bug-report.md +0 -30
- data/.github/ISSUE_TEMPLATE/---feature-request.md +0 -18
- data/.github/workflows/custom_ci.yml +0 -66
- data/.github/workflows/docsite.yml +0 -34
- data/.github/workflows/sync_configs.yml +0 -34
- data/.gitignore +0 -16
- data/.rspec +0 -4
- data/.rubocop.yml +0 -95
- data/CODE_OF_CONDUCT.md +0 -13
- data/CONTRIBUTING.md +0 -29
- data/Gemfile +0 -19
- data/Rakefile +0 -6
- data/docsite/source/built-in-transformations.html.md +0 -47
- data/docsite/source/index.html.md +0 -15
- data/docsite/source/transformation-objects.html.md +0 -32
- data/docsite/source/using-standalone-functions.html.md +0 -82
- data/spec/spec_helper.rb +0 -31
- data/spec/unit/array/combine_spec.rb +0 -224
- data/spec/unit/array_transformations_spec.rb +0 -233
- data/spec/unit/class_transformations_spec.rb +0 -50
- data/spec/unit/coercions_spec.rb +0 -132
- data/spec/unit/conditional_spec.rb +0 -48
- data/spec/unit/function_not_found_error_spec.rb +0 -12
- data/spec/unit/function_spec.rb +0 -193
- data/spec/unit/hash_transformations_spec.rb +0 -490
- data/spec/unit/proc_transformations_spec.rb +0 -20
- data/spec/unit/recursion_spec.rb +0 -145
- data/spec/unit/registry_spec.rb +0 -202
- data/spec/unit/store_spec.rb +0 -198
- data/spec/unit/transformer/class_interface_spec.rb +0 -350
- data/spec/unit/transformer/dsl_spec.rb +0 -15
- data/spec/unit/transformer/instance_methods_spec.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '07286bcabed176ae3f17868f5e838decc2ba0c192828b6e69da92ec18f8713e0'
|
4
|
+
data.tar.gz: 3c5b577d2fc463182fd9fb28a333b594622c4afa61b276183f3247ce757c55e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e100d0e8782d778c4abf0c6f805bfbcafd1d86ce5876a898706114fa658ed3c3045345470adc6bd44a750b995a92d0033d95fadbe0e565bca5fccd52d7b4a993
|
7
|
+
data.tar.gz: 41ea28575f7d9691f8e36e14920b4a65718738086a96ebc5b73cee2f3108d8884a99f6da0b933c17b1cf270a314a93fbb39c4b30eb4c51cc0736d690b22be662
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 2020-01-14
|
2
|
+
|
3
|
+
## Fixed
|
4
|
+
|
5
|
+
Fixed Dry::Transformer::HashTransformations.unwrap when hash contains root key (@AMHOL)
|
6
|
+
|
7
|
+
[Compare v0.1.0...v0.1.1](https://github.com/dry-rb/dry-transaction/compare/v0.1.0...v0.1.1)
|
8
|
+
|
1
9
|
# v0.1.0 2019-12-28
|
2
10
|
|
3
11
|
Initial port of the [transproc](https://github.com/solnic/transproc) gem.
|
data/LICENSE
CHANGED
data/README.md
CHANGED
data/dry-transformer.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
# this file is managed by dry-rb/devtools project
|
2
3
|
|
3
4
|
lib = File.expand_path('lib', __dir__)
|
4
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
@@ -6,17 +7,23 @@ require 'dry/transformer/version'
|
|
6
7
|
|
7
8
|
Gem::Specification.new do |spec|
|
8
9
|
spec.name = 'dry-transformer'
|
9
|
-
spec.
|
10
|
-
spec.
|
11
|
-
spec.email = ['piotr.solnica@gmail.com']
|
12
|
-
spec.summary = 'Data transformation toolkit'
|
13
|
-
spec.description = spec.summary
|
14
|
-
spec.homepage = 'https://dry-rb.org/gems/dry-transformer/'
|
10
|
+
spec.authors = ["Piotr Solnica"]
|
11
|
+
spec.email = ["piotr.solnica@gmail.com"]
|
15
12
|
spec.license = 'MIT'
|
13
|
+
spec.version = Dry::Transformer::VERSION.dup
|
16
14
|
|
17
|
-
spec.
|
18
|
-
spec.
|
19
|
-
spec.
|
15
|
+
spec.summary = "Data transformation toolkit"
|
16
|
+
spec.description = spec.summary
|
17
|
+
spec.homepage = 'https://dry-rb.org/gems/dry-transformer'
|
18
|
+
spec.files = Dir['CHANGELOG.md', 'LICENSE', 'README.md', 'dry-transformer.gemspec', 'lib/**/*']
|
20
19
|
spec.require_paths = ['lib']
|
21
|
-
|
20
|
+
|
21
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
22
|
+
spec.metadata['changelog_uri'] = 'https://github.com/dry-rb/dry-transformer/blob/master/CHANGELOG.md'
|
23
|
+
spec.metadata['source_code_uri'] = 'https://github.com/dry-rb/dry-transformer'
|
24
|
+
spec.metadata['bug_tracker_uri'] = 'https://github.com/dry-rb/dry-transformer/issues'
|
25
|
+
|
26
|
+
spec.required_ruby_version = '>= 2.4.0'
|
27
|
+
|
28
|
+
# to update dependencies edit project.yml
|
22
29
|
end
|
data/lib/dry/transformer/hash.rb
CHANGED
@@ -310,9 +310,10 @@ module Dry
|
|
310
310
|
keys = nested_hash.keys
|
311
311
|
keys &= selected if selected
|
312
312
|
new_keys = prefix ? keys.map(&add_prefix) : keys
|
313
|
+
nested_contains_root_key = nested_hash.key?(root)
|
313
314
|
|
314
315
|
hash.update(Hash[new_keys.zip(keys.map { |key| nested_hash.delete(key) })])
|
315
|
-
hash.delete(root) if nested_hash.empty?
|
316
|
+
hash.delete(root) if nested_hash.empty? && !nested_contains_root_key
|
316
317
|
end
|
317
318
|
end
|
318
319
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-transformer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Data transformation toolkit
|
14
14
|
email:
|
@@ -17,27 +17,9 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- ".codeclimate.yml"
|
21
|
-
- ".github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md"
|
22
|
-
- ".github/ISSUE_TEMPLATE/---bug-report.md"
|
23
|
-
- ".github/ISSUE_TEMPLATE/---feature-request.md"
|
24
|
-
- ".github/workflows/custom_ci.yml"
|
25
|
-
- ".github/workflows/docsite.yml"
|
26
|
-
- ".github/workflows/sync_configs.yml"
|
27
|
-
- ".gitignore"
|
28
|
-
- ".rspec"
|
29
|
-
- ".rubocop.yml"
|
30
20
|
- CHANGELOG.md
|
31
|
-
- CODE_OF_CONDUCT.md
|
32
|
-
- CONTRIBUTING.md
|
33
|
-
- Gemfile
|
34
21
|
- LICENSE
|
35
22
|
- README.md
|
36
|
-
- Rakefile
|
37
|
-
- docsite/source/built-in-transformations.html.md
|
38
|
-
- docsite/source/index.html.md
|
39
|
-
- docsite/source/transformation-objects.html.md
|
40
|
-
- docsite/source/using-standalone-functions.html.md
|
41
23
|
- dry-transformer.gemspec
|
42
24
|
- lib/dry-transformer.rb
|
43
25
|
- lib/dry/transformer.rb
|
@@ -61,26 +43,14 @@ files:
|
|
61
43
|
- lib/dry/transformer/registry.rb
|
62
44
|
- lib/dry/transformer/store.rb
|
63
45
|
- lib/dry/transformer/version.rb
|
64
|
-
-
|
65
|
-
- spec/unit/array/combine_spec.rb
|
66
|
-
- spec/unit/array_transformations_spec.rb
|
67
|
-
- spec/unit/class_transformations_spec.rb
|
68
|
-
- spec/unit/coercions_spec.rb
|
69
|
-
- spec/unit/conditional_spec.rb
|
70
|
-
- spec/unit/function_not_found_error_spec.rb
|
71
|
-
- spec/unit/function_spec.rb
|
72
|
-
- spec/unit/hash_transformations_spec.rb
|
73
|
-
- spec/unit/proc_transformations_spec.rb
|
74
|
-
- spec/unit/recursion_spec.rb
|
75
|
-
- spec/unit/registry_spec.rb
|
76
|
-
- spec/unit/store_spec.rb
|
77
|
-
- spec/unit/transformer/class_interface_spec.rb
|
78
|
-
- spec/unit/transformer/dsl_spec.rb
|
79
|
-
- spec/unit/transformer/instance_methods_spec.rb
|
80
|
-
homepage: https://dry-rb.org/gems/dry-transformer/
|
46
|
+
homepage: https://dry-rb.org/gems/dry-transformer
|
81
47
|
licenses:
|
82
48
|
- MIT
|
83
|
-
metadata:
|
49
|
+
metadata:
|
50
|
+
allowed_push_host: https://rubygems.org
|
51
|
+
changelog_uri: https://github.com/dry-rb/dry-transformer/blob/master/CHANGELOG.md
|
52
|
+
source_code_uri: https://github.com/dry-rb/dry-transformer
|
53
|
+
bug_tracker_uri: https://github.com/dry-rb/dry-transformer/issues
|
84
54
|
post_install_message:
|
85
55
|
rdoc_options: []
|
86
56
|
require_paths:
|
@@ -89,7 +59,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
59
|
requirements:
|
90
60
|
- - ">="
|
91
61
|
- !ruby/object:Gem::Version
|
92
|
-
version: 2.
|
62
|
+
version: 2.4.0
|
93
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
64
|
requirements:
|
95
65
|
- - ">="
|
@@ -100,20 +70,4 @@ rubygems_version: 3.0.3
|
|
100
70
|
signing_key:
|
101
71
|
specification_version: 4
|
102
72
|
summary: Data transformation toolkit
|
103
|
-
test_files:
|
104
|
-
- spec/spec_helper.rb
|
105
|
-
- spec/unit/array/combine_spec.rb
|
106
|
-
- spec/unit/array_transformations_spec.rb
|
107
|
-
- spec/unit/class_transformations_spec.rb
|
108
|
-
- spec/unit/coercions_spec.rb
|
109
|
-
- spec/unit/conditional_spec.rb
|
110
|
-
- spec/unit/function_not_found_error_spec.rb
|
111
|
-
- spec/unit/function_spec.rb
|
112
|
-
- spec/unit/hash_transformations_spec.rb
|
113
|
-
- spec/unit/proc_transformations_spec.rb
|
114
|
-
- spec/unit/recursion_spec.rb
|
115
|
-
- spec/unit/registry_spec.rb
|
116
|
-
- spec/unit/store_spec.rb
|
117
|
-
- spec/unit/transformer/class_interface_spec.rb
|
118
|
-
- spec/unit/transformer/dsl_spec.rb
|
119
|
-
- spec/unit/transformer/instance_methods_spec.rb
|
73
|
+
test_files: []
|
data/.codeclimate.yml
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: "\U0001F41B Bug report"
|
3
|
-
about: See CONTRIBUTING.md for more information
|
4
|
-
title: ''
|
5
|
-
labels: bug
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
**Before you submit this: WE ONLY ACCEPT BUG REPORTS AND FEATURE REQUESTS**
|
11
|
-
|
12
|
-
For more information see `CONTRIBUTING.md`.
|
13
|
-
|
14
|
-
**Describe the bug**
|
15
|
-
|
16
|
-
A clear and concise description of what the bug is.
|
17
|
-
|
18
|
-
**To Reproduce**
|
19
|
-
|
20
|
-
Provide detailed steps to reproduce, an executable script would be best.
|
21
|
-
|
22
|
-
**Expected behavior**
|
23
|
-
|
24
|
-
A clear and concise description of what you expected to happen.
|
25
|
-
|
26
|
-
**Your environment**
|
27
|
-
|
28
|
-
- Affects my production application: **YES/NO**
|
29
|
-
- Ruby version: ...
|
30
|
-
- OS: ...
|
@@ -1,18 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: "\U0001F6E0 Feature request"
|
3
|
-
about: See CONTRIBUTING.md for more information
|
4
|
-
title: ''
|
5
|
-
labels: feature
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
Summary of what the feature is supposed to do.
|
11
|
-
|
12
|
-
## Examples
|
13
|
-
|
14
|
-
Code examples showing how the feature could be used.
|
15
|
-
|
16
|
-
## Resources
|
17
|
-
|
18
|
-
Additional information, like a link to the discussion forum thread where the feature was discussed etc.
|
@@ -1,66 +0,0 @@
|
|
1
|
-
# this file is managed by dry-rb/devtools project
|
2
|
-
|
3
|
-
name: ci
|
4
|
-
|
5
|
-
on:
|
6
|
-
push:
|
7
|
-
paths:
|
8
|
-
- .github/workflows/custom_ci.yml
|
9
|
-
- lib/**
|
10
|
-
- spec/**
|
11
|
-
- Gemfile
|
12
|
-
- "*.gemspec"
|
13
|
-
|
14
|
-
jobs:
|
15
|
-
tests-mri:
|
16
|
-
runs-on: ubuntu-latest
|
17
|
-
strategy:
|
18
|
-
fail-fast: false
|
19
|
-
matrix:
|
20
|
-
ruby: ["2.6.x", "2.5.x", "2.4.x"]
|
21
|
-
include:
|
22
|
-
- ruby: "2.6.x"
|
23
|
-
coverage: "true"
|
24
|
-
steps:
|
25
|
-
- uses: actions/checkout@v1
|
26
|
-
- name: Set up Ruby
|
27
|
-
uses: actions/setup-ruby@v1
|
28
|
-
with:
|
29
|
-
ruby-version: ${{matrix.ruby}}
|
30
|
-
- name: Download test reporter
|
31
|
-
if: "matrix.coverage == 'true'"
|
32
|
-
run: |
|
33
|
-
mkdir -p tmp/
|
34
|
-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
|
35
|
-
chmod +x ./tmp/cc-test-reporter
|
36
|
-
./tmp/cc-test-reporter before-build
|
37
|
-
- name: Bundle install
|
38
|
-
run: |
|
39
|
-
gem install bundler
|
40
|
-
bundle install --jobs 4 --retry 3 --without tools docs benchmarks
|
41
|
-
- name: Run all tests
|
42
|
-
env:
|
43
|
-
COVERAGE: ${{matrix.coverage}}
|
44
|
-
CODACY_PROJECT_TOKEN: ${{secrets.CODACY_PROJECT_TOKEN}}
|
45
|
-
CODACY_RUN_LOCAL: true
|
46
|
-
run: bundle exec rake
|
47
|
-
tests-others:
|
48
|
-
runs-on: ubuntu-latest
|
49
|
-
strategy:
|
50
|
-
fail-fast: false
|
51
|
-
matrix:
|
52
|
-
image: ["jruby:9.2.8", "ruby:rc"]
|
53
|
-
container:
|
54
|
-
image: ${{matrix.image}}
|
55
|
-
steps:
|
56
|
-
- uses: actions/checkout@v1
|
57
|
-
- name: Install git
|
58
|
-
run: |
|
59
|
-
apt-get update
|
60
|
-
apt-get install -y --no-install-recommends git
|
61
|
-
- name: Bundle install
|
62
|
-
run: |
|
63
|
-
gem install bundler
|
64
|
-
bundle install --jobs 4 --retry 3 --without tools docs benchmarks
|
65
|
-
- name: Run all tests
|
66
|
-
run: bundle exec rake
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# this file is managed by dry-rb/devtools project
|
2
|
-
|
3
|
-
name: docsite
|
4
|
-
|
5
|
-
on:
|
6
|
-
push:
|
7
|
-
paths:
|
8
|
-
- docsite/**
|
9
|
-
- .github/workflows/docsite.yml
|
10
|
-
branches:
|
11
|
-
- master
|
12
|
-
- release-**
|
13
|
-
tags:
|
14
|
-
|
15
|
-
jobs:
|
16
|
-
update-docs:
|
17
|
-
runs-on: ubuntu-latest
|
18
|
-
steps:
|
19
|
-
- uses: actions/checkout@v1
|
20
|
-
- name: Set up Ruby
|
21
|
-
uses: actions/setup-ruby@v1
|
22
|
-
with:
|
23
|
-
ruby-version: "2.6.x"
|
24
|
-
- name: Install dependencies
|
25
|
-
run: |
|
26
|
-
gem install bundler
|
27
|
-
bundle install --jobs 4 --retry 3 --without benchmarks sql
|
28
|
-
- name: Symlink ossy
|
29
|
-
run: mkdir -p bin && ln -sf "$(bundle show ossy)/bin/ossy" bin/ossy
|
30
|
-
- name: Trigger dry-rb.org deploy
|
31
|
-
env:
|
32
|
-
GITHUB_LOGIN: dry-bot
|
33
|
-
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
34
|
-
run: bin/ossy github workflow dry-rb/dry-rb.org ci
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# this file is managed by dry-rb/devtools project
|
2
|
-
|
3
|
-
name: sync_configs
|
4
|
-
|
5
|
-
on:
|
6
|
-
repository_dispatch:
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
sync-configs:
|
10
|
-
runs-on: ubuntu-latest
|
11
|
-
if: github.event.action == 'sync_configs'
|
12
|
-
steps:
|
13
|
-
- uses: actions/checkout@v1
|
14
|
-
- name: Update configuration files from devtools
|
15
|
-
env:
|
16
|
-
GITHUB_LOGIN: dry-bot
|
17
|
-
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
18
|
-
run: |
|
19
|
-
git clone https://github.com/dry-rb/devtools.git tmp/devtools
|
20
|
-
|
21
|
-
if [ -f ".github/workflows/custom_ci.yml" ]; then
|
22
|
-
rsync -av --exclude '.github/workflows/ci.yml' tmp/devtools/shared/ . ;
|
23
|
-
else
|
24
|
-
rsync -av tmp/devtools/shared/ . ;
|
25
|
-
fi
|
26
|
-
|
27
|
-
git config --local user.email "dry-bot@dry-rb.org"
|
28
|
-
git config --local user.name "dry-bot"
|
29
|
-
git add -A
|
30
|
-
git commit -m "[devtools] config sync" || echo "nothing changed"
|
31
|
-
- name: Push changes
|
32
|
-
uses: ad-m/github-push-action@master
|
33
|
-
with:
|
34
|
-
github_token: ${{ secrets.GH_PAT }}
|
data/.gitignore
DELETED
data/.rspec
DELETED