praxis-blueprints 1.3.0 → 1.3.1

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: 48fb0aab37d8848325be498e9e89221ce803cdfe
4
- data.tar.gz: 3bb509c2daadb670527d0cf43e9b919573273059
3
+ metadata.gz: 079b25ca3c8c34b56fb2e2a30d29396d032d857b
4
+ data.tar.gz: 4755ff61ad4d35f1643917f42900b01f9e7cb428
5
5
  SHA512:
6
- metadata.gz: 83cfc54c0609a7586f4961ebb698b87018c3e1f0a191de3e9f0db4b2bed0eac9cea58a828dd7b2c151448ec3e5fb7f224fe76810107969685d6314d8b657f2d7
7
- data.tar.gz: f18a5b85e4b17b104912910725a647ce9886c2cede2c617e313a1eb185de73c785af265bc2ce5ef9d805889fbdfa911d7887b335a9778dbf34ea938e3e8a95fd
6
+ metadata.gz: 691cb0f8e2807fd0fbe3e1d1fe8401db44c4b86d29dc3aaf355243168c607c453512978aeb754463e64b10a5c5e2f00b7ac9fedbd7b38563594c61c9edf4b714
7
+ data.tar.gz: 657db7c0f1599274db19443aa37968b56b2cb346ef83c2b56b5ab272c9a923ba2be480241b46de03b243ab25daebfd94e048f98de4a85b8ac151ac7513006832
data/CHANGELOG.md CHANGED
@@ -1,10 +1,16 @@
1
1
  # praxis-blueprints changelog
2
2
 
3
- ## next
3
+ ## next
4
+
5
+
6
+ ## 1.3.1
7
+
8
+ * Improve error for nonexistent view attributes in media type
9
+ * Added `family` method to Blueprints to follow the new `Attributor` practices.
4
10
 
5
11
  ## 1.3.0
6
12
 
7
- * Added `include_nil` option to `View` for refining the rendering of nil values.
13
+ * Added `include_nil` option to `View` for refining the rendering of nil values.
8
14
  * This can be set when defining the view with `Blueprint.view`, and defaults to false. For example: `view :default, include_nil: true { ... }`.
9
15
  * Fixed `Blueprint.describe` to output the proper `:id`. That is: the 'id` from the Class name, rather than the internal Struct attribute.
10
16
  * Fixed `Blueprint.dump(nil)` raising a `NoMethodError`
@@ -26,4 +32,4 @@
26
32
 
27
33
  ## 1.0
28
34
 
29
- Initial release!
35
+ Initial release!
@@ -53,6 +53,9 @@ module Praxis
53
53
  blueprint
54
54
  end
55
55
 
56
+ def self.family
57
+ 'hash'
58
+ end
56
59
 
57
60
  def self.describe(shallow=false)
58
61
  type_name = self.ancestors.find { |k| k.name && !k.name.empty? }.name
@@ -1,3 +1,3 @@
1
1
  module Praxis
2
- BLUEPRINTS_VERSION = "1.3.0"
2
+ BLUEPRINTS_VERSION = "1.3.1"
3
3
  end
@@ -47,7 +47,7 @@ module Praxis
47
47
  if value.nil?
48
48
  next unless @include_nil
49
49
  end
50
-
50
+
51
51
  # FIXME: this is such an ugly way to do this. Need attributor#67.
52
52
  if dumpable.kind_of?(View) || dumpable.kind_of?(CollectionView)
53
53
  new_context = context + [name]
@@ -70,7 +70,7 @@ module Praxis
70
70
  raise AttributorException, "Attribute names must be symbols, got: #{name.inspect}" unless name.kind_of? ::Symbol
71
71
 
72
72
  attribute = self.schema.attributes.fetch(name) do
73
- raise "Attribute '#{name}' does not exist in #{self.schema}"
73
+ raise "Displaying :#{name} is not allowed in view :#{self.name} of #{self.schema}. This attribute does not exist in the mediatype"
74
74
  end
75
75
 
76
76
  if block_given?
@@ -4,6 +4,8 @@ describe Praxis::Blueprint do
4
4
 
5
5
  subject(:blueprint_class) { Person }
6
6
 
7
+ its(:family){ should eq('hash') }
8
+
7
9
  context 'deterministic examples' do
8
10
  it 'works' do
9
11
  person_1 = Person.example('person 1')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: praxis-blueprints
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep M. Blanquer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-17 00:00:00.000000000 Z
12
+ date: 2015-04-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: randexp