rom 3.2.0 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/CHANGELOG.md +9 -1
- data/lib/rom/command.rb +13 -0
- data/lib/rom/schema/attribute.rb +6 -8
- data/lib/rom/version.rb +1 -1
- data/spec/spec_helper.rb +10 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46b1295151bfce6eb65ba6ddc43c38ec02891a6b
|
4
|
+
data.tar.gz: 00b551e3af83e06ca2b47e2cc341713f9c21412f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 861f80190d88eb5946cc620557bae2ffff484abc46b7177f20c5e6a4dbc9c34e7e223db27705f55360587422f51776904a439e9610703b6ab57c60f45b09885c
|
7
|
+
data.tar.gz: 731b82c742dedeb3c05f71b88703c6327d057bf55f8e6a2539738c5790a70ea695b269b93b645c1785efb92acf22e2bd9788f55a428151d0104ddc648001af24
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,16 @@
|
|
1
|
+
# v3.2.1 2017-05-02
|
2
|
+
|
3
|
+
## Changed
|
4
|
+
|
5
|
+
* `ROM::Schema::Attribute` uses `Initializer` now (flash-gordon)
|
6
|
+
|
7
|
+
[Compare v3.2.0...v3.2.1](https://github.com/rom-rb/rom/compare/v3.2.0...v3.2.1)
|
8
|
+
|
1
9
|
# v3.2.0 2017-03-25
|
2
10
|
|
3
11
|
## Changed
|
4
12
|
|
5
|
-
* `dry-initializer` was updated to `1.3`, this is a minor change, but leads to some
|
13
|
+
* `dry-initializer` was updated to `1.3`, this is a minor change, but leads to some incompatibilities with existing adapters, hence `3.2.0` shall be released (flash-gordon)
|
6
14
|
|
7
15
|
[Compare v3.1.0...v3.2.0](https://github.com/rom-rb/rom/compare/v3.1.0...v3.2.0)
|
8
16
|
|
data/lib/rom/command.rb
CHANGED
@@ -471,5 +471,18 @@ module ROM
|
|
471
471
|
end
|
472
472
|
end
|
473
473
|
end
|
474
|
+
|
475
|
+
# Pipes a dataset through command's relation
|
476
|
+
#
|
477
|
+
# @return [Array]
|
478
|
+
#
|
479
|
+
# @api private
|
480
|
+
def wrap_dataset(dataset)
|
481
|
+
if relation.is_a?(Relation::Composite)
|
482
|
+
relation.new(dataset).to_a
|
483
|
+
else
|
484
|
+
dataset
|
485
|
+
end
|
486
|
+
end
|
474
487
|
end
|
475
488
|
end
|
data/lib/rom/schema/attribute.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'delegate'
|
2
2
|
require 'dry/equalizer'
|
3
3
|
require 'dry/types/decorator'
|
4
|
+
require 'rom/initializer'
|
4
5
|
|
5
6
|
module ROM
|
6
7
|
class Schema
|
@@ -14,16 +15,13 @@ module ROM
|
|
14
15
|
#
|
15
16
|
# @api public
|
16
17
|
class Attribute
|
17
|
-
include Dry::Equalizer(:type)
|
18
|
+
include Dry::Equalizer(:type, :options)
|
19
|
+
|
20
|
+
extend Initializer
|
18
21
|
|
19
22
|
# !@attribute [r] type
|
20
23
|
# @return [Dry::Types::Definition, Dry::Types::Sum, Dry::Types::Constrained]
|
21
|
-
|
22
|
-
|
23
|
-
# @api private
|
24
|
-
def initialize(type)
|
25
|
-
@type = type
|
26
|
-
end
|
24
|
+
param :type
|
27
25
|
|
28
26
|
# @api private
|
29
27
|
def [](input)
|
@@ -379,7 +377,7 @@ module ROM
|
|
379
377
|
response = type.__send__(meth, *args, &block)
|
380
378
|
|
381
379
|
if response.is_a?(type.class)
|
382
|
-
self.class.new(type)
|
380
|
+
self.class.new(type, options)
|
383
381
|
else
|
384
382
|
response
|
385
383
|
end
|
data/lib/rom/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
if
|
2
|
-
require
|
3
|
-
|
4
|
-
|
1
|
+
if RUBY_ENGINE == 'ruby' && ENV['COVERAGE'] == 'true'
|
2
|
+
require 'yaml'
|
3
|
+
rubies = YAML.load(File.read(File.join(__dir__, '..', '.travis.yml')))['rvm']
|
4
|
+
latest_mri = rubies.select { |v| v =~ /\A\d+\.\d+.\d+\z/ }.max
|
5
|
+
|
6
|
+
if RUBY_VERSION == latest_mri
|
7
|
+
require 'simplecov'
|
8
|
+
SimpleCov.start do
|
9
|
+
add_filter '/spec/'
|
10
|
+
end
|
5
11
|
end
|
6
12
|
end
|
7
13
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.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: 2017-
|
11
|
+
date: 2017-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -394,7 +394,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
394
394
|
version: '0'
|
395
395
|
requirements: []
|
396
396
|
rubyforge_project:
|
397
|
-
rubygems_version: 2.6.
|
397
|
+
rubygems_version: 2.6.11
|
398
398
|
signing_key:
|
399
399
|
specification_version: 4
|
400
400
|
summary: Ruby Object Mapper
|