yaks 0.6.0.alpha → 0.6.0.alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -41
  3. data/{yaks/lib → lib}/yaks/breaking_changes.rb +0 -0
  4. data/{yaks/lib → lib}/yaks/collection_mapper.rb +0 -0
  5. data/{yaks/lib → lib}/yaks/collection_resource.rb +0 -0
  6. data/{yaks/lib → lib}/yaks/config/dsl.rb +0 -0
  7. data/{yaks/lib → lib}/yaks/config.rb +0 -0
  8. data/{yaks/lib → lib}/yaks/default_policy.rb +0 -0
  9. data/{yaks/lib → lib}/yaks/format/collection_json.rb +0 -0
  10. data/{yaks/lib → lib}/yaks/format/hal.rb +0 -0
  11. data/{yaks/lib → lib}/yaks/format/json_api.rb +0 -0
  12. data/{yaks/lib → lib}/yaks/format.rb +0 -0
  13. data/{yaks/lib → lib}/yaks/fp/callable.rb +0 -0
  14. data/{yaks/lib → lib}/yaks/fp/hash_updatable.rb +0 -0
  15. data/{yaks/lib → lib}/yaks/fp/updatable.rb +0 -0
  16. data/{yaks/lib → lib}/yaks/fp.rb +0 -0
  17. data/{yaks/lib → lib}/yaks/mapper/association.rb +0 -0
  18. data/{yaks/lib → lib}/yaks/mapper/association_mapper.rb +0 -0
  19. data/{yaks/lib → lib}/yaks/mapper/attribute.rb +0 -0
  20. data/{yaks/lib → lib}/yaks/mapper/class_methods.rb +0 -0
  21. data/{yaks/lib → lib}/yaks/mapper/config.rb +0 -0
  22. data/{yaks/lib → lib}/yaks/mapper/has_many.rb +0 -0
  23. data/{yaks/lib → lib}/yaks/mapper/has_one.rb +0 -0
  24. data/{yaks/lib → lib}/yaks/mapper/link.rb +0 -0
  25. data/{yaks/lib → lib}/yaks/mapper.rb +0 -0
  26. data/{yaks/lib → lib}/yaks/null_resource.rb +0 -0
  27. data/{yaks/lib → lib}/yaks/primitivize.rb +0 -0
  28. data/{yaks/lib → lib}/yaks/resource/link.rb +0 -0
  29. data/{yaks/lib → lib}/yaks/resource.rb +0 -0
  30. data/{yaks/lib → lib}/yaks/runner.rb +0 -0
  31. data/{yaks/lib → lib}/yaks/util.rb +0 -0
  32. data/lib/yaks/version.rb +3 -0
  33. data/{yaks/lib → lib}/yaks.rb +0 -0
  34. data/{yaks/spec → spec}/acceptance/acceptance_spec.rb +0 -0
  35. data/{yaks/spec → spec}/acceptance/json_shared_examples.rb +0 -0
  36. data/{yaks/spec → spec}/acceptance/models.rb +0 -0
  37. data/{yaks/spec → spec}/fixture_helpers.rb +0 -0
  38. data/{yaks/spec → spec}/integration/map_to_resource_spec.rb +0 -0
  39. data/{yaks/spec → spec}/json/confucius.collection.json +0 -0
  40. data/{yaks/spec → spec}/json/confucius.hal.json +0 -0
  41. data/{yaks/spec → spec}/json/confucius.json_api.json +0 -0
  42. data/{yaks/spec → spec}/json/john.hal.json +0 -0
  43. data/{yaks/spec → spec}/json/plant_collection.collection.json +0 -0
  44. data/{yaks/spec → spec}/json/plant_collection.hal.json +0 -0
  45. data/{yaks/spec → spec}/json/youtypeitwepostit.collection.json +0 -0
  46. data/{yaks/spec → spec}/spec_helper.rb +0 -0
  47. data/{yaks/spec → spec}/support/classes_for_policy_testing.rb +0 -0
  48. data/{yaks/spec → spec}/support/deep_eql.rb +0 -0
  49. data/{yaks/spec → spec}/support/fixtures.rb +0 -0
  50. data/{yaks/spec → spec}/support/friends_mapper.rb +0 -0
  51. data/{yaks/spec → spec}/support/models.rb +0 -0
  52. data/{yaks/spec → spec}/support/pet_mapper.rb +0 -0
  53. data/{yaks/spec → spec}/support/pet_peeve_mapper.rb +0 -0
  54. data/{yaks/spec → spec}/support/shared_contexts.rb +0 -0
  55. data/{yaks/spec → spec}/support/youtypeit_models_mappers.rb +0 -0
  56. data/{yaks/spec → spec}/unit/yaks/collection_mapper_spec.rb +0 -0
  57. data/{yaks/spec → spec}/unit/yaks/collection_resource_spec.rb +0 -0
  58. data/{yaks/spec → spec}/unit/yaks/config/dsl_spec.rb +0 -0
  59. data/{yaks/spec → spec}/unit/yaks/config_spec.rb +0 -0
  60. data/{yaks/spec → spec}/unit/yaks/default_policy/derive_mapper_from_object_spec.rb +0 -0
  61. data/{yaks/spec → spec}/unit/yaks/default_policy_spec.rb +0 -0
  62. data/{yaks/spec → spec}/unit/yaks/format/collection_json_spec.rb +0 -0
  63. data/{yaks/spec → spec}/unit/yaks/format/hal_spec.rb +0 -0
  64. data/{yaks/spec → spec}/unit/yaks/format/json_api_spec.rb +0 -0
  65. data/{yaks/spec → spec}/unit/yaks/format_spec.rb +0 -0
  66. data/{yaks/spec → spec}/unit/yaks/fp/callable_spec.rb +0 -0
  67. data/{yaks/spec → spec}/unit/yaks/fp/hash_updatable_spec.rb +0 -0
  68. data/{yaks/spec → spec}/unit/yaks/fp/updatable_spec.rb +0 -0
  69. data/{yaks/spec → spec}/unit/yaks/fp_spec.rb +0 -0
  70. data/{yaks/spec → spec}/unit/yaks/mapper/association_mapper_spec.rb +0 -0
  71. data/{yaks/spec → spec}/unit/yaks/mapper/association_spec.rb +0 -0
  72. data/{yaks/spec → spec}/unit/yaks/mapper/attribute_spec.rb +0 -0
  73. data/{yaks/spec → spec}/unit/yaks/mapper/class_methods_spec.rb +0 -0
  74. data/{yaks/spec → spec}/unit/yaks/mapper/config_spec.rb +0 -0
  75. data/{yaks/spec → spec}/unit/yaks/mapper/has_many_spec.rb +0 -0
  76. data/{yaks/spec → spec}/unit/yaks/mapper/has_one_spec.rb +0 -0
  77. data/{yaks/spec → spec}/unit/yaks/mapper/link_spec.rb +0 -0
  78. data/{yaks/spec → spec}/unit/yaks/mapper_spec.rb +0 -0
  79. data/{yaks/spec → spec}/unit/yaks/null_resource_spec.rb +0 -0
  80. data/{yaks/spec → spec}/unit/yaks/primitivize_spec.rb +0 -0
  81. data/{yaks/spec → spec}/unit/yaks/resource/link_spec.rb +0 -0
  82. data/{yaks/spec → spec}/unit/yaks/resource_spec.rb +0 -0
  83. data/{yaks/spec → spec}/unit/yaks/runner_spec.rb +0 -0
  84. data/{yaks/spec → spec}/unit/yaks/util_spec.rb +0 -0
  85. data/{yaks/spec → spec}/yaml/confucius.yaml +0 -0
  86. data/{yaks/spec → spec}/yaml/youtypeitwepostit.yaml +0 -0
  87. data/{yaks/yaks.gemspec → yaks.gemspec} +1 -1
  88. metadata +141 -106
  89. data/.gitignore +0 -7
  90. data/.travis.yml +0 -36
  91. data/ADDING_FORMATS.md +0 -13
  92. data/CHANGELOG.md +0 -149
  93. data/Gemfile +0 -4
  94. data/IDENTIFIERS.md +0 -113
  95. data/LICENSE +0 -7
  96. data/bench/bench.rb +0 -16
  97. data/bench/bench_1000.rb +0 -60
  98. data/notes.org +0 -72
  99. data/shaved_yak.gif +0 -0
  100. data/yaks/README.md +0 -526
  101. data/yaks/lib/yaks/version.rb +0 -3
  102. data/yaks-html/README.md +0 -3
  103. data/yaks-html/lib/yaks/format/html.rb +0 -70
  104. data/yaks-html/lib/yaks/format/template.html +0 -56
  105. data/yaks-html/lib/yaks-html.rb +0 -3
  106. data/yaks-html/spec/spec_helper.rb +0 -6
  107. data/yaks-html/yaks-html.gemspec +0 -22
