rom-mapper 0.4.0 → 0.5.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +12 -8
- data/CHANGELOG.md +6 -0
- data/Gemfile +3 -6
- 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 +3 -5
- 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 +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc36cb37b715080791a80214bc99a362c0c282ba
|
4
|
+
data.tar.gz: 0e9f82ed418e500fb6619e0f7f93253eae4a1f39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36b42cdbccc5f58da7b0f63450dc0742a98976067585efe29c5f80ee973ab36b4732dd89d77e4888d35e3c607c0ae02be30d36a0e03f79e1063f5c205314c209
|
7
|
+
data.tar.gz: 3aaac42b379591f1b7c8df610d0adeeae95027a79664fc991085f527023ffe1e78c3ab341abfedb4c27532bfad7deb036eead7431b57327721acc0a400fc225d
|
data/.travis.yml
CHANGED
@@ -1,24 +1,28 @@
|
|
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"
|
6
7
|
rvm:
|
7
|
-
- 2.0
|
8
|
-
- 2.
|
9
|
-
- 2.2.
|
10
|
-
- 2.
|
11
|
-
- rbx-
|
12
|
-
- jruby-
|
8
|
+
- 2.4.0
|
9
|
+
- 2.3.3
|
10
|
+
- 2.2.6
|
11
|
+
- 2.1.10
|
12
|
+
- rbx-3
|
13
|
+
- jruby-9.1.5.0
|
13
14
|
- ruby-head
|
14
|
-
|
15
|
+
after_success:
|
16
|
+
# Send coverage report from the job #1 == current MRI release
|
17
|
+
- '[ "${TRAVIS_JOB_NUMBER#*.}" = "1" ] && [ "$TRAVIS_BRANCH" = "master" ] && bundle exec codeclimate-test-reporter'
|
15
18
|
env:
|
16
19
|
global:
|
17
20
|
- JRUBY_OPTS='--dev -J-Xmx1024M'
|
18
21
|
matrix:
|
19
22
|
allow_failures:
|
20
23
|
- rvm: ruby-head
|
21
|
-
|
24
|
+
# Check out https://github.com/bundler/bundler/issues/5142
|
25
|
+
- rvm: rbx-3
|
22
26
|
notifications:
|
23
27
|
webhooks:
|
24
28
|
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/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'
|
17
|
+
gem.add_dependency 'dry-core', '~> 0.2.3'
|
19
18
|
gem.add_dependency 'transproc', '~> 0.4.0'
|
20
|
-
gem.add_dependency 'rom-support', '~> 2.0.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.beta1
|
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-09 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: 0.4.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: 0.4.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: []
|
@@ -134,9 +134,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
134
134
|
version: '0'
|
135
135
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- - "
|
137
|
+
- - ">"
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version:
|
139
|
+
version: 1.3.1
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project:
|
142
142
|
rubygems_version: 2.5.1
|