jsonatra 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d4723e5550565a74308859e83aeed704486619e0
4
+ data.tar.gz: 49b9dea90d58c43652b3844d771ce3b4527ec558
5
+ SHA512:
6
+ metadata.gz: e532d12850c38167b97125ea184a7bec3b79a63a7ac473779d503b102af854c63359d98e12dc895fc32f19bb9f57fb780160068170307086aeb49a22cb4d92c4
7
+ data.tar.gz: 037a05c9f169b3c6722cfab4f37a6668955464485568445e8f415648209d8e1810c6492f490a51f83711e3be91706d081aee01a829a9177911db3a01c5b9d269
@@ -1,3 +1,3 @@
1
1
  module Jsonatra
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
data/lib/jsonatra.rb CHANGED
@@ -138,6 +138,22 @@ class String
138
138
  string
139
139
  end
140
140
  end
141
+
142
+ unless instance_methods.include? :blank?
143
+ alias_method :blank?, :empty?
144
+ end
145
+ end
146
+
147
+ class NilClass
148
+ unless instance_methods.include? :blank?
149
+ def blank?; true; end
150
+ end
151
+ end
152
+
153
+ class Numeric
154
+ unless instance_methods.include? :blank?
155
+ def blank?; false; end
156
+ end
141
157
  end
142
158
 
143
159
  class Symbol
@@ -130,4 +130,24 @@ describe Jsonatra::Base do
130
130
 
131
131
  end
132
132
 
133
+ describe 'extensions' do
134
+
135
+ it 'camelcases strings' do # ugh
136
+ 'foo_bar_bat_123'.camelcase.must_equal 'fooBarBat123'
137
+ end
138
+
139
+ it 'camelcases symbols' do # ugh
140
+ :foo_bar_bat_123.camelcase.must_equal :fooBarBat123
141
+ end
142
+
143
+ it 'blanks properly' do
144
+ assert ''.blank?
145
+ assert nil.blank?
146
+ refute '1'.blank?
147
+ refute 1.blank?
148
+ refute 1.1.blank?
149
+ end
150
+
151
+ end
152
+
133
153
  end
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonatra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
5
- prerelease:
4
+ version: 1.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Kenichi Nakamura
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-25 00:00:00.000000000 Z
11
+ date: 2013-11-15 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: sinatra
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  description: An opinionated, non-ReST, JSON API extension for Sinatra
@@ -53,27 +50,26 @@ files:
53
50
  homepage: https://github.com/esripdx/jsonatra
54
51
  licenses:
55
52
  - apache
53
+ metadata: {}
56
54
  post_install_message:
57
55
  rdoc_options: []
58
56
  require_paths:
59
57
  - lib
60
58
  required_ruby_version: !ruby/object:Gem::Requirement
61
- none: false
62
59
  requirements:
63
- - - ! '>='
60
+ - - '>='
64
61
  - !ruby/object:Gem::Version
65
62
  version: '0'
66
63
  required_rubygems_version: !ruby/object:Gem::Requirement
67
- none: false
68
64
  requirements:
69
- - - ! '>='
65
+ - - '>='
70
66
  - !ruby/object:Gem::Version
71
67
  version: '0'
72
68
  requirements: []
73
69
  rubyforge_project:
74
- rubygems_version: 1.8.23
70
+ rubygems_version: 2.0.3
75
71
  signing_key:
76
- specification_version: 3
72
+ specification_version: 4
77
73
  summary: An opinionated, non-ReST, JSON API extension for Sinatra
78
74
  test_files:
79
75
  - test/helper.rb