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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 888f5525802c8f106e5bd5432f4f03a6fa1a1e98
4
- data.tar.gz: 61a9c8cd3fe194d14bc96723db96f758a825e23f
3
+ metadata.gz: dc36cb37b715080791a80214bc99a362c0c282ba
4
+ data.tar.gz: 0e9f82ed418e500fb6619e0f7f93253eae4a1f39
5
5
  SHA512:
6
- metadata.gz: 684566603982171e10278f29700ca6af5ac643356c6b0bf3953ade8603a4e4e40219e39d770441461f3efbd4f36e6001fd69ed23ec0a27c0138be767ad174133
7
- data.tar.gz: 3cd50d174a5472f67f34216e128d480ba3ad754650425b83cdee62d1bcdfede53a169dd9b3aa1f59f84bef002f463b7b1443b5fe5440bade4264b03912da614b
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.1
9
- - 2.2.5
10
- - 2.3.0
11
- - rbx-2
12
- - jruby-9000
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
- - jruby-head
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
- - rvm: jruby-head
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
@@ -1,3 +1,9 @@
1
+ # to-be-released
2
+
3
+ ### Changed
4
+
5
+ * Drop rom-support dependency in favor of dry-core (flash-gordon)
6
+
1
7
  # v0.4.0 2016-07-27
2
8
 
3
9
  ### 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
@@ -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.beta1'.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'
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', '~> 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.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: 2016-07-27 00:00:00.000000000 Z
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: 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: 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: 2.0.0
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: '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: []
@@ -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: '0'
139
+ version: 1.3.1
140
140
  requirements: []
141
141
  rubyforge_project:
142
142
  rubygems_version: 2.5.1