rom-mapper 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +11 -10
- data/CHANGELOG.md +8 -0
- data/Gemfile +3 -6
- data/README.md +2 -2
- data/lib/rom/mapper/dsl.rb +2 -2
- data/lib/rom/mapper/version.rb +1 -1
- data/lib/rom/mapper.rb +4 -2
- data/lib/rom/model_builder.rb +3 -1
- data/lib/rom-mapper.rb +0 -1
- data/rom-mapper.gemspec +4 -6
- data/spec/integration/mapper_spec.rb +1 -1
- data/spec/spec_helper.rb +10 -6
- data/spec/unit/rom/mapper/dsl_spec.rb +1 -1
- data/spec/unit/rom/mapper/model_dsl_spec.rb +1 -1
- data/spec/unit/rom/mapper_spec.rb +1 -1
- data/spec/unit/rom/processor/transproc_spec.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d856d3f0f48ec1c87fa98950912c1c06ba40154e
|
4
|
+
data.tar.gz: 6fb05c3118073812ed01e4319874cf83b214d92d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c95fab1d8d21c28649e5fa1b041fd4ad13629a53bbc638521b3289b26c3aaeadcc7339b8bd69bddc40c12e6494197023dfe09d9b579cf94b52b13339a87e636b
|
7
|
+
data.tar.gz: 3c4921da1bf4090d4e03a6c842d7c491545bb19b259d0719c875e8b5066a43ebef4a0027fa9d7e38d45873efbfc91c3eb339af40965810d1c981bb2527fee280
|
data/.travis.yml
CHANGED
@@ -1,24 +1,25 @@
|
|
1
1
|
language: ruby
|
2
|
+
dist: trusty
|
2
3
|
sudo: false
|
3
4
|
cache: bundler
|
4
5
|
bundler_args: --without sql benchmarks console tools
|
5
6
|
script: "bundle exec rake ci"
|
7
|
+
after_success:
|
8
|
+
# Send coverage report from the job #1 == current MRI release
|
9
|
+
- '[ "${TRAVIS_JOB_NUMBER#*.}" = "1" ] && [ "$TRAVIS_BRANCH" = "master" ] && bundle exec codeclimate-test-reporter'
|
6
10
|
rvm:
|
7
|
-
- 2.0
|
8
|
-
- 2.
|
9
|
-
- 2.2
|
10
|
-
-
|
11
|
-
-
|
12
|
-
- jruby-9000
|
13
|
-
- ruby-head
|
14
|
-
- jruby-head
|
11
|
+
- 2.4.0
|
12
|
+
- 2.3
|
13
|
+
- 2.2
|
14
|
+
- rbx-3
|
15
|
+
- jruby
|
15
16
|
env:
|
16
17
|
global:
|
17
18
|
- JRUBY_OPTS='--dev -J-Xmx1024M'
|
18
19
|
matrix:
|
19
20
|
allow_failures:
|
20
|
-
- rvm:
|
21
|
-
- rvm: jruby
|
21
|
+
- rvm: rbx-3
|
22
|
+
- rvm: jruby
|
22
23
|
notifications:
|
23
24
|
webhooks:
|
24
25
|
urls:
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -2,16 +2,13 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem 'rom-support', github: 'rom-rb/rom-support', branch: 'master'
|
6
|
-
|
7
5
|
group :test do
|
8
|
-
gem 'anima', '~> 0.
|
6
|
+
gem 'anima', '~> 0.3.0'
|
9
7
|
gem 'virtus'
|
10
8
|
gem 'inflecto', '~> 0.0', '>= 0.0.2'
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
10
|
+
gem 'codeclimate-test-reporter', require: false
|
11
|
+
gem 'simplecov', require: false
|
15
12
|
end
|
16
13
|
|
17
14
|
group :benchmarks do
|
data/README.md
CHANGED
@@ -4,11 +4,11 @@
|
|
4
4
|
[codeclimate]: https://codeclimate.com/github/rom-rb/rom-mapper
|
5
5
|
[inchpages]: http://inch-ci.org/github/rom-rb/rom-mapper
|
6
6
|
|
7
|
-
#
|
7
|
+
# rom-mapper
|
8
8
|
|
9
9
|
[![Gem Version](https://badge.fury.io/rb/rom-mapper.svg)][gem]
|
10
10
|
[![Build Status](https://travis-ci.org/rom-rb/rom-mapper.svg?branch=master)][travis]
|
11
|
-
[![Dependency Status](https://gemnasium.com/rom-rb/rom-mapper.
|
11
|
+
[![Dependency Status](https://gemnasium.com/rom-rb/rom-mapper.svg)][gemnasium]
|
12
12
|
[![Code Climate](https://codeclimate.com/github/rom-rb/rom-mapper/badges/gpa.svg)][codeclimate]
|
13
13
|
[![Test Coverage](https://codeclimate.com/github/rom-rb/rom-mapper/badges/coverage.svg)][codeclimate]
|
14
14
|
[![Inline docs](http://inch-ci.org/github/rom-rb/rom-mapper.svg?branch=master)][inchpages]
|
data/lib/rom/mapper/dsl.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'dry/core/class_attributes'
|
2
2
|
require 'rom/mapper/attribute_dsl'
|
3
3
|
|
4
4
|
module ROM
|
@@ -9,7 +9,7 @@ module ROM
|
|
9
9
|
#
|
10
10
|
# @api private
|
11
11
|
def self.included(klass)
|
12
|
-
klass.extend(
|
12
|
+
klass.extend(Dry::Core::ClassAttributes)
|
13
13
|
klass.extend(ClassMethods)
|
14
14
|
end
|
15
15
|
|
data/lib/rom/mapper/version.rb
CHANGED
data/lib/rom/mapper.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'dry/core/constants'
|
1
2
|
require 'rom/mapper/dsl'
|
2
3
|
|
3
4
|
module ROM
|
@@ -5,6 +6,7 @@ module ROM
|
|
5
6
|
#
|
6
7
|
# @private
|
7
8
|
class Mapper
|
9
|
+
include Dry::Core::Constants
|
8
10
|
include DSL
|
9
11
|
include Dry::Equalizer(:transformers, :header)
|
10
12
|
|
@@ -73,8 +75,8 @@ module ROM
|
|
73
75
|
# @api private
|
74
76
|
def initialize(header, processor = :transproc)
|
75
77
|
processor = Mapper.processors.fetch(processor)
|
76
|
-
@transformers = self.class.headers(header).map do |
|
77
|
-
processor.build(self,
|
78
|
+
@transformers = self.class.headers(header).map do |hdr|
|
79
|
+
processor.build(self, hdr)
|
78
80
|
end
|
79
81
|
@header = header
|
80
82
|
end
|
data/lib/rom/model_builder.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'dry/core/inflector'
|
2
|
+
|
1
3
|
module ROM
|
2
4
|
# Model builders can be used to build model classes for mappers
|
3
5
|
#
|
@@ -52,7 +54,7 @@ module ROM
|
|
52
54
|
|
53
55
|
@namespace =
|
54
56
|
if parts.any?
|
55
|
-
Inflector.constantize(parts.join('::'))
|
57
|
+
Dry::Core::Inflector.constantize(parts.join('::'))
|
56
58
|
else
|
57
59
|
Object
|
58
60
|
end
|
data/lib/rom-mapper.rb
CHANGED
data/rom-mapper.gemspec
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
require File.expand_path('../lib/rom/mapper/version', __FILE__)
|
4
2
|
|
5
3
|
Gem::Specification.new do |gem|
|
@@ -16,9 +14,9 @@ Gem::Specification.new do |gem|
|
|
16
14
|
gem.license = 'MIT'
|
17
15
|
|
18
16
|
gem.add_dependency 'dry-equalizer', '~> 0.2'
|
19
|
-
gem.add_dependency '
|
20
|
-
gem.add_dependency '
|
17
|
+
gem.add_dependency 'dry-core', '~> 0.2.3'
|
18
|
+
gem.add_dependency 'transproc', '~> 1.0'
|
21
19
|
|
22
|
-
gem.add_development_dependency 'rake', '~>
|
23
|
-
gem.add_development_dependency 'rspec', '~> 3.
|
20
|
+
gem.add_development_dependency 'rake', '~> 11.3'
|
21
|
+
gem.add_development_dependency 'rspec', '~> 3.5'
|
24
22
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
|
1
|
+
if RUBY_ENGINE == 'ruby' && ENV['CI'] == 'true'
|
2
|
+
require 'simplecov'
|
3
|
+
SimpleCov.start do
|
4
|
+
add_filter '/spec/'
|
5
|
+
end
|
6
|
+
end
|
2
7
|
|
3
8
|
# this is needed for guard to work, not sure why :(
|
4
9
|
require "bundler"
|
5
10
|
Bundler.setup
|
6
11
|
|
7
|
-
if RUBY_ENGINE == "rbx"
|
8
|
-
require "codeclimate-test-reporter"
|
9
|
-
CodeClimate::TestReporter.start
|
10
|
-
end
|
11
|
-
|
12
12
|
require 'rom-mapper'
|
13
13
|
|
14
14
|
begin
|
@@ -44,4 +44,8 @@ RSpec.configure do |config|
|
|
44
44
|
config.around do |example|
|
45
45
|
ConstantLeakFinder.find(example)
|
46
46
|
end
|
47
|
+
|
48
|
+
config.disable_monkey_patching!
|
49
|
+
|
50
|
+
config.warnings = true
|
47
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rom-mapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
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: 2017-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-equalizer
|
@@ -25,61 +25,61 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: dry-core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.2.3
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.2.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: transproc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '1.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '1.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '11.3'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '11.3'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '3.
|
75
|
+
version: '3.5'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '3.
|
82
|
+
version: '3.5'
|
83
83
|
description: ROM mapper component
|
84
84
|
email: piotr.solnica@gmail.com
|
85
85
|
executables: []
|