kharon 0.5.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +1 -0
- data/.rspec +2 -1
- data/Gemfile +1 -10
- data/Gemfile.lock +29 -16
- data/README.md +135 -26
- data/{kharon-0.0.1.gem → dist/kharon-0.0.1.gem} +0 -0
- data/{kharon-0.0.2.gem → dist/kharon-0.0.2.gem} +0 -0
- data/{kharon-0.0.3.gem → dist/kharon-0.0.3.gem} +0 -0
- data/{kharon-0.1.0.gem → dist/kharon-0.1.0.gem} +0 -0
- data/{kharon-0.2.0.gem → dist/kharon-0.2.0.gem} +0 -0
- data/{kharon-0.3.0.gem → dist/kharon-0.3.0.gem} +0 -0
- data/{kharon-0.3.1.gem → dist/kharon-0.3.1.gem} +0 -0
- data/{kharon-0.4.0.gem → dist/kharon-0.4.0.gem} +0 -0
- data/{kharon-0.5.0.gem → dist/kharon-0.5.0.gem} +0 -0
- data/dist/kharon-0.5.1.gem +0 -0
- data/doc/Kharon.html +364 -0
- data/doc/Kharon/Configuration.html +452 -0
- data/doc/Kharon/Errors.html +145 -0
- data/doc/Kharon/Errors/Validation.html +436 -0
- data/doc/Kharon/Handlers.html +144 -0
- data/doc/Kharon/Handlers/Exceptions.html +273 -0
- data/doc/Kharon/Handlers/Messages.html +425 -0
- data/doc/Kharon/Helpers.html +277 -0
- data/doc/Kharon/Validator.html +1962 -0
- data/doc/_index.html +187 -0
- data/doc/class_list.html +58 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +415 -0
- data/doc/file.results.html +1578 -0
- data/doc/file_list.html +63 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +415 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +181 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +207 -0
- data/doc/top-level-namespace.html +112 -0
- data/kharon.gemspec +9 -1
- data/lib/kharon.rb +7 -11
- data/lib/kharon/errors.rb +7 -0
- data/lib/kharon/errors/validation.rb +2 -0
- data/lib/kharon/handlers.rb +8 -0
- data/lib/kharon/handlers/exceptions.rb +3 -1
- data/lib/kharon/handlers/messages.rb +11 -4
- data/lib/kharon/validator.rb +17 -5
- data/lib/kharon/version.rb +2 -1
- data/spec/lib/kharon/handlers/messages_spec.rb +11 -0
- data/spec/lib/kharon/validator_spec.rb +6 -0
- data/spec/results.html +1506 -0
- metadata +140 -20
- data/lib/kharon/configuration.rb +0 -28
- data/lib/kharon/helpers/validate.rb +0 -15
metadata
CHANGED
@@ -1,32 +1,125 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kharon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Vincent Courtois
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2015-
|
11
|
+
date: 2015-09-16 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bson
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.2'
|
19
20
|
- - ! '>='
|
20
21
|
- !ruby/object:Gem::Version
|
21
22
|
version: 2.2.2
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
25
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
26
|
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.2'
|
27
30
|
- - ! '>='
|
28
31
|
- !ruby/object:Gem::Version
|
29
32
|
version: 2.2.2
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: yard
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ~>
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0.8'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.8'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: redcarpet
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - '='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 3.3.1
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - '='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 3.3.1
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: bundler
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '1.8'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ~>
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '1.8'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rake
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ~>
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '10.0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '10.0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rack-test
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ~>
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 0.6.2
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ~>
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 0.6.2
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: rspec
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '3.0'
|
110
|
+
- - ! '>='
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 3.0.0
|
113
|
+
type: :development
|
114
|
+
prerelease: false
|
115
|
+
version_requirements: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ~>
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '3.0'
|
120
|
+
- - ! '>='
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 3.0.0
|
30
123
|
description: Kharon is a ruby hash validator that helps you fix the structure of a
|
31
124
|
hash (type of the keys, dependencies, ...).
|
32
125
|
email: courtois.vincent@outlook.com
|
@@ -34,59 +127,86 @@ executables: []
|
|
34
127
|
extensions: []
|
35
128
|
extra_rdoc_files: []
|
36
129
|
files:
|
130
|
+
- .gitignore
|
37
131
|
- .rspec
|
38
132
|
- Gemfile
|
39
133
|
- Gemfile.lock
|
40
134
|
- LICENSE
|
41
135
|
- README.md
|
42
|
-
- kharon-0.0.1.gem
|
43
|
-
- kharon-0.0.2.gem
|
44
|
-
- kharon-0.0.3.gem
|
45
|
-
- kharon-0.1.0.gem
|
46
|
-
- kharon-0.2.0.gem
|
47
|
-
- kharon-0.3.0.gem
|
48
|
-
- kharon-0.3.1.gem
|
49
|
-
- kharon-0.4.0.gem
|
50
|
-
- kharon-0.5.0.gem
|
136
|
+
- dist/kharon-0.0.1.gem
|
137
|
+
- dist/kharon-0.0.2.gem
|
138
|
+
- dist/kharon-0.0.3.gem
|
139
|
+
- dist/kharon-0.1.0.gem
|
140
|
+
- dist/kharon-0.2.0.gem
|
141
|
+
- dist/kharon-0.3.0.gem
|
142
|
+
- dist/kharon-0.3.1.gem
|
143
|
+
- dist/kharon-0.4.0.gem
|
144
|
+
- dist/kharon-0.5.0.gem
|
145
|
+
- dist/kharon-0.5.1.gem
|
146
|
+
- doc/Kharon.html
|
147
|
+
- doc/Kharon/Configuration.html
|
148
|
+
- doc/Kharon/Errors.html
|
149
|
+
- doc/Kharon/Errors/Validation.html
|
150
|
+
- doc/Kharon/Handlers.html
|
151
|
+
- doc/Kharon/Handlers/Exceptions.html
|
152
|
+
- doc/Kharon/Handlers/Messages.html
|
153
|
+
- doc/Kharon/Helpers.html
|
154
|
+
- doc/Kharon/Validator.html
|
155
|
+
- doc/_index.html
|
156
|
+
- doc/class_list.html
|
157
|
+
- doc/css/common.css
|
158
|
+
- doc/css/full_list.css
|
159
|
+
- doc/css/style.css
|
160
|
+
- doc/file.README.html
|
161
|
+
- doc/file.results.html
|
162
|
+
- doc/file_list.html
|
163
|
+
- doc/frames.html
|
164
|
+
- doc/index.html
|
165
|
+
- doc/js/app.js
|
166
|
+
- doc/js/full_list.js
|
167
|
+
- doc/js/jquery.js
|
168
|
+
- doc/method_list.html
|
169
|
+
- doc/top-level-namespace.html
|
51
170
|
- kharon.gemspec
|
52
171
|
- lib/kharon.rb
|
53
|
-
- lib/kharon/
|
172
|
+
- lib/kharon/errors.rb
|
54
173
|
- lib/kharon/errors/validation.rb
|
174
|
+
- lib/kharon/handlers.rb
|
55
175
|
- lib/kharon/handlers/exceptions.rb
|
56
176
|
- lib/kharon/handlers/messages.rb
|
57
|
-
- lib/kharon/helpers/validate.rb
|
58
177
|
- lib/kharon/validator.rb
|
59
178
|
- lib/kharon/version.rb
|
60
179
|
- spec/lib/kharon/errors/validation_spec.rb
|
61
180
|
- spec/lib/kharon/handlers/exceptions_spec.rb
|
181
|
+
- spec/lib/kharon/handlers/messages_spec.rb
|
62
182
|
- spec/lib/kharon/validator_spec.rb
|
63
183
|
- spec/lib/kharon_spec.rb
|
184
|
+
- spec/results.html
|
64
185
|
- spec/spec_helper.rb
|
65
186
|
- spec/utils/fake_config.yml
|
66
187
|
homepage: https://rubygems.org/gems/kharon
|
67
188
|
licenses:
|
68
189
|
- Apache License 2
|
190
|
+
metadata: {}
|
69
191
|
post_install_message:
|
70
192
|
rdoc_options: []
|
71
193
|
require_paths:
|
72
194
|
- lib
|
73
195
|
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
196
|
requirements:
|
76
197
|
- - ! '>='
|
77
198
|
- !ruby/object:Gem::Version
|
78
199
|
version: 1.9.3
|
79
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
-
none: false
|
81
201
|
requirements:
|
82
202
|
- - ! '>='
|
83
203
|
- !ruby/object:Gem::Version
|
84
204
|
version: '0'
|
85
205
|
requirements: []
|
86
206
|
rubyforge_project:
|
87
|
-
rubygems_version:
|
207
|
+
rubygems_version: 2.4.3
|
88
208
|
signing_key:
|
89
|
-
specification_version:
|
209
|
+
specification_version: 4
|
90
210
|
summary: Ruby Hash validator
|
91
211
|
test_files:
|
92
212
|
- spec/spec_helper.rb
|
data/lib/kharon/configuration.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
require "singleton"
|
2
|
-
require "yaml"
|
3
|
-
|
4
|
-
module Kharon
|
5
|
-
|
6
|
-
# Simple wrapper for the configuration.
|
7
|
-
# @author Vincent Courtois <courtois.vincent@outlook.com>
|
8
|
-
class Configuration
|
9
|
-
include Singleton
|
10
|
-
|
11
|
-
attr_accessor :configuration
|
12
|
-
|
13
|
-
# Constructor of the configuration, initializes default values for each usable key.
|
14
|
-
def initialize
|
15
|
-
@configuration = {
|
16
|
-
exceptions: true
|
17
|
-
}
|
18
|
-
end
|
19
|
-
|
20
|
-
def use_exceptions(use = true)
|
21
|
-
@configuration[:exceptions] = use
|
22
|
-
end
|
23
|
-
|
24
|
-
def uses_exceptions?
|
25
|
-
@configuration[:exceptions]
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module Kharon
|
2
|
-
module Helpers
|
3
|
-
|
4
|
-
# Validates the datas passed as parameter with a Phenix::Validator and the given instructions.
|
5
|
-
# @param [Hash] datas the parameters to validate with the given instructions.
|
6
|
-
# @param [Proc] block the instructions to apply on the validator.
|
7
|
-
# @return [Hash] the validated and filtered datas.
|
8
|
-
def validate(datas, &block)
|
9
|
-
validator = Kharon::Validator.new(datas)
|
10
|
-
validator.instance_eval(&block)
|
11
|
-
return validator.filtered
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|