data/CHANGELOG.md DELETED
@@ -1,149 +0,0 @@
1
- ### Development
2
- [full changelog](http://github.com/plexus/yaks/compare/v0.5.0...master)
3
-
4
- ### 0.5.0
5
-
6
- * Yaks now serializes (returns a string), instead of returning a data structure. This is a preparatory step for supporting non-JSON formats. To get the old behavior back, do this
7
-
8
- ``` ruby
9
- yaks = Yaks.new do
10
- skip :serialize
11
- end
12
- ```
13
-
14
- * The old `after` hook has been removed, instead there are now generic hooks for all steps: `before`, `after`, `around`, `skip`; `:map`, `:format`, `:primitivize`, `:serialize`.
15
-
16
- * By default Yaks uses `JSON.pretty_generate` as a JSON unparser. To use something else, for example `Oj.dump`, do this
17
-
18
- ``` ruby
19
- yaks = Yaks.new do
20
- json_serializer &Oj.method(:dump)
21
- end
22
- ```
23
-
24
- * Mapping a non-empty collection will try to infer the type, and hence rel of the nested items, based on the first object in the collection. This is only relevant for formats like HAL that don't have a top-level collection representation, and only matters when mapping a collection at the top level, not when mapping a collection from an association.
25
-
26
- * Collection+JSON uses a link's "title" attribute to output a link's "name", to better correspond with other formats
27
-
28
- * When registering a custom format (Yaks::Format subclass), the signature has changed
29
-
30
- ``` ruby
31
- # 0.4.3
32
- Format.register self, :collection_json, 'application/vnd.collection+json'
33
-
34
- # 0.5.0
35
- register :collection_json, :json, 'application/vnd.collection+json'
36
- ```
37
-
38
- * `yaks.call` is now the preferred interface, rather than `yaks.serialize`, although there are no plans yet to remove the alias.
39
-
40
- * The result of a call to `Yaks.new` now responds to `to_proc`, so you can treat it as a Proc/Symbol, e.g. `some_method &yaks`
41
-
42
- * Improved YARD documentation
43
-
44
- * 100% mutation coverage :trumpet: :tada:
45
-
46
- ### 0.4.3
47
-
48
- * when specifying a rel_template, instead of allowing for {src} and {dest} fields, now a single {rel} field is expected, which corresponds more with typical usage.
49
-
50
- ```ruby
51
- Yaks.new do
52
- rel_template 'http://my-api/docs/relationships/{rel}'
53
- end
54
- ```
55
-
56
- * Yaks::Serializer has been renamed to Yaks::Format
57
-
58
- * Yaks::Mapper#{map_attributes,map_links,map_subresource} signature has changed, they now are responsible for adding themselves to a resource instance.
59
-
60
- ```ruby
61
- class FooMapper < Yaks::Mapper
62
- def map_attributes(resource)
63
- resource.update_attributes(:example => 'attribute')
64
- end
65
- end
66
- ```
67
-
68
- * Conditionally turn associations into links
69
-
70
- ```ruby
71
- class ShowMapper < Yaks::Mapper
72
- has_many :events, href: '/show/{id}/events', link_if: ->{ events.count > 50 }
73
- end
74
- ```
75
-
76
- * Reify `Yaks::Mapper::Attribute`
77
-
78
- * Remove `Yaks::Mapper#filter`, instead override `#attributes` or `#associations` to filter things out, for example:
79
-
80
- ```ruby
81
- class SongMapper
82
- attributes :title, :duration, :lyrics
83
- has_one :artist
84
- has_one :album
85
-
86
- def minimal?
87
- env['HTTP_PREFER'] =~ /minimal/
88
- end
89
-
90
- def attributes
91
- if minimal?
92
- super.reject {|attr| attr.name.equal? :lyrics } # These are instances of Yaks::Mapper::Attribute
93
- else
94
- super
95
- end
96
- end
97
-
98
- def associations
99
- return [] if minimal?
100
- super
101
- end
102
- end
103
- ```
104
-
105
- * Give Attribute, Link, Association a common interface : `add_to_resource(resource, mapper, context)`
106
- * Add persistent update methods to `Yaks::Resource`
107
-
108
- ### v0.4.2
109
-
110
- * JSON-API: render self links as href attributes
111
- * HAL: render has_one returning nil as null, not as {}
112
- * Keep track of the mapper stack, useful for figuring out if mapping the top level response or not, or for accessing parent
113
- * Change Serializer.new(resource, options).serialize to Serializer.new(options).call(resource) for cosistency of "pipeline" interface
114
- * Make Yaks::CollectionMapper#collection overridable for pagination
115
- * Don't render links from custom link methods (link :foo, :method_that_generates_url) that return nil
116
-
117
- ### v0.4.1
118
-
119
- * Change how env is passed to yaks.serialize to match docs
120
- * Fix JSON-API bug (#18 reported by Nicolas Blanco)
121
- * Don't pluralize has_one association names in JSON-API
122
-
123
- ## v0.4.0
124
-
125
- * Introduce after {} post-processing hook
126
- * Streamline interfaces and variable names, especially the use of `call`
127
- * Improve deriving mappers automatically, even with Rails style autoloading
128
- * Give CollectionResource a members_rel, for HAL-like formats with no top-level collection concept
129
- * Switch back to using `src` and `dest` as the rel-template keys, instead of `association_name`
130
- * deprecate `mapper_namespace` in favor of `namespace`
131
-
132
- ### v0.4.0.rc1
133
-
134
- * Introduce Yaks.new as the main public interface
135
- * Fix JsonApiSerializer and make it compliant with current spec
136
- * Remove Hamster dependency, Yaks new uses plain old Ruby arrays and hashes
137
- * Remove `RelRegistry` and `ProfileRegistry` in favor of a simpler explicit syntax + policy based fallback
138
- * Add more policy derivation hooks, plus make `DefaultPolicy` template for rel urls configurable
139
- * Optionally take a Rack env hash, pass it around so mappers can inspect it
140
- * Honor the HTTP Accept header if it is present in the rack env
141
- * Add map_to_primitive configuration option
142
-
143
- ## v0.3.0
144
-
145
- * Allow partial expansion of templates, expand certain fields, leave others as URI template in the result.
146
-
147
- ## v0.2.0
148
-
149
- * links can now take a simple for a template to compute a link just like an attribute
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec path: 'yaks'
4
- gemspec path: 'yaks-html'
data/IDENTIFIERS.md DELETED
@@ -1,113 +0,0 @@
1
- # Identifiers
2
-
3
- In Yaks, and Hypermedia message formats in general, a number of different types of identifiers are used. Some are full URIs and correspond with well defined specs. Some are just short identifers that are easy to program with.
4
-
5
- Understanding these types of identifiers is key to creating a unifying model of a "Resource" that can be shared across output formats. We want to unify as much as possible across formats, without conflating things that are really not the same.
6
-
7
- This document reflects my current limited understanding of things, based on possibly incorrect assumptions. Feedback is more than welcome.
8
-
9
- ## rels
10
-
11
- As used in HTML and Atom, these identifiers say what the relationship is between a resource and another resource it links to. There is a [registry of names](http://www.iana.org/assignments/link-relations/link-relations.xhtml), e.g. self, next, profile, stylesheet. Custom rels need to be fully qualified URLs. Keep in mind that these are simply opaque identifiers, but by using a known protocol like http they can be used to point at documentation.
12
-
13
- Some examples
14
-
15
- ```
16
- copyright
17
- stylesheet
18
- http://api.example.com/rel/author
19
- http://api.example.com/api-docs/relationships#comment
20
- custom_scheme:foo
21
- /order
22
- ```
23
-
24
- The last example is a relative URL, which would have to be expanded against the source URL of the document it is mentioned in.
25
-
26
- In Yaks both links and subresources are specified with their rel(ationship).
27
-
28
- ```ruby
29
- class PersonMapper < Yaks::Mapper
30
- link :self, '/people/{id}'
31
- link 'http://api.example.com/rels#friends', '/people/{id}/friends'
32
-
33
- has_one :address, rel: 'http://api.example.com/rels#address'
34
- end
35
- ```
36
-
37
- For subresources the rel can be omitted, in which case it will be inferred based on the rel_template:
38
-
39
- ```ruby
40
- $yaks = Yaks.new do
41
- rel_template 'http://api.example.com/rels/{dest}'
42
- end
43
- ```
44
-
45
- Links and subresources are rendered keyed by rel in HAL and Collection+JSON. JSON-API renders `self` links as the `href` of a resource.
46
-
47
- ## profiles
48
-
49
- A specific IANA registered rel type is profile.
50
-
51
- > Profile: Identifying that a resource representation conforms to a certain profile, without affecting the non-profile semantics of the resource representation.
52
-
53
- Profile basically adds a layer of semantics on top of the hypermedia message format (e.g. HAL, Collection+JSON), which in turns defines semantics on top of a serialization format (JSON, XML, EDN). Loosely speaking it could be seen as the "type" or "class". For example if you know the profile of a resource, you might know you can expect to find a "name", "date_of_birth", or "post_body" field.
54
-
55
- ## "type"
56
-
57
- Despite the appealing rigor of having fully qualified URIs to identify things, sometimes you just want to call a person a `person`. In Yaks we call these short identifier the *type* for lack of a better word. In some cases, notably JSON-API, they are used literally in the output. More often they are used to derive full URIs based on a template.
58
-
59
- The type of a mapper is inferred from its class name, but can be set explicitly as well.
60
-
61
- ```ruby
62
- class CatMapper < Yaks::Mapper
63
- end
64
-
65
- # type = "cat"
66
- ```
67
-
68
- ```ruby
69
- class CatMapper < Yaks::Mapper
70
- type 'feline'
71
- end
72
-
73
- # type => "feline"
74
- ```
75
-
76
- ## rdf class
77
-
78
- RDF (Resource Description Framework) is a set of specifications for use in "semantic web" applications. RDF is based on "ontologies" that precisely define a "vocabulary" of "classes" and "predicates". An example class identifier for all Merlot wines could be
79
-
80
- > http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine#Merlot
81
-
82
- (source [wikipedia](http://en.wikipedia.org/wiki/Resource_Description_Framework))
83
-
84
- Not currently used by Yaks, but might become important when implementing support for JSON-LD or other RDF serialization formats.
85
-
86
- ## CURIES
87
-
88
- CURIES are "compact uris". The HAL format uses this so it can have the rigor of fully specified rels, with the ease of use of short-name "type" identifiers. The mechanism is similar to how one specifies and uses XML namespaces.
89
-
90
- From the HAL spec:
91
-
92
- ```json
93
- {
94
- "_links": {
95
- "self": { "href": "/orders" },
96
- "curies": [{ "name": "ea", "href": "http://example.com/docs/rels/{rel}", "templated": true }],
97
- "next": { "href": "/orders?page=2" },
98
- "ea:find": {
99
- "href": "/orders{?id}",
100
- "templated": true
101
- },
102
- "ea:admin": [{
103
- "href": "/admins/2",
104
- "title": "Fred"
105
- }, {
106
- "href": "/admins/5",
107
- "title": "Kate"
108
- }]
109
- }
110
- }
111
- ```
112
-
113
- In this case "ea:find" is just a shorthand for "http://example.com/docs/rels/find".
data/LICENSE DELETED
@@ -1,7 +0,0 @@
1
- Copyright (c) 2013-2014 Arne Brasseur
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/bench/bench.rb DELETED
@@ -1,16 +0,0 @@
1
-
2
- require 'benchmark/ips'
3
- require 'yaks'
4
-
5
- require_relative '../spec/acceptance/models'
6
- require_relative '../spec/fixture_helpers'
7
-
8
- Benchmark.ips do |x|
9
- $yaks = Yaks.new
10
-
11
- input = FixtureHelpers.load_yaml_fixture 'confucius'
12
-
13
- x.report "Simple HAL mapping" do
14
- $yaks.serialize(input)
15
- end
16
- end
data/bench/bench_1000.rb DELETED
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'benchmark/ips'
4
- require 'yaks'
5
- require 'ruby-prof'
6
-
7
- SIZE=20
8
- $timestamp = Time.now.utc.iso8601.gsub('-', '').gsub(':', '')
9
- $yaks = Yaks.new
10
-
11
- FlatModel = Struct.new(:field1, :field2)
12
- DeepModel = Struct.new(:field, :next)
13
-
14
- flat = SIZE.times.map do |i|
15
- FlatModel.new(i, 'x' * (i % 50))
16
- end
17
-
18
- deep = nil
19
- SIZE.times do |i|
20
- deep = DeepModel.new(i, deep)
21
- end
22
-
23
- class FlatMapper < Yaks::Mapper
24
- attributes :field1, :field2
25
- link :self, '/model/{field1}'
26
- end
27
-
28
- class DeepMapper < Yaks::Mapper
29
- attributes :field
30
- link :self, '/model/{field}'
31
- has_one :next, mapper: DeepMapper
32
- end
33
-
34
-
35
- def profile!(name)
36
- RubyProf.start
37
- yield
38
- results = RubyProf.stop
39
- File.open "/tmp/#{name}-#{$timestamp}.out.#{$$}", 'w' do |file|
40
- RubyProf::CallTreePrinter.new(results).print(file)
41
- end
42
- end
43
-
44
- do_flat = ->(format) { -> { $yaks.serialize(flat, item_mapper: FlatMapper, format: format) } }
45
- do_deep = ->(format) { -> { $yaks.serialize(deep, mapper: DeepMapper, format: format) } }
46
-
47
- 10.times { do_flat[:hal][] }
48
- 10.times { do_deep[:hal][] }
49
-
50
- profile!('flat', &do_flat.(:hal))
51
- profile!('deep', &do_deep.(:hal))
52
- exit
53
-
54
- Benchmark.ips(10) do |job|
55
- Yaks::Format.names.each do |format|
56
-
57
- job.report "#{format} ; #{SIZE} objects in a list ; no nesting", &do_flat.(format)
58
- job.report "#{format} ; #{SIZE} objects nested", &do_deep.(format)
59
- end
60
- end
data/notes.org DELETED
@@ -1,72 +0,0 @@
1
- 0.4
2
-
3
- * DONE Get rid of profile/rel registry, use policy instead
4
- * DONE pass around policy explicitly instead of through options
5
- * DONE introduce name/type separate from profile
6
- ** DONE mapper
7
- ** DONE Resource
8
- * DONE allow setting rel types directly on associations, with fallback to policy
9
- * DONE switch to hash-based init of Resource to make it more extensible
10
- * DONE add Resource#type
11
- * DONE not 100% happy yet about nameing of mapper#mapper_name / config#name. Maybe use `type` across the board?
12
- * DONE Fix JsonAPISerializer
13
- * top-level automatic links, e.g. for self and profile
14
- * make HAL plural/singular links configurable from the Yaks.new
15
- * make primitivize configuration instance based, not global
16
- * Have JsonApi add self links as href: attributes
17
- * Move examples to acceptance tests
18
- * Select mapper based on content type
19
- * move to 100% mutcov
20
-
21
- pre 0.5
22
-
23
- * CURIES/namespaces
24
-
25
- Ticketsolve::Api::Yaks = ::Yaks.new do
26
- policy do
27
- def derive...
28
- end
29
-
30
- hal_options.plural_link '...'
31
-
32
- primitivize Date, Time do |o|
33
- o.iso8601
34
- end
35
-
36
- rel_template "http://literature.example.com/rel/#{association_name}"
37
-
38
- link :self, "http://api.com/{key}/{id}"
39
- link :profile, "http://api.com/profile/{key}"
40
-
41
- # and/or
42
- derive_rel_from_association do |mapper, association|
43
- "http://literature.example.com/rel/#{association.name}"
44
- end
45
- end
46
-
47
-
48
-
49
- * DONE 59 lib/yaks/mapper.rb
50
- * DONE 92 lib/yaks/mapper/link.rb
51
- * DONE 37 lib/yaks/mapper/association.rb
52
- * DONE 3 lib/yaks/version.rb
53
- * DONE 13 lib/yaks/mapper/has_many.rb
54
- * DONE 9 lib/yaks/mapper/has_one.rb
55
- * DONE 79 lib/yaks/config.rb
56
- * 79 lib/yaks/mapper/config.rb
57
- * 73 lib/yaks.rb
58
- * DONE 72 lib/yaks/util.rb
59
- * DONE 65 lib/yaks/collection_resource.rb
60
- * 59 lib/yaks/json_api_serializer.rb
61
- * 59 lib/yaks/hal_serializer.rb
62
- * 43 lib/yaks/primitivize.rb
63
- * 37 lib/yaks/mapper/class_methods.rb
64
- * DONE 33 lib/yaks/collection_mapper.rb
65
- * 28 lib/yaks/null_resource.rb
66
- * DONE 27 lib/yaks/resource.rb
67
- * 25 lib/yaks/resource/link.rb
68
- * DONE 23 lib/yaks/fp.rb
69
- * 22 lib/yaks/serializer.rb
70
- * 15 lib/yaks/shared_options.rb
71
- * 15 lib/yaks/default_policy.rb
72
- * 10 lib/yaks/mapper/map_links.rb
data/shaved_yak.gif DELETED
Binary file