yaks 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/Rakefile +36 -35
- data/lib/yaks/errors.rb +5 -1
- data/lib/yaks/mapper/control.rb +3 -3
- data/lib/yaks/null_resource.rb +14 -16
- data/lib/yaks/primitivize.rb +1 -1
- data/lib/yaks/resource.rb +8 -0
- data/lib/yaks/stateful_builder.rb +1 -1
- data/lib/yaks/version.rb +1 -1
- data/spec/sanity_spec.rb +12 -0
- data/spec/unit/yaks/mapper/control/field_spec.rb +34 -0
- data/spec/unit/yaks/mapper/control_spec.rb +64 -0
- data/spec/unit/yaks/null_resource_spec.rb +24 -0
- data/spec/unit/yaks/resource_spec.rb +17 -0
- data/spec/unit/yaks/stateful_builder_spec.rb +1 -1
- metadata +126 -197
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e3e06127d1cd697d18b505ff5ad41339dd9a8aed
|
4
|
+
data.tar.gz: 1baa4ec8e9bff83521402c6d5d4abf2051aa40fa
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6b765ca5a52ca62961de8e9347971c145791c037305b918194d607edf2a472682a463c34ffa4138b77f12d3adf516b3be8b451e8c077c350224eac063e88683f
|
7
|
+
data.tar.gz: af5021b9f71423da48d7dcef534741dbfe13d6f205cdcd1df6afd4b32ad4bca0ef54e944773c35124c15e351cae94e16f19b2376d62b31480e5369344e8c8321
|
data/Rakefile
CHANGED
@@ -5,42 +5,43 @@ gem_tasks(:yaks)
|
|
5
5
|
|
6
6
|
task :mutant_chunked do
|
7
7
|
[
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
Yaks::Mapper::HasMany,
|
40
|
-
Yaks::Mapper::ClassMethods,
|
41
|
-
Yaks::Mapper::Association,
|
8
|
+
Yaks::Attributes,
|
9
|
+
Yaks::Attributes::InstanceMethods,
|
10
|
+
Yaks::CollectionMapper,
|
11
|
+
Yaks::CollectionResource,
|
12
|
+
Yaks::Config,
|
13
|
+
Yaks::Config::DSL,
|
14
|
+
Yaks::Configurable,
|
15
|
+
Yaks::Configurable::ClassMethods,
|
16
|
+
Yaks::StatefulBuilder,
|
17
|
+
Yaks::DefaultPolicy,
|
18
|
+
Yaks::FP,
|
19
|
+
Yaks::FP::Callable,
|
20
|
+
Yaks::Format,
|
21
|
+
Yaks::Format::CollectionJson,
|
22
|
+
Yaks::Format::Hal,
|
23
|
+
Yaks::Format::Halo,
|
24
|
+
Yaks::Format::JsonAPI,
|
25
|
+
Yaks::Mapper::AssociationMapper,
|
26
|
+
Yaks::Mapper::Attribute,
|
27
|
+
Yaks::Mapper::Config,
|
28
|
+
Yaks::Mapper::HasOne,
|
29
|
+
Yaks::Primitivize,
|
30
|
+
Yaks::Resource,
|
31
|
+
Yaks::Resource::Link,
|
32
|
+
Yaks::Util,
|
33
|
+
Yaks::Serializer,
|
34
|
+
Yaks::Runner,
|
35
|
+
Yaks::Mapper::Link,
|
36
|
+
Yaks::Mapper::HasMany,
|
37
|
+
Yaks::Mapper::ClassMethods,
|
38
|
+
Yaks::Mapper::Association,
|
42
39
|
Yaks::Mapper,
|
43
|
-
|
40
|
+
Yaks::Format::HTML,
|
41
|
+
Yaks::Mapper::Control,
|
42
|
+
Yaks::Mapper::Control::Field,
|
43
|
+
# Yaks::Resource::Control, #no subjects to mutate
|
44
|
+
Yaks::NullResource,
|
44
45
|
].each do |space|
|
45
46
|
puts space
|
46
47
|
ENV['PATTERN'] = "#{space}"
|
data/lib/yaks/errors.rb
CHANGED
data/lib/yaks/mapper/control.rb
CHANGED
@@ -12,7 +12,7 @@ module Yaks
|
|
12
12
|
|
13
13
|
def add_to_resource(resource, _parent_mapper, _context)
|
14
14
|
resource.add_control(
|
15
|
-
|
15
|
+
Resource::Control.new(to_h.merge(fields: fields.map(&:to_resource_control_field)))
|
16
16
|
)
|
17
17
|
end
|
18
18
|
|
@@ -20,7 +20,7 @@ module Yaks
|
|
20
20
|
include Attributes.new(:name, label: nil, type: "text", value: nil)
|
21
21
|
|
22
22
|
def self.create(*args)
|
23
|
-
attrs = args.last.
|
23
|
+
attrs = args.last.instance_of?(Hash) ? args.pop : {}
|
24
24
|
if name = args.shift
|
25
25
|
attrs = attrs.merge(name: name)
|
26
26
|
end
|
@@ -28,7 +28,7 @@ module Yaks
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def to_resource_control_field
|
31
|
-
|
31
|
+
Resource::Control::Field.new(to_h)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
data/lib/yaks/null_resource.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Yaks
|
2
|
-
class NullResource
|
2
|
+
class NullResource < Resource
|
3
3
|
include Equalizer.new(:collection?)
|
4
|
-
include Enumerable
|
5
4
|
|
6
5
|
def initialize(opts = {})
|
6
|
+
super()
|
7
7
|
@collection = opts.fetch(:collection) { false }
|
8
8
|
end
|
9
9
|
|
@@ -11,30 +11,28 @@ module Yaks
|
|
11
11
|
to_enum
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
def links
|
19
|
-
[]
|
14
|
+
def collection?
|
15
|
+
@collection
|
20
16
|
end
|
21
17
|
|
22
|
-
def
|
23
|
-
|
18
|
+
def null_resource?
|
19
|
+
true
|
24
20
|
end
|
25
21
|
|
26
|
-
def
|
22
|
+
def update_attributes(_new_attrs)
|
23
|
+
raise UnsupportedOperationError, "Operation #{__method__} not supported on #{self.class}"
|
27
24
|
end
|
28
25
|
|
29
|
-
def
|
26
|
+
def add_link(_link)
|
27
|
+
raise UnsupportedOperationError, "Operation #{__method__} not supported on #{self.class}"
|
30
28
|
end
|
31
29
|
|
32
|
-
def
|
33
|
-
|
30
|
+
def add_control(_control)
|
31
|
+
raise UnsupportedOperationError, "Operation #{__method__} not supported on #{self.class}"
|
34
32
|
end
|
35
33
|
|
36
|
-
def
|
37
|
-
|
34
|
+
def add_subresource(_rel, _subresource)
|
35
|
+
raise UnsupportedOperationError, "Operation #{__method__} not supported on #{self.class}"
|
38
36
|
end
|
39
37
|
end
|
40
38
|
end
|
data/lib/yaks/primitivize.rb
CHANGED
@@ -11,7 +11,7 @@ module Yaks
|
|
11
11
|
mappings.each do |pattern, block|
|
12
12
|
return instance_exec(object, &block) if pattern === object
|
13
13
|
end
|
14
|
-
raise "don't know how to turn #{object.class} (#{object.inspect}) into a primitive"
|
14
|
+
raise PrimitivizeError, "don't know how to turn #{object.class} (#{object.inspect}) into a primitive"
|
15
15
|
end
|
16
16
|
|
17
17
|
def map(*types, &blk)
|
data/lib/yaks/resource.rb
CHANGED
@@ -28,6 +28,14 @@ module Yaks
|
|
28
28
|
false
|
29
29
|
end
|
30
30
|
|
31
|
+
def collection_rel
|
32
|
+
raise UnsupportedOperationError, "Only Yaks::CollectionResource has a collection_rel"
|
33
|
+
end
|
34
|
+
|
35
|
+
def members
|
36
|
+
raise UnsupportedOperationError, "Only Yaks::CollectionResource has members"
|
37
|
+
end
|
38
|
+
|
31
39
|
def update_attributes(new_attrs)
|
32
40
|
update(attributes: @attributes.merge(new_attrs))
|
33
41
|
end
|
@@ -31,7 +31,7 @@ module Yaks
|
|
31
31
|
def validate_state(method_name, args)
|
32
32
|
unless @state.instance_of?(@klass)
|
33
33
|
::Kernel.raise(
|
34
|
-
|
34
|
+
IllegalStateError,
|
35
35
|
"#{@klass}##{method_name}(#{args.map(&:inspect).join(', ')}) "\
|
36
36
|
"returned #{@state.inspect}. Expected instance of #{@klass}"
|
37
37
|
)
|
data/lib/yaks/version.rb
CHANGED
data/spec/sanity_spec.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe 'assorted sanity checks' do
|
4
|
+
let(:resource_methods) { Yaks::Resource.public_instance_methods.sort }
|
5
|
+
let(:collection_resource_methods) { Yaks::CollectionResource.public_instance_methods.sort }
|
6
|
+
let(:null_resource_methods) { Yaks::NullResource.public_instance_methods.sort }
|
7
|
+
|
8
|
+
specify 'all resource classes should have the exact same public API' do
|
9
|
+
expect(resource_methods).to eql null_resource_methods
|
10
|
+
expect(resource_methods).to eql collection_resource_methods
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Yaks::Mapper::Control::Field do
|
4
|
+
let(:field) { described_class.new( full_args ) }
|
5
|
+
let(:name) { :the_field }
|
6
|
+
let(:full_args) { {name: name}.merge(args) }
|
7
|
+
let(:args) {
|
8
|
+
{
|
9
|
+
label: 'a label',
|
10
|
+
type: 'text',
|
11
|
+
value: 'hello'
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
describe '.create' do
|
16
|
+
it 'can take all args as a hash' do
|
17
|
+
expect(described_class.create(full_args)).to eql described_class.new(full_args)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'can take a name as a positional arg' do
|
21
|
+
expect(described_class.create(name, args)).to eql described_class.new(full_args)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'can take only a name' do
|
25
|
+
expect(described_class.create(name)).to eql described_class.new(name: :the_field)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'to_resource_field' do
|
30
|
+
it 'creates a Yaks::Resource::Control::Field with the same attributes' do
|
31
|
+
expect(field.to_resource_control_field).to eql Yaks::Resource::Control::Field.new(full_args)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Yaks::Mapper::Control do
|
4
|
+
let(:control) { described_class.new( full_args ) }
|
5
|
+
let(:name) { :the_name }
|
6
|
+
let(:full_args) { {name: name}.merge(args) }
|
7
|
+
let(:args) {
|
8
|
+
{
|
9
|
+
href: '/foo',
|
10
|
+
title: 'a title',
|
11
|
+
method: 'PATCH',
|
12
|
+
media_type: 'application/hal+json',
|
13
|
+
fields: fields
|
14
|
+
}
|
15
|
+
}
|
16
|
+
let(:fields) { [] }
|
17
|
+
|
18
|
+
describe '.create' do
|
19
|
+
it 'should create an instance, first arg is the name' do
|
20
|
+
|
21
|
+
expect( described_class.create(name, args) ).to eql control
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'should have a name of nil when ommitted' do
|
25
|
+
expect(described_class.create.name).to be_nil
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#add_to_resource' do
|
30
|
+
let(:resource) { control.add_to_resource(Yaks::Resource.new, nil, nil) }
|
31
|
+
|
32
|
+
it 'should add a control to the resource' do
|
33
|
+
expect(resource.controls.length).to be 1
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'should create a Yaks::Resource::Control with corresponding fields' do
|
37
|
+
expect(resource.controls.first).to eql Yaks::Resource::Control.new( full_args )
|
38
|
+
end
|
39
|
+
|
40
|
+
context 'with fields' do
|
41
|
+
let(:fields) {
|
42
|
+
[
|
43
|
+
Yaks::Mapper::Control::Field.new(
|
44
|
+
name: 'field name',
|
45
|
+
label: 'field label',
|
46
|
+
type: 'text',
|
47
|
+
value: 7
|
48
|
+
)
|
49
|
+
]
|
50
|
+
}
|
51
|
+
|
52
|
+
it 'should map to Yaks::Resource::Control::Field instances' do
|
53
|
+
expect(resource.controls.first.fields).to eql [
|
54
|
+
Yaks::Resource::Control::Field.new(
|
55
|
+
name: 'field name',
|
56
|
+
label: 'field label',
|
57
|
+
type: 'text',
|
58
|
+
value: 7
|
59
|
+
)
|
60
|
+
]
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -29,4 +29,28 @@ RSpec.describe Yaks::NullResource do
|
|
29
29
|
subject(:null_resource) { described_class.new( collection: true ) }
|
30
30
|
its(:collection?) { should be true }
|
31
31
|
end
|
32
|
+
|
33
|
+
it 'should not allow updating attributes' do
|
34
|
+
expect { null_resource.update_attributes({}) }.to raise_error(
|
35
|
+
Yaks::UnsupportedOperationError, "Operation update_attributes not supported on Yaks::NullResource"
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'should not allow adding links' do
|
40
|
+
expect { null_resource.add_link(nil) }.to raise_error(
|
41
|
+
Yaks::UnsupportedOperationError, "Operation add_link not supported on Yaks::NullResource"
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'should not allow adding controls' do
|
46
|
+
expect { null_resource.add_control(nil) }.to raise_error(
|
47
|
+
Yaks::UnsupportedOperationError, "Operation add_control not supported on Yaks::NullResource"
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'should not allow adding subresources' do
|
52
|
+
expect { null_resource.add_subresource(nil, nil) }.to raise_error(
|
53
|
+
Yaks::UnsupportedOperationError, "Operation add_subresource not supported on Yaks::NullResource"
|
54
|
+
)
|
55
|
+
end
|
32
56
|
end
|
@@ -112,4 +112,21 @@ RSpec.describe Yaks::Resource do
|
|
112
112
|
.to eq Yaks::Resource.new(controls: [:a_control])
|
113
113
|
end
|
114
114
|
end
|
115
|
+
|
116
|
+
describe '#collection_rel' do
|
117
|
+
it 'should raise unsupported operation error' do
|
118
|
+
expect { resource.collection_rel }.to raise_error(
|
119
|
+
Yaks::UnsupportedOperationError, "Only Yaks::CollectionResource has a collection_rel"
|
120
|
+
)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
describe '#members' do
|
125
|
+
it 'should raise unsupported operation error' do
|
126
|
+
expect { resource.members }.to raise_error(
|
127
|
+
Yaks::UnsupportedOperationError, "Only Yaks::CollectionResource has members"
|
128
|
+
)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
115
132
|
end
|
@@ -35,7 +35,7 @@ RSpec.describe Yaks::StatefulBuilder do
|
|
35
35
|
|
36
36
|
describe 'kind_of?' do
|
37
37
|
it 'should test if the returned thing is of the right type' do
|
38
|
-
expect { subject.create(3, 4) { wrong_type(1,'2') }}.to raise_exception Yaks::
|
38
|
+
expect { subject.create(3, 4) { wrong_type(1,'2') }}.to raise_exception Yaks::IllegalStateError, 'Buildable#wrong_type(1, "2") returned "foo 1 2". Expected instance of Buildable'
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
metadata
CHANGED
@@ -1,247 +1,171 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaks
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Arne Brasseur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
|
12
|
+
date: 2014-10-30 00:00:00 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: "1.0"
|
14
20
|
name: inflection
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.0'
|
20
21
|
type: :runtime
|
22
|
+
requirement: *id001
|
21
23
|
prerelease: false
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: concord
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
24
|
+
- !ruby/object:Gem::Dependency
|
25
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
33
29
|
version: 0.1.4
|
30
|
+
name: concord
|
34
31
|
type: :runtime
|
32
|
+
requirement: *id002
|
35
33
|
prerelease: false
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: uri_template
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ~>
|
38
|
+
- !ruby/object:Gem::Version
|
47
39
|
version: 0.6.0
|
40
|
+
name: uri_template
|
48
41
|
type: :runtime
|
42
|
+
requirement: *id003
|
49
43
|
prerelease: false
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rack-accept
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ~>
|
48
|
+
- !ruby/object:Gem::Version
|
61
49
|
version: 0.4.5
|
50
|
+
name: rack-accept
|
62
51
|
type: :runtime
|
52
|
+
requirement: *id004
|
63
53
|
prerelease: false
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: anima
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ~>
|
58
|
+
- !ruby/object:Gem::Version
|
75
59
|
version: 0.2.0
|
60
|
+
name: anima
|
76
61
|
type: :runtime
|
62
|
+
requirement: *id005
|
77
63
|
prerelease: false
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
82
69
|
version: 0.2.0
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
70
|
name: adamantium
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 0.2.0
|
90
71
|
type: :runtime
|
72
|
+
requirement: *id006
|
91
73
|
prerelease: false
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
- !ruby/object:Gem::
|
74
|
+
- !ruby/object:Gem::Dependency
|
75
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- &id009
|
78
|
+
- ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: "0"
|
98
81
|
name: virtus
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
82
|
type: :development
|
83
|
+
requirement: *id007
|
105
84
|
prerelease: false
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ~>
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: "3.0"
|
112
91
|
name: rspec
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '3.0'
|
118
92
|
type: :development
|
93
|
+
requirement: *id008
|
119
94
|
prerelease: false
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
version: '3.0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- *id009
|
126
99
|
name: bogus
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
100
|
type: :development
|
101
|
+
requirement: *id010
|
133
102
|
prerelease: false
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- *id009
|
140
107
|
name: rake
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
108
|
type: :development
|
109
|
+
requirement: *id011
|
147
110
|
prerelease: false
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
version_requirements: &id012 !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- *id009
|
154
115
|
name: yard
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
116
|
type: :development
|
117
|
+
requirement: *id012
|
161
118
|
prerelease: false
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
version: '0'
|
167
|
-
- !ruby/object:Gem::Dependency
|
119
|
+
- !ruby/object:Gem::Dependency
|
120
|
+
version_requirements: &id013 !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- *id009
|
168
123
|
name: mutant-rspec
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - ">="
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '0'
|
174
124
|
type: :development
|
125
|
+
requirement: *id013
|
175
126
|
prerelease: false
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
version: '0'
|
181
|
-
- !ruby/object:Gem::Dependency
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
version_requirements: &id014 !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- *id009
|
182
131
|
name: mutant
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - ">="
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: '0'
|
188
132
|
type: :development
|
133
|
+
requirement: *id014
|
189
134
|
prerelease: false
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
version: '0'
|
195
|
-
- !ruby/object:Gem::Dependency
|
135
|
+
- !ruby/object:Gem::Dependency
|
136
|
+
version_requirements: &id015 !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- *id009
|
196
139
|
name: rspec-its
|
197
|
-
requirement: !ruby/object:Gem::Requirement
|
198
|
-
requirements:
|
199
|
-
- - ">="
|
200
|
-
- !ruby/object:Gem::Version
|
201
|
-
version: '0'
|
202
140
|
type: :development
|
141
|
+
requirement: *id015
|
203
142
|
prerelease: false
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
version: '0'
|
209
|
-
- !ruby/object:Gem::Dependency
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
version_requirements: &id016 !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- *id009
|
210
147
|
name: benchmark-ips
|
211
|
-
requirement: !ruby/object:Gem::Requirement
|
212
|
-
requirements:
|
213
|
-
- - ">="
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
version: '0'
|
216
148
|
type: :development
|
149
|
+
requirement: *id016
|
217
150
|
prerelease: false
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
version: '0'
|
223
|
-
- !ruby/object:Gem::Dependency
|
151
|
+
- !ruby/object:Gem::Dependency
|
152
|
+
version_requirements: &id017 !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- *id009
|
224
155
|
name: yaks-html
|
225
|
-
requirement: !ruby/object:Gem::Requirement
|
226
|
-
requirements:
|
227
|
-
- - ">="
|
228
|
-
- !ruby/object:Gem::Version
|
229
|
-
version: '0'
|
230
156
|
type: :development
|
157
|
+
requirement: *id017
|
231
158
|
prerelease: false
|
232
|
-
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
requirements:
|
234
|
-
- - ">="
|
235
|
-
- !ruby/object:Gem::Version
|
236
|
-
version: '0'
|
237
159
|
description: Serialize to hypermedia. HAL, JSON-API, etc.
|
238
|
-
email:
|
160
|
+
email:
|
239
161
|
- arne@arnebrasseur.net
|
240
162
|
executables: []
|
163
|
+
|
241
164
|
extensions: []
|
242
|
-
|
165
|
+
|
166
|
+
extra_rdoc_files:
|
243
167
|
- README.md
|
244
|
-
files:
|
168
|
+
files:
|
245
169
|
- README.md
|
246
170
|
- Rakefile
|
247
171
|
- lib/yaks.rb
|
@@ -294,6 +218,7 @@ files:
|
|
294
218
|
- spec/json/plant_collection.collection.json
|
295
219
|
- spec/json/plant_collection.hal.json
|
296
220
|
- spec/json/youtypeitwepostit.collection.json
|
221
|
+
- spec/sanity_spec.rb
|
297
222
|
- spec/spec_helper.rb
|
298
223
|
- spec/support/classes_for_policy_testing.rb
|
299
224
|
- spec/support/deep_eql.rb
|
@@ -324,6 +249,8 @@ files:
|
|
324
249
|
- spec/unit/yaks/mapper/attribute_spec.rb
|
325
250
|
- spec/unit/yaks/mapper/class_methods_spec.rb
|
326
251
|
- spec/unit/yaks/mapper/config_spec.rb
|
252
|
+
- spec/unit/yaks/mapper/control/field_spec.rb
|
253
|
+
- spec/unit/yaks/mapper/control_spec.rb
|
327
254
|
- spec/unit/yaks/mapper/has_many_spec.rb
|
328
255
|
- spec/unit/yaks/mapper/has_one_spec.rb
|
329
256
|
- spec/unit/yaks/mapper/link_spec.rb
|
@@ -340,30 +267,29 @@ files:
|
|
340
267
|
- spec/yaml/youtypeitwepostit.yaml
|
341
268
|
- yaks.gemspec
|
342
269
|
homepage: https://github.com/plexus/yaks
|
343
|
-
licenses:
|
270
|
+
licenses:
|
344
271
|
- MIT
|
345
272
|
metadata: {}
|
273
|
+
|
346
274
|
post_install_message:
|
347
275
|
rdoc_options: []
|
348
|
-
|
276
|
+
|
277
|
+
require_paths:
|
349
278
|
- lib
|
350
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
351
|
-
requirements:
|
352
|
-
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
requirements:
|
357
|
-
- - ">="
|
358
|
-
- !ruby/object:Gem::Version
|
359
|
-
version: '0'
|
279
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
280
|
+
requirements:
|
281
|
+
- *id009
|
282
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
283
|
+
requirements:
|
284
|
+
- *id009
|
360
285
|
requirements: []
|
286
|
+
|
361
287
|
rubyforge_project:
|
362
288
|
rubygems_version: 2.2.2
|
363
289
|
signing_key:
|
364
290
|
specification_version: 4
|
365
291
|
summary: Serialize to hypermedia. HAL, JSON-API, etc.
|
366
|
-
test_files:
|
292
|
+
test_files:
|
367
293
|
- spec/acceptance/acceptance_spec.rb
|
368
294
|
- spec/acceptance/json_shared_examples.rb
|
369
295
|
- spec/acceptance/models.rb
|
@@ -377,6 +303,7 @@ test_files:
|
|
377
303
|
- spec/json/plant_collection.collection.json
|
378
304
|
- spec/json/plant_collection.hal.json
|
379
305
|
- spec/json/youtypeitwepostit.collection.json
|
306
|
+
- spec/sanity_spec.rb
|
380
307
|
- spec/spec_helper.rb
|
381
308
|
- spec/support/classes_for_policy_testing.rb
|
382
309
|
- spec/support/deep_eql.rb
|
@@ -407,6 +334,8 @@ test_files:
|
|
407
334
|
- spec/unit/yaks/mapper/attribute_spec.rb
|
408
335
|
- spec/unit/yaks/mapper/class_methods_spec.rb
|
409
336
|
- spec/unit/yaks/mapper/config_spec.rb
|
337
|
+
- spec/unit/yaks/mapper/control/field_spec.rb
|
338
|
+
- spec/unit/yaks/mapper/control_spec.rb
|
410
339
|
- spec/unit/yaks/mapper/has_many_spec.rb
|
411
340
|
- spec/unit/yaks/mapper/has_one_spec.rb
|
412
341
|
- spec/unit/yaks/mapper/link_spec.rb
|