rock-n-code-validator 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/CHANGES +31 -0
  2. data/LICENSE +34 -0
  3. data/README +31 -0
  4. data/Rakefile +61 -0
  5. data/TODO +1 -0
  6. metadata +60 -0
data/CHANGES ADDED
@@ -0,0 +1,31 @@
1
+ ==== 0.3.2 ~ April 22, 2009
2
+ * Fixed bug that appeared during the registration of a Validation class.
3
+ * Fixed bug that appeared during the definition of a rule within a Validation class.
4
+ * Fixed bug that appeared during the definition of a condition within a Validation class.
5
+
6
+ ==== 0.3.1 ~ April 21, 2009
7
+ * Added Validator#validate method.
8
+
9
+ ==== 0.3.0 ~ April 16, 2009
10
+ * Added Validator#register method.
11
+
12
+ ==== 0.2.2 ~ April 14, 2009
13
+ * Fixed bug related to the storage of conditions that appeared while validating an instance.
14
+
15
+ ==== 0.2.1 ~ April 11, 2009
16
+ * Fixed bug related to the storage of rules and conditions that appeared while defining either a rule or a condition.
17
+
18
+ ==== 0.2.0 ~ April 9, 2009
19
+ * Added Validator::Base#validate method.
20
+
21
+ ==== 0.1.2 ~ April 7, 2009
22
+ * Added Validator::Base#define_condition method.
23
+
24
+ ==== 0.1.1 ~ April 7, 2009
25
+ * Added Validator::Base#define_rule method.
26
+
27
+ ==== 0.1.0 ~ April 6, 2009
28
+ * Added Validator::Base#define_group method.
29
+
30
+ ==== 0.0.1 ~ April 5, 2009
31
+ * Initial commit.
data/LICENSE ADDED
@@ -0,0 +1,34 @@
1
+ === Creative Commons GPL.
2
+
3
+ GNU General Public License, Free Software Foundation
4
+
5
+ The GNU General Public License is a Free Software license. Like any Free
6
+ Software license, it grants to you the four following freedoms:
7
+
8
+ 1. The freedom to run the program for any purpose.
9
+ 2. The freedom to study how the program works and adapt it to your needs.
10
+ 3. The freedom to redistribute copies so you can help your neighbor.
11
+ 4. The freedom to improve the program and release your improvements to the
12
+ public, so that the whole community benefits.
13
+
14
+ You may exercise the freedoms specified here provided that you comply with the
15
+ express conditions of this license. The principal conditions are:
16
+
17
+ - You must conspicuously and appropriately publish on each copy distributed an
18
+ appropriate copyright notice and disclaimer of warranty and keep intact all
19
+ the notices that refer to this License and to the absence of any warranty;
20
+ and give any other recipients of the Program a copy of the GNU General Public
21
+ License along with the Program. Any translation of the GNU General Public
22
+ License must be accompanied by the GNU General Public License.
23
+ - If you modify your copy or copies of the program or any portion of it, or
24
+ develop a program based upon it, you may distribute the resulting work
25
+ provided you do so under the GNU General Public License. Any translation of
26
+ the GNU General Public License must be accompanied by the GNU General Public
27
+ License.
28
+ - If you copy or distribute the program, you must accompany it with the complete
29
+ corresponding machine-readable source code or with a written offer, valid for
30
+ at least three years, to furnish the complete corresponding machine-readable
31
+ source code.
32
+
33
+ Any of the above conditions can be waived if you get permission from the
34
+ copyright holder.
data/README ADDED
@@ -0,0 +1,31 @@
1
+ == VALIDATOR
2
+
3
+ === Vision
4
+
5
+ Instance validation is robustness.
6
+
7
+ === Purpose.
8
+
9
+ The sole purpose of this DSL s to simplify the creation of validation libraries
10
+ for the Ruby Programming Language.
11
+
12
+ === Concept.
13
+
14
+ Being Ruby a dynamic programming language, it does not verify instance types
15
+ per se. Even tough Ruby provides type verification mechanisms such as Duck
16
+ Typing, exhaustive unit testing and methods like Object#is_a?,
17
+ Object#instance_of?, Object#kind_of? and Object#respond_to?, it is require to
18
+ write extra lines of code every time you require to validate any data instance.
19
+
20
+ Validator is a Domain Specific Language (DSL) written to address this lack of
21
+ out-of-the-box functionality by simplifying the creation of validation libraries
22
+ in Ruby.
23
+
24
+ === Features.
25
+
26
+ The current version of this library implements these features:
27
+ - Generic definition of group of classes, rules and conditions.
28
+ - Generic Validator::Base class for creating user-defined Validation classes.
29
+ - Registration of user-defined Validation classes.
30
+ - Generic validations of instance with or without user-defined conditions.
31
+ - Works with Ruby interpreters version 1.8.X and 1.9.X.
data/Rakefile ADDED
@@ -0,0 +1,61 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'rake/clean'
4
+ require 'rake/gempackagetask'
5
+ require 'rake/rdoctask'
6
+ require 'spec/rake/spectask'
7
+
8
+ desc 'GemSpec definition.'
9
+ gemspec = Gem::Specification.new do |specification|
10
+ specification.name = 'validator'
11
+ specification.rubyforge_project = 'validator'
12
+ specification.version = '0.3.3'
13
+ specification.date = '2009-04-23'
14
+ specification.author = 'Julio Javier Cicchelli'
15
+ specification.email = 'javier@rock-n-code.com'
16
+ specification.homepage = 'http://rock-n-code.com'
17
+ specification.summary = 'A DSL for validation libraries.'
18
+ specification.description = <<-DESCRIPTION
19
+ A Domain Specific Language for Validations written in pure Ruby.
20
+ DESCRIPTION
21
+ specification.files = %w(LICENSE README CHANGES TODO Rakefile) + \
22
+ Dir.glob('{lib,spec}/**/*')
23
+ specification.require_path = 'lib'
24
+ specification.has_rdoc = true
25
+ specification.extra_rdoc_files = %w(README LICENSE CHANGES TODO)
26
+ end
27
+
28
+ desc 'Package building.'
29
+ Rake::GemPackageTask.new(gemspec) do |package|
30
+ package.gem_spec = gemspec
31
+ package.need_tar = false
32
+ package.need_zip = false
33
+ end
34
+
35
+ desc 'Documentation generation.'
36
+ Rake::RDocTask.new do |documentation|
37
+ documentation.rdoc_files.add(%w(README LICENSE CHANGES TODO lib/**/*.rb))
38
+ documentation.main = 'README'
39
+ documentation.title = 'Validator Documentation'
40
+ documentation.rdoc_dir = 'doc/rdoc'
41
+ documentation.options << '--line-numbers' << '--inline-source'
42
+ end
43
+
44
+ desc 'Unit testing with RSpec.'
45
+ Spec::Rake::SpecTask.new do |rspec|
46
+ rspec.spec_files = FileList['spec/**/*.rb']
47
+ end
48
+
49
+ desc 'Cleaning the generated packaging and documentation files.'
50
+ CLEAN.include %w(**/.*.sw? pkg lib/*.bundle lib/*.so *.gem doc .config coverage
51
+ cache spec/**/*.log .DS_Store)
52
+
53
+ desc 'Building and installing as a local gem.'
54
+ task :install => [:clean, :package] do
55
+ system 'gem', 'install', 'pkg/#{gemspec.name}-#{gemspec.version}.gem'
56
+ end
57
+
58
+ desc 'Uninstalling the latest version of the created gem.'
59
+ task :uninstall => [:clean] do
60
+ system 'gem', 'uninstall', gemspec.name, '-v', gemspec.version.to_s
61
+ end
data/TODO ADDED
@@ -0,0 +1 @@
1
+ === ToDo's
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rock-n-code-validator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.3
5
+ platform: ruby
6
+ authors:
7
+ - Julio Javier Cicchelli
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-04-23 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: A Domain Specific Language for Validations written in pure Ruby.
17
+ email: javier@rock-n-code.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README
24
+ - LICENSE
25
+ - CHANGES
26
+ - TODO
27
+ files:
28
+ - LICENSE
29
+ - README
30
+ - CHANGES
31
+ - TODO
32
+ - Rakefile
33
+ has_rdoc: true
34
+ homepage: http://rock-n-code.com
35
+ post_install_message:
36
+ rdoc_options: []
37
+
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: "0"
45
+ version:
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: "0"
51
+ version:
52
+ requirements: []
53
+
54
+ rubyforge_project: validator
55
+ rubygems_version: 1.2.0
56
+ signing_key:
57
+ specification_version: 2
58
+ summary: A DSL for validation libraries.
59
+ test_files: []
60
+