halidator 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/halidate/pure_ruby.rb +6 -1
  2. metadata +3 -3
@@ -57,7 +57,12 @@ module Halidate
57
57
  when Array
58
58
  resource.all?{|x| Halidator.new(x).valid?}
59
59
  else
60
- Halidator.new(resource).valid?
60
+ begin
61
+ Halidator.new(resource).valid?
62
+ rescue JSON::ParserError
63
+ errors << "'#{resource}' is not a valid embedded object"
64
+ return false
65
+ end
61
66
  end
62
67
  end
63
68
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: halidator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-25 00:00:00.000000000 Z
12
+ date: 2013-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  version: '0'
76
76
  requirements: []
77
77
  rubyforge_project:
78
- rubygems_version: 1.8.24
78
+ rubygems_version: 1.8.25
79
79
  signing_key:
80
80
  specification_version: 3
81
81
  summary: A small library to validate hal+json