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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 888f5525802c8f106e5bd5432f4f03a6fa1a1e98
4
- data.tar.gz: 61a9c8cd3fe194d14bc96723db96f758a825e23f
3
+ metadata.gz: d856d3f0f48ec1c87fa98950912c1c06ba40154e
4
+ data.tar.gz: 6fb05c3118073812ed01e4319874cf83b214d92d
5
5
  SHA512:
6
- metadata.gz: 684566603982171e10278f29700ca6af5ac643356c6b0bf3953ade8603a4e4e40219e39d770441461f3efbd4f36e6001fd69ed23ec0a27c0138be767ad174133
7
- data.tar.gz: 3cd50d174a5472f67f34216e128d480ba3ad754650425b83cdee62d1bcdfede53a169dd9b3aa1f59f84bef002f463b7b1443b5fe5440bade4264b03912da614b
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.1
9
- - 2.2.5
10
- - 2.3.0
11
- - rbx-2
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: ruby-head
21
- - rvm: jruby-head
21
+ - rvm: rbx-3
22
+ - rvm: jruby
22
23
  notifications:
23
24
  webhooks:
24
25
  urls:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 0.5.0 to-be-released
2
+
3
+ ### Changed
4
+
5
+ * Drop rom-support dependency in favor of dry-core (flash-gordon)
6
+
7
+ [Compare v0.4.0..v0.5.0](https://github.com/rom-rb/rom-mapper/compare/v0.4.0...v0.5.0)
8
+
1
9
  # v0.4.0 2016-07-27
2
10
 
3
11
  ### 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.2.0'
6
+ gem 'anima', '~> 0.3.0'
9
7
  gem 'virtus'
10
8
  gem 'inflecto', '~> 0.0', '>= 0.0.2'
11
9
 
12
- platforms :rbx do
13
- gem 'codeclimate-test-reporter', require: false
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
- # ROM::Mapper
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.png)][gemnasium]
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]
@@ -1,4 +1,4 @@
1
- require 'rom/support/class_macros'
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(ClassMacros)
12
+ klass.extend(Dry::Core::ClassAttributes)
13
13
  klass.extend(ClassMethods)
14
14
  end
15
15
 
@@ -1,5 +1,5 @@
1
1
  module ROM
2
2
  class Mapper
3
- VERSION = '0.4.0'.freeze
3
+ VERSION = '0.5.0'.freeze
4
4
  end
5
5
  end
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 |header|
77
- processor.build(self, header)
78
+ @transformers = self.class.headers(header).map do |hdr|
79
+ processor.build(self, hdr)
78
80
  end
79
81
  @header = header
80
82
  end
@@ -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
@@ -1,5 +1,4 @@
1
1
  require 'dry-equalizer'
2
- require 'rom-support'
3
2
 
4
3
  require 'rom/mapper'
5
4
  require 'rom/processor/transproc'
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 'transproc', '~> 0.4.0'
20
- gem.add_dependency 'rom-support', '~> 2.0.0'
17
+ gem.add_dependency 'dry-core', '~> 0.2.3'
18
+ gem.add_dependency 'transproc', '~> 1.0'
21
19
 
22
- gem.add_development_dependency 'rake', '~> 10.3'
23
- gem.add_development_dependency 'rspec', '~> 3.3'
20
+ gem.add_development_dependency 'rake', '~> 11.3'
21
+ gem.add_development_dependency 'rspec', '~> 3.5'
24
22
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe ROM::Mapper do
3
+ RSpec.describe ROM::Mapper do
4
4
  let(:mapper_klass) do
5
5
  Class.new(ROM::Mapper).tap do |mapper_klass|
6
6
  mapper_klass.class_eval(&mapper_body)
data/spec/spec_helper.rb CHANGED
@@ -1,14 +1,14 @@
1
- # encoding: utf-8
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
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe ROM::Mapper do
3
+ RSpec.describe ROM::Mapper do
4
4
  subject(:mapper) do
5
5
  klass = Class.new(parent)
6
6
  options.each do |k, v|
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe ROM::Mapper::ModelDSL do
3
+ RSpec.describe ROM::Mapper::ModelDSL do
4
4
  describe '#model' do
5
5
  it 'calls the builder with non-excluded attributes only' do
6
6
  definition_class = Class.new do
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  require 'ostruct'
4
4
 
5
- describe ROM::Mapper do
5
+ RSpec.describe ROM::Mapper do
6
6
  subject(:mapper) { mapper_class.build }
7
7
 
8
8
  let(:mapper_class) do
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
  require 'virtus'
3
3
 
4
- describe ROM::Processor::Transproc do
4
+ RSpec.describe ROM::Processor::Transproc do
5
5
  subject(:transproc) { ROM::Processor::Transproc.build(binding, header) }
6
6
 
7
7
  let(:binding) { nil }
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.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: 2016-07-27 00:00:00.000000000 Z
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: transproc
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.4.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.4.0
40
+ version: 0.2.3
41
41
  - !ruby/object:Gem::Dependency
42
- name: rom-support
42
+ name: transproc
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.0.0
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: 2.0.0
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: '10.3'
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: '10.3'
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.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.3'
82
+ version: '3.5'
83
83
  description: ROM mapper component
84
84
  email: piotr.solnica@gmail.com
85
85
  executables: []