representors 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +18 -0
  3. data/Gemfile +3 -0
  4. data/Gemfile.lock +126 -0
  5. data/LICENSE.md +19 -0
  6. data/README.md +28 -0
  7. data/Rakefile +10 -0
  8. data/lib/representor_support/utilities.rb +39 -0
  9. data/lib/representors.rb +5 -0
  10. data/lib/representors/errors.rb +7 -0
  11. data/lib/representors/field.rb +108 -0
  12. data/lib/representors/options.rb +67 -0
  13. data/lib/representors/representor.rb +161 -0
  14. data/lib/representors/representor_builder.rb +64 -0
  15. data/lib/representors/representor_hash.rb +59 -0
  16. data/lib/representors/serialization.rb +4 -0
  17. data/lib/representors/serialization/deserializer_base.rb +29 -0
  18. data/lib/representors/serialization/deserializer_factory.rb +13 -0
  19. data/lib/representors/serialization/hal_deserializer.rb +44 -0
  20. data/lib/representors/serialization/hal_serializer.rb +91 -0
  21. data/lib/representors/serialization/hale_deserializer.rb +162 -0
  22. data/lib/representors/serialization/hale_serializer.rb +110 -0
  23. data/lib/representors/serialization/serialization_base.rb +27 -0
  24. data/lib/representors/serialization/serialization_factory_base.rb +54 -0
  25. data/lib/representors/serialization/serializer_base.rb +20 -0
  26. data/lib/representors/serialization/serializer_factory.rb +17 -0
  27. data/lib/representors/transition.rb +130 -0
  28. data/lib/representors/version.rb +4 -0
  29. data/spec/fixtures/complex_hal.json +92 -0
  30. data/spec/fixtures/complex_hale_document.json +81 -0
  31. data/spec/fixtures/drds_hash.rb +120 -0
  32. data/spec/fixtures/hale_spec_examples/basic.json +77 -0
  33. data/spec/fixtures/hale_spec_examples/complex_reference_objects.json +157 -0
  34. data/spec/fixtures/hale_spec_examples/data.json +17 -0
  35. data/spec/fixtures/hale_spec_examples/data_objects.json +96 -0
  36. data/spec/fixtures/hale_spec_examples/link_objects.json +18 -0
  37. data/spec/fixtures/hale_spec_examples/nested_ref.json +43 -0
  38. data/spec/fixtures/hale_spec_examples/reference_objects.json +89 -0
  39. data/spec/fixtures/hale_tutorial_examples/basic_links.json +85 -0
  40. data/spec/fixtures/hale_tutorial_examples/basic_links_with_orders.json +96 -0
  41. data/spec/fixtures/hale_tutorial_examples/basic_links_with_references.json +108 -0
  42. data/spec/fixtures/hale_tutorial_examples/embedded.json +182 -0
  43. data/spec/fixtures/hale_tutorial_examples/empty.json +1 -0
  44. data/spec/fixtures/hale_tutorial_examples/enctype.json +14 -0
  45. data/spec/fixtures/hale_tutorial_examples/final.json +141 -0
  46. data/spec/fixtures/hale_tutorial_examples/get_link.json +17 -0
  47. data/spec/fixtures/hale_tutorial_examples/get_link_with_data.json +29 -0
  48. data/spec/fixtures/hale_tutorial_examples/links.json +11 -0
  49. data/spec/fixtures/hale_tutorial_examples/links_only.json +3 -0
  50. data/spec/fixtures/hale_tutorial_examples/meta.json +208 -0
  51. data/spec/fixtures/hale_tutorial_examples/self_link.json +7 -0
  52. data/spec/fixtures/single_drd.rb +266 -0
  53. data/spec/lib/representors/complex_representor_spec.rb +288 -0
  54. data/spec/lib/representors/field_spec.rb +141 -0
  55. data/spec/lib/representors/representor_builder_spec.rb +223 -0
  56. data/spec/lib/representors/representor_spec.rb +285 -0
  57. data/spec/lib/representors/serialization/deserializer_factory_spec.rb +118 -0
  58. data/spec/lib/representors/serialization/hal_deserializer_spec.rb +34 -0
  59. data/spec/lib/representors/serialization/hal_serializer_spec.rb +171 -0
  60. data/spec/lib/representors/serialization/hale_deserializer_spec.rb +59 -0
  61. data/spec/lib/representors/serialization/hale_roundtrip_spec.rb +34 -0
  62. data/spec/lib/representors/serialization/hale_serializer_spec.rb +659 -0
  63. data/spec/lib/representors/serialization/serializer_factory_spec.rb +108 -0
  64. data/spec/lib/representors/transition_spec.rb +349 -0
  65. data/spec/spec_helper.rb +32 -0
  66. data/spec/support/basic-hale.json +12 -0
  67. data/spec/support/hal_representor_shared.rb +206 -0
  68. data/spec/support/helpers.rb +8 -0
  69. data/tasks/benchmark.rake +75 -0
  70. data/tasks/complex_hal_document.json +98 -0
  71. data/tasks/test_specs.rake +37 -0
  72. data/tasks/yard.rake +22 -0
  73. metadata +232 -0
@@ -0,0 +1,22 @@
1
+ require 'rake'
2
+ require 'rake/clean'
3
+
4
+ CLOBBER.include('.yardoc', 'yardoc')
5
+ CLOBBER.uniq!
6
+
7
+ begin
8
+ require 'yard'
9
+ require 'yard/rake/yardoc_task'
10
+
11
+ namespace :doc do
12
+ desc 'Generate Yardoc documentation'
13
+ YARD::Rake::YardocTask.new
14
+ end
15
+
16
+ desc 'Alias to doc:yard'
17
+ task 'doc' => 'doc:yard'
18
+ rescue LoadError
19
+ # If yard isn't available, it's not the end of the world
20
+ desc 'Alias to doc:rdoc'
21
+ task 'doc' => 'doc:rdoc'
22
+ end
metadata ADDED
@@ -0,0 +1,232 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: representors
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.5
5
+ platform: ruby
6
+ authors:
7
+ - Mark W. Foster
8
+ - Shea Valentine
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2016-05-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: addressable
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '2.3'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '2.3'
42
+ - !ruby/object:Gem::Dependency
43
+ name: byebug
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: mutant-rspec
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.8'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '0.8'
70
+ - !ruby/object:Gem::Dependency
71
+ name: redcarpet
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: rspec
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: '3.4'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: '3.4'
98
+ - !ruby/object:Gem::Dependency
99
+ name: simplecov
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: '0.11'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '0.11'
112
+ - !ruby/object:Gem::Dependency
113
+ name: yard
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ description: |2
127
+ Crichton Representors is a library containing serializers and deserializers to and from hypermedia formats.
128
+ This library does not have the functionality to get and post data over the Internet. Consider Farscape for that.
129
+ This library also does not automatically decorates objects. Consider Crichton for that.
130
+ email: ''
131
+ executables: []
132
+ extensions: []
133
+ extra_rdoc_files: []
134
+ files:
135
+ - CHANGELOG.md
136
+ - Gemfile
137
+ - Gemfile.lock
138
+ - LICENSE.md
139
+ - README.md
140
+ - Rakefile
141
+ - lib/representor_support/utilities.rb
142
+ - lib/representors.rb
143
+ - lib/representors/errors.rb
144
+ - lib/representors/field.rb
145
+ - lib/representors/options.rb
146
+ - lib/representors/representor.rb
147
+ - lib/representors/representor_builder.rb
148
+ - lib/representors/representor_hash.rb
149
+ - lib/representors/serialization.rb
150
+ - lib/representors/serialization/deserializer_base.rb
151
+ - lib/representors/serialization/deserializer_factory.rb
152
+ - lib/representors/serialization/hal_deserializer.rb
153
+ - lib/representors/serialization/hal_serializer.rb
154
+ - lib/representors/serialization/hale_deserializer.rb
155
+ - lib/representors/serialization/hale_serializer.rb
156
+ - lib/representors/serialization/serialization_base.rb
157
+ - lib/representors/serialization/serialization_factory_base.rb
158
+ - lib/representors/serialization/serializer_base.rb
159
+ - lib/representors/serialization/serializer_factory.rb
160
+ - lib/representors/transition.rb
161
+ - lib/representors/version.rb
162
+ - spec/fixtures/complex_hal.json
163
+ - spec/fixtures/complex_hale_document.json
164
+ - spec/fixtures/drds_hash.rb
165
+ - spec/fixtures/hale_spec_examples/basic.json
166
+ - spec/fixtures/hale_spec_examples/complex_reference_objects.json
167
+ - spec/fixtures/hale_spec_examples/data.json
168
+ - spec/fixtures/hale_spec_examples/data_objects.json
169
+ - spec/fixtures/hale_spec_examples/link_objects.json
170
+ - spec/fixtures/hale_spec_examples/nested_ref.json
171
+ - spec/fixtures/hale_spec_examples/reference_objects.json
172
+ - spec/fixtures/hale_tutorial_examples/basic_links.json
173
+ - spec/fixtures/hale_tutorial_examples/basic_links_with_orders.json
174
+ - spec/fixtures/hale_tutorial_examples/basic_links_with_references.json
175
+ - spec/fixtures/hale_tutorial_examples/embedded.json
176
+ - spec/fixtures/hale_tutorial_examples/empty.json
177
+ - spec/fixtures/hale_tutorial_examples/enctype.json
178
+ - spec/fixtures/hale_tutorial_examples/final.json
179
+ - spec/fixtures/hale_tutorial_examples/get_link.json
180
+ - spec/fixtures/hale_tutorial_examples/get_link_with_data.json
181
+ - spec/fixtures/hale_tutorial_examples/links.json
182
+ - spec/fixtures/hale_tutorial_examples/links_only.json
183
+ - spec/fixtures/hale_tutorial_examples/meta.json
184
+ - spec/fixtures/hale_tutorial_examples/self_link.json
185
+ - spec/fixtures/single_drd.rb
186
+ - spec/lib/representors/complex_representor_spec.rb
187
+ - spec/lib/representors/field_spec.rb
188
+ - spec/lib/representors/representor_builder_spec.rb
189
+ - spec/lib/representors/representor_spec.rb
190
+ - spec/lib/representors/serialization/deserializer_factory_spec.rb
191
+ - spec/lib/representors/serialization/hal_deserializer_spec.rb
192
+ - spec/lib/representors/serialization/hal_serializer_spec.rb
193
+ - spec/lib/representors/serialization/hale_deserializer_spec.rb
194
+ - spec/lib/representors/serialization/hale_roundtrip_spec.rb
195
+ - spec/lib/representors/serialization/hale_serializer_spec.rb
196
+ - spec/lib/representors/serialization/serializer_factory_spec.rb
197
+ - spec/lib/representors/transition_spec.rb
198
+ - spec/spec_helper.rb
199
+ - spec/support/basic-hale.json
200
+ - spec/support/hal_representor_shared.rb
201
+ - spec/support/helpers.rb
202
+ - tasks/benchmark.rake
203
+ - tasks/complex_hal_document.json
204
+ - tasks/test_specs.rake
205
+ - tasks/yard.rake
206
+ homepage: https://github.com/mdsol/representors
207
+ licenses: []
208
+ metadata: {}
209
+ post_install_message:
210
+ rdoc_options:
211
+ - "--main"
212
+ - README.md
213
+ require_paths:
214
+ - lib
215
+ required_ruby_version: !ruby/object:Gem::Requirement
216
+ requirements:
217
+ - - ">="
218
+ - !ruby/object:Gem::Version
219
+ version: '0'
220
+ required_rubygems_version: !ruby/object:Gem::Requirement
221
+ requirements:
222
+ - - ">="
223
+ - !ruby/object:Gem::Version
224
+ version: '0'
225
+ requirements: []
226
+ rubyforge_project:
227
+ rubygems_version: 2.5.1
228
+ signing_key:
229
+ specification_version: 4
230
+ summary: It has the knowledge of Hypermedia media-types from the Ancients!
231
+ test_files: []
232
+ has_rdoc